[−][src]Trait dup_crypto::keys::KeyPair
Define the operations that can be performed on a cryptographic key pair.
Associated Types
type Signature: Signature
Signature type of associated cryptosystem.
type PublicKey: PublicKey
PublicKey type of associated cryptosystem.
type PrivateKey: PrivateKey
PrivateKey type of associated cryptosystem.
Required methods
fn public_key(&self) -> Self::PublicKey
Get PublicKey
fn private_key(&self) -> Self::PrivateKey
Get PrivateKey
fn sign(&self, message: &[u8]) -> Self::Signature
Sign a message with private key.
fn verify(&self, message: &[u8], signature: &Self::Signature) -> bool
Verify a signature with public key.