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 datapassword- The password to decrypt the secret keydata_reader- The data to signtrusted_comment- The trusted comment for the signatureuntrusted_comment- The untrusted comment for the signature
§Returns
A Result containing the signature
§Errors
ErrorKind::Io- If there is an error reading the dataErrorKind::SecretKey- If there is an error decrypting the secret key,password is wrongErrorKind::PublicKey- If the public key is invalid or not matching the secret key