Skip to main content

VerifyingKey

Trait VerifyingKey 

Source
pub trait VerifyingKey {
    // Required method
    fn verify(
        &self,
        algorithm: SignatureAlgorithm,
        signed_data: &[u8],
        signature_value: &[u8],
    ) -> Result<bool, DsigError>;

    // Provided methods
    fn validate_policy(
        &self,
        _policy: &VerificationPolicy,
    ) -> Result<(), DsigError> { ... }
    fn validate_signature_value(
        &self,
        algorithm: SignatureAlgorithm,
        signature_value: &[u8],
    ) -> Result<bool, DsigError> { ... }
}
Expand description

Cryptographic verifier used by VerifyContext.

This trait intentionally has no Send + Sync supertraits so lightweight single-threaded verifiers can be used without additional bounds.

Required Methods§

Source

fn verify( &self, algorithm: SignatureAlgorithm, signed_data: &[u8], signature_value: &[u8], ) -> Result<bool, DsigError>

Verify signature_value over signed_data with the declared algorithm.

Provided Methods§

Source

fn validate_policy(&self, _policy: &VerificationPolicy) -> Result<(), DsigError>

Validate this key against the operation’s immutable trust policy.

Built-in keys override this hook so pre-resolved and resolver-produced keys enforce identical strength constraints. Custom opaque keys may retain their own policy enforcement by accepting the default no-op.

Source

fn validate_signature_value( &self, algorithm: SignatureAlgorithm, signature_value: &[u8], ) -> Result<bool, DsigError>

Check that signature_value has the wire framing required by the declared algorithm and this key before provider dispatch.

Key implementations with key-size-dependent framing should override this method. The default enforces the algorithm-wide XMLDSig envelope.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§