Trait iop_keyvault::PrivateKey
source · [−]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
fn public_key(&self) -> C::PublicKey
fn public_key(&self) -> C::PublicKey
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.