Skip to main content

construct_sshsig_pem

Function construct_sshsig_pem 

Source
pub fn construct_sshsig_pem(
    pubkey: &[u8],
    signature: &[u8],
    namespace: &str,
) -> Result<String, CryptoError>
Expand description

Construct the final SSHSIG PEM from a public key and raw signature.

Builds the full SSHSIG binary structure (magic, version, pubkey, namespace, signature) and encodes it as base64-wrapped PEM.

Args:

  • pubkey: Raw 32-byte Ed25519 public key.
  • signature: Raw Ed25519 signature bytes.
  • namespace: The SSHSIG namespace (e.g., “git”).

Usage:

let sig_data = construct_sshsig_signed_data(data, "git")?;
let raw_sig = agent_sign(&socket, &pubkey, &sig_data)?;
let pem = construct_sshsig_pem(&pubkey, &raw_sig, "git")?;