pub trait Algorithm {
type Curve: Curve;
// Required method
fn maybe_prehash(msg: impl AsRef<[u8]>) -> impl AsRef<[u8]>;
// Provided method
fn verify(
public_key: &<Self::Curve as Curve>::PublicKey,
msg: impl AsRef<[u8]>,
signature: &<Self::Curve as Curve>::Signature,
) -> bool { ... }
}Expand description
Signature algorithm.
See https://www.iana.org/assignments/cose/cose.xhtml#algorithms
Required Associated Types§
Required Methods§
Sourcefn maybe_prehash(msg: impl AsRef<[u8]>) -> impl AsRef<[u8]>
fn maybe_prehash(msg: impl AsRef<[u8]>) -> impl AsRef<[u8]>
Optionally, prehash the message (or perform any other manipulations)
before passing it to Self::Curve::verify() in the
last signature verification step:
- Using credentialRecord.publicKey, verify that sig is a valid signature over the binary concatenation of authData and hash.
Provided Methods§
Sourcefn verify(
public_key: &<Self::Curve as Curve>::PublicKey,
msg: impl AsRef<[u8]>,
signature: &<Self::Curve as Curve>::Signature,
) -> bool
fn verify( public_key: &<Self::Curve as Curve>::PublicKey, msg: impl AsRef<[u8]>, signature: &<Self::Curve as Curve>::Signature, ) -> bool
Last algorithm-specific signature verification step:
- Using credentialRecord.publicKey, verify that sig is a valid signature over the binary concatenation of authData and hash.
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.