pub trait KeypairTraits: Sized + From<Self::PrivKey> + Signer<Self::Sig> + EncodeDecodeBase64 + FromStr {
    type PubKey: VerifyingKey<PrivKey = Self::PrivKey, Sig = Self::Sig>;
    type PrivKey: SigningKey<PubKey = Self::PubKey, Sig = Self::Sig>;
    type Sig: Authenticator<PubKey = Self::PubKey, PrivKey = Self::PrivKey>;

    // Required methods
    fn public(&self) -> &Self::PubKey;
    fn private(self) -> Self::PrivKey;
    fn copy(&self) -> Self;
    fn generate<R>(rng: &mut R) -> Self
       where R: AllowedRng;
}
Expand description

Trait impl’d by a public / private key pair in asymmetric cryptography.

Required Associated Types§

type PubKey: VerifyingKey<PrivKey = Self::PrivKey, Sig = Self::Sig>

type PrivKey: SigningKey<PubKey = Self::PubKey, Sig = Self::Sig>

type Sig: Authenticator<PubKey = Self::PubKey, PrivKey = Self::PrivKey>

Required Methods§

fn public(&self) -> &Self::PubKey

Get the public key.

fn private(self) -> Self::PrivKey

Get the private key.

fn copy(&self) -> Self

fn generate<R>(rng: &mut R) -> Self
where R: AllowedRng,

Generate a new keypair using the given RNG.

Object Safety§

This trait is not object safe.

Implementors§

§

impl KeyPair for BLS12381KeyPair

§

type PubKey = BLS12381PublicKey

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

impl KeyPair for BLS12381KeyPair

§

type PubKey = BLS12381PublicKey

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

impl KeyPair for Ed25519KeyPair

§

type PubKey = Ed25519PublicKey

§

type PrivKey = Ed25519PrivateKey

§

type Sig = Ed25519Signature

§

impl KeyPair for Secp256k1KeyPair

§

type PubKey = Secp256k1PublicKey

§

type PrivKey = Secp256k1PrivateKey

§

type Sig = Secp256k1Signature

§

impl KeyPair for Secp256r1KeyPair

§

type PubKey = Secp256r1PublicKey

§

type PrivKey = Secp256r1PrivateKey

§

type Sig = Secp256r1Signature