Trait duniter_keys::KeyPair [] [src]

pub trait KeyPair: Clone + Display + Debug + PartialEq + Eq {
    type Signature: Signature;
    type PublicKey: PublicKey;
    type PrivateKey: PrivateKey;
    fn public_key(&self) -> Self::PublicKey;
fn private_key(&self) -> Self::PrivateKey;
fn sign(&self, message: &[u8]) -> Self::Signature;
fn verify(&self, message: &[u8], signature: &Self::Signature) -> bool; }

Store a cryptographic key pair (PublicKey + PrivateKey)

Associated Types

Signature type of associated cryptosystem.

PublicKey type of associated cryptosystem.

PrivateKey type of associated cryptosystem.

Required Methods

Get PublicKey

Get PrivateKey

Sign a message with private key.

Verify a signature with public key.

Implementors