[][src]Trait dup_crypto::keys::KeyPair

pub trait KeyPair: Clone + Display + Debug + PartialEq + Eq {
    type Signator: Signator;
    fn generate_signator(&self) -> Self::Signator;
fn public_key(&self) -> <Self::Signator as Signator>::PublicKey;
fn seed(&self) -> &Seed32;
fn verify(
        &self,
        message: &[u8],
        signature: &<Self::Signator as Signator>::Signature
    ) -> Result<(), SigError>; }

Define the operations that can be performed on a cryptographic key pair.

Associated Types

type Signator: Signator

Signator type of associated cryptosystem.

Loading content...

Required methods

fn generate_signator(&self) -> Self::Signator

Generate signator.

fn public_key(&self) -> <Self::Signator as Signator>::PublicKey

Get PublicKey

fn seed(&self) -> &Seed32

Get Seed32

fn verify(
    &self,
    message: &[u8],
    signature: &<Self::Signator as Signator>::Signature
) -> Result<(), SigError>

Verify a signature with public key.

Loading content...

Implementors

impl KeyPair for KeyPairEnum[src]

type Signator = SignatorEnum

impl KeyPair for Ed25519KeyPair[src]

type Signator = Signator

Loading content...