pub trait JwsVerifier {
// Required method
fn verify(
&self,
input: VerificationInput,
public_key: &Jwk,
) -> Result<(), SingleStructError<SignatureVerificationErrorKind>>;
}Expand description
Trait for cryptographically verifying a JWS signature.
Any type implementing this trait can be passed to
JwsValidationItem::verify which is intended
as the most convenient way to verify a decoded JWS.
§Implementation
Implementers are expected to provide a procedure for step 8 of RFC 7515 section 5.2 for the JWS signature algorithms they want to support.
Custom implementations can be constructed inline by converting a suitable closure into a JwsVerifierFn
using the From trait.
§Default implementation
When the eddsa feature is enabled one can construct an implementor
provided by the IOTA Identity library. See
EdDSAJwsVerifier::verify.
Required Methods§
Sourcefn verify(
&self,
input: VerificationInput,
public_key: &Jwk,
) -> Result<(), SingleStructError<SignatureVerificationErrorKind>>
fn verify( &self, input: VerificationInput, public_key: &Jwk, ) -> Result<(), SingleStructError<SignatureVerificationErrorKind>>
Validate the decoded_signature against the signing_input in the manner defined by alg using the
public_key.
Implementors may decide to error with
SignatureVerificationErrorKind::UnsupportedAlg if
they are not interested in supporting a given algorithm.
Trait Implementations§
Source§impl JwsVerifier for Box<dyn JwsVerifier>
impl JwsVerifier for Box<dyn JwsVerifier>
Source§fn verify(
&self,
input: VerificationInput,
public_key: &Jwk,
) -> Result<(), SingleStructError<SignatureVerificationErrorKind>>
fn verify( &self, input: VerificationInput, public_key: &Jwk, ) -> Result<(), SingleStructError<SignatureVerificationErrorKind>>
decoded_signature against the signing_input in the manner defined by alg using the
public_key. Read more