pub trait PrivateKey<C: AsymmetricCrypto + ?Sized>: Clone {
    fn public_key(&self) -> C::PublicKey;
    fn sign<D: AsRef<[u8]>>(&self, data: D) -> C::Signature;
}
Expand description

A private key (also called secret key or sk in some literature) is the part of an asymmetric keypair which is never shared with anyone. It is used to sign a message sent to any recipient or to decrypt a message that was sent encrypted from any recipients.

Required Methods

Calculates the PublicKey that belongs to this private key. These two keys together form an asymmetric keypair, where the private key cannot be calculated from the public key with a reasonable effort, but the public key can be calculated from the private key cheaply.

Calculates the signature of a message that can be then verified using PublicKey::verify

Implementors