Skip to main content

registration_challenge_bytes

Function registration_challenge_bytes 

Source
pub fn registration_challenge_bytes(
    public_key_hex: &str,
    org: &str,
    name: &str,
    nonce: &str,
    issued_at_unix: i64,
) -> Result<Vec<u8>>
Expand description

Produce the canonical bytes that a client signs to prove possession of the private key matching public_key_hex when registering an agent.

Format (line-based, LF terminator on each line, no trailing LF on the last line):

spize-register:v1
pub={public_key_hex}
org={org}
name={name}
nonce={nonce}
ts={issued_at_unix}

All inputs must be ASCII. The function validates inputs and returns an error if any field contains characters that could allow canonicalization ambiguity (newlines, NULs, non-ASCII).