Skip to main content

encode_ssh_signature

Function encode_ssh_signature 

Source
pub fn encode_ssh_signature(signature: &[u8]) -> Vec<u8> 
Expand description

Encode a raw Ed25519 signature in SSH signature wire format.

Produces a byte blob with the signature type string (“ssh-ed25519”) followed by the raw signature bytes, both length-prefixed as SSH strings.

Args:

  • signature: Raw Ed25519 signature bytes.

Usage:

use auths_core::crypto::ssh::encode_ssh_signature;
let blob = encode_ssh_signature(&[0xAB; 64]);
assert_eq!(&blob[4..15], b"ssh-ed25519");