pub trait VerifyingKey: Serialize + DeserializeOwned + Hash + Display + Eq + Ord + ToFromBytes + for<'a> From<&'a Self::PrivKey> + Send + Sync + 'static + Clone {
    type PrivKey: SigningKey<PubKey = Self>;
    type Sig: Authenticator<PubKey = Self>;

    const LENGTH: usize;

    // Required method
    fn verify(
        &self,
        msg: &[u8],
        signature: &Self::Sig
    ) -> Result<(), FastCryptoError>;
}
Expand description

Trait impl’d by public keys in asymmetric cryptography.

The trait bounds are implemented so as to be symmetric and equivalent to the ones on its associated types for private and signature material.

Required Associated Types§

type PrivKey: SigningKey<PubKey = Self>

type Sig: Authenticator<PubKey = Self>

Required Associated Constants§

const LENGTH: usize

Required Methods§

fn verify( &self, msg: &[u8], signature: &Self::Sig ) -> Result<(), FastCryptoError>

Use Self to verify that the provided signature for a given message bytestring is authentic. Returns Error if it is inauthentic, or otherwise returns ().

Object Safety§

This trait is not object safe.

Implementors§

§

impl VerifyingKey for BLS12381PublicKey

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

const LENGTH: usize = 48usize

§

impl VerifyingKey for BLS12381PublicKey

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

const LENGTH: usize = 96usize

§

impl VerifyingKey for Ed25519PublicKey

§

type PrivKey = Ed25519PrivateKey

§

type Sig = Ed25519Signature

§

const LENGTH: usize = 32usize

§

impl VerifyingKey for Secp256k1PublicKey

§

type PrivKey = Secp256k1PrivateKey

§

type Sig = Secp256k1Signature

§

const LENGTH: usize = 33usize

§

impl VerifyingKey for Secp256r1PublicKey

§

type PrivKey = Secp256r1PrivateKey

§

type Sig = Secp256r1Signature

§

const LENGTH: usize = 33usize