Skip to main content

sign

Function sign 

Source
pub fn sign<R: Read>(
    data: &mut R,
    key: &PrivateKey,
    namespace: &str,
    hash: HashAlg,
) -> Result<String, GitwayError>
Expand description

Signs the bytes read from data using key under namespace, returning the PEM-armored signature string ready to write to stdout or a file.

The armored output begins with -----BEGIN SSH SIGNATURE----- and ends with -----END SSH SIGNATURE-----\n — byte-compatible with ssh-keygen -Y sign.

§Errors

Returns GitwayError::signing on I/O or cryptographic failure. If key is encrypted, decrypt it before calling this function.