Skip to main content

sign

Function sign 

Source
pub fn sign<'a, R>(
    pk: Option<&PublicKeyBox<'_>>,
    sk: &SecretKeyBox<'_>,
    password: Option<&[u8]>,
    data_reader: R,
    trusted_comment: Option<&'a str>,
    untrusted_comment: Option<&'a str>,
) -> Result<SignatureBox<'a>>
where R: Read,
Expand description

minisign some data

§Arguments

  • pk - The public key to verify the signature(optional)
  • sk - The secret key to sign the data
  • password - The password to decrypt the secret key
  • data_reader - The data to sign
  • trusted_comment - The trusted comment for the signature
  • untrusted_comment - The untrusted comment for the signature

§Returns

A Result containing the signature

§Errors

  • ErrorKind::Io - If there is an error reading the data
  • ErrorKind::SecretKey - If there is an error decrypting the secret key,password is wrong
  • ErrorKind::PublicKey - If the public key is invalid or not matching the secret key