pub trait Signature: Sized {
    type Signer: Clone;
    type Key;

    // Required methods
    fn signer(&self) -> Option<Self::Signer>;
    fn verify_bytes<M>(
        &self,
        message: M,
        key: &Self::Key
    ) -> Result<bool, VerificationError>
       where M: AsRef<[u8]>;
}
Expand description

Signature entity.

Required Associated Types§

source

type Signer: Clone

An entity that produced this signature.

source

type Key

Key used to create this signature.

Required Methods§

source

fn signer(&self) -> Option<Self::Signer>

An entity that produced this signature.

source

fn verify_bytes<M>( &self, message: M, key: &Self::Key ) -> Result<bool, VerificationError>where M: AsRef<[u8]>,

Returns Ok(true) if the underlying signature was produced on supplied bytes using the given key.

Implementors§

source§

impl<D> Signature for DidOrDidMethodKeySignature<D>where D: Into<DidOrDidMethodKey> + From<DidOrDidMethodKey> + Clone,

source§

impl<D> Signature for DidSignature<D>where D: Into<Did> + Clone,

§

type Signer = D

§

type Key = DidKey

source§

impl<DK> Signature for DidMethodKeySignature<DK>where DK: Into<DidMethodKey> + Clone,

Verifies that did’s key with id key_id can either authenticate or control otherwise returns an error. Then provided signature will be verified against the supplied public key and true returned for a valid signature.

§

type Signer = DK

§

type Key = DidMethodKey