Skip to main content

encode_ssh_pubkey

Function encode_ssh_pubkey 

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

Encode an Ed25519 public key in SSH wire format.

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

Args:

  • pubkey: Raw 32-byte Ed25519 public key.

Usage:

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