Trait AsyncRawSignatureValidator

Source
pub trait AsyncRawSignatureValidator {
    // Required method
    fn validate_async<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        sig: &'life1 [u8],
        data: &'life2 [u8],
        public_key: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), RawSignatureValidationError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

An AsyncRawSignatureValidator implementation checks a signature encoded using a specific signature algorithm and a private/public key pair.

IMPORTANT: This signature is typically embedded in a wrapper provided by another signature mechanism. In the C2PA ecosystem, this wrapper is typically COSE, but AsyncRawSignatureValidator does not implement COSE.

The WASM implementation of c2pa-crypto also implements RawSignatureValidator (the synchronous version), but some encryption algorithms are not supported. For that reason, it’s preferable to use this implementation on WASM.

Required Methods§

Source

fn validate_async<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, sig: &'life1 [u8], data: &'life2 [u8], public_key: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), RawSignatureValidationError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Return Ok(()) if the signature sig is valid for the raw content data and the public key public_key.

Implementors§