Skip to main content

PushConfigCipher

Trait PushConfigCipher 

Source
pub trait PushConfigCipher:
    Send
    + Sync
    + 'static {
    // Required methods
    fn seal<'a>(
        &'a self,
        plaintext: Vec<u8>,
        context: &'a [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, A2aError>> + Send + 'a>>;
    fn open<'a>(
        &'a self,
        sealed: Vec<u8>,
        context: &'a [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, A2aError>> + Send + 'a>>;
}
Expand description

Encrypts push notification configs for an SQL store; see the module docs.

Required Methods§

Source

fn seal<'a>( &'a self, plaintext: Vec<u8>, context: &'a [u8], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, A2aError>> + Send + 'a>>

Encrypts plaintext, authenticating context with it.

§Errors

An error fails the store’s write, and nothing is stored.

Source

fn open<'a>( &'a self, sealed: Vec<u8>, context: &'a [u8], ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, A2aError>> + Send + 'a>>

Decrypts what seal returned for the same context.

§Errors

Must fail when sealed was altered or sealed under another context. The store’s read then fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl PushConfigCipher for Aes256GcmCipher

Available on crate features postgres or sqlite only.