identity_iota_interaction::types::crypto

Trait VerifyingKey

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§

const LENGTH: usize

Required Associated Types§

type PrivKey: SigningKey<PubKey = Self>

type Sig: Authenticator<PubKey = Self>

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

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§

§

impl VerifyingKey for BLS12381PublicKey

§

const LENGTH: usize = 96usize

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

impl VerifyingKey for BLS12381PublicKey

§

const LENGTH: usize = 48usize

§

type PrivKey = BLS12381PrivateKey

§

type Sig = BLS12381Signature

§

impl VerifyingKey for Ed25519PublicKey

§

const LENGTH: usize = 32usize

§

type PrivKey = Ed25519PrivateKey

§

type Sig = Ed25519Signature

§

impl VerifyingKey for Secp256k1PublicKey

§

const LENGTH: usize = 33usize

§

type PrivKey = Secp256k1PrivateKey

§

type Sig = Secp256k1Signature

§

impl VerifyingKey for Secp256r1PublicKey

§

const LENGTH: usize = 33usize

§

type PrivKey = Secp256r1PrivateKey

§

type Sig = Secp256r1Signature