Trait dock_runtime::common::signatures::Signature
source · 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§
Required Methods§
sourcefn verify_bytes<M>(
&self,
message: M,
key: &Self::Key
) -> Result<bool, VerificationError>where
M: AsRef<[u8]>,
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,
impl<D> Signature for DidOrDidMethodKeySignature<D>where D: Into<DidOrDidMethodKey> + From<DidOrDidMethodKey> + Clone,
type Signer = D
type Key = DidKeyOrDidMethodKey
source§impl<DK> Signature for DidMethodKeySignature<DK>where
DK: Into<DidMethodKey> + Clone,
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.