Trait VerificationKey

Source
pub trait VerificationKey:
    Send
    + Sync
    + Debug {
    // Required methods
    fn key_id(&self) -> &str;
    fn public_key_jwk(&self) -> Result<Value>;
    fn verify_signature<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        payload: &'life1 [u8],
        signature: &'life2 [u8],
        protected_header: &'life3 JwsProtected,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A key (typically public) capable of verifying a JWS signature.

This trait might be implemented by a struct holding a public JWK, or by an AgentKey that can expose its public verification capabilities.

Required Methods§

Source

fn key_id(&self) -> &str

The key ID associated with this verification key

Source

fn public_key_jwk(&self) -> Result<Value>

Exports the public key material as a JWK

Source

fn verify_signature<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, payload: &'life1 [u8], signature: &'life2 [u8], protected_header: &'life3 JwsProtected, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Verifies the provided signature against the payload and protected header

Implementors§