pub trait ContentCipher:
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>>;
}Available on crate feature
encryption only.Expand description
Seals and opens part content for EncryptedTaskStore.
The same shape as PushConfigCipher (with the sqlite or postgres
feature), so one implementation can serve
both; Aes256GcmCipher does. context names where the value is stored
and must be authenticated with it, as an AEAD’s associated data: opening
under any other context must fail. An implementation must use an
authenticated cipher, never reuse a nonce under one key, and fail rather
than return unauthenticated plaintext.
Required Methods§
Sourcefn seal<'a>(
&'a self,
plaintext: Vec<u8>,
context: &'a [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, A2aError>> + Send + 'a>>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".