VerifyingKey

Trait VerifyingKey 

Source
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 Constants§

Required Associated Types§

Source

type PrivKey: SigningKey<PubKey = Self>

Source

type Sig: Authenticator<PubKey = Self>

Required Methods§

Source

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 ().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§