pub struct Aes256GcmCodec { /* private fields */ }Implementations§
Source§impl Aes256GcmCodec
impl Aes256GcmCodec
pub fn new(key_id: impl Into<String>, key: [u8; 32]) -> Self
pub const fn with_ttl(self, ttl: Duration) -> Self
Sourcepub fn decode(
&self,
payload: &EncryptedPayload,
) -> Result<Vec<u8>, EncryptionError>
pub fn decode( &self, payload: &EncryptedPayload, ) -> Result<Vec<u8>, EncryptionError>
Decode a payload produced by this codec.
§Errors
Returns an error for the wrong key id, malformed base64, invalid nonce, or failed authentication.
Trait Implementations§
Source§impl Clone for Aes256GcmCodec
impl Clone for Aes256GcmCodec
Source§impl PayloadCodec for Aes256GcmCodec
impl PayloadCodec for Aes256GcmCodec
Source§fn encode(&self, plaintext: &[u8]) -> Result<EncryptedPayload, EncryptionError>
fn encode(&self, plaintext: &[u8]) -> Result<EncryptedPayload, EncryptionError>
Encode serialized page JSON for a trusted client or intermediary. Read more
Auto Trait Implementations§
impl Freeze for Aes256GcmCodec
impl RefUnwindSafe for Aes256GcmCodec
impl Send for Aes256GcmCodec
impl Sync for Aes256GcmCodec
impl Unpin for Aes256GcmCodec
impl UnsafeUnpin for Aes256GcmCodec
impl UnwindSafe for Aes256GcmCodec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more