Skip to main content

AesDecipher

Struct AesDecipher 

Source
pub struct AesDecipher<'c> { /* private fields */ }
Expand description

A Decipher over a single AesCipherText, produced by Aes256Cipher::decipher. Carries the cipher and ciphertext; the AAD is supplied per call by Decrypt::decrypt_with_aad.

Implementations§

Source§

impl AesDecipher<'_>

Source

pub fn decrypt_passthrough_as<T>(self) -> Result<T, Unspecified>
where T: Any + Send + 'static,

Typed convenience over Decipher::decrypt_passthrough for this cipher’s BoxedPassthrough payload type: recovers the payload and downcasts it to T, returning Unspecified if the ciphertext is not a passthrough or the stored type does not match.

Trait Implementations§

Source§

impl<'c> Decipher<'c> for AesDecipher<'c>

Source§

type Ok<T> = Result<T, Unspecified> where T: Send + 'c

The output container produced by a decrypt call. Implementations may wrap the result in Result<_, _> (sync) or BoxFuture<_, _> (async). Read more
Source§

type Passthrough = Box<dyn Any + Send>

The payload type returned by decrypt_passthrough — matches the encrypt-side Cipher::Passthrough.
Source§

fn map_ok<T, U, F>(ok: Self::Ok<T>, f: F) -> Self::Ok<U>
where T: Send + 'c, U: Send + 'c, F: FnOnce(T) -> U,

Transform the inner value of an Ok container. Read more
Source§

fn decrypt_bytes<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok<V::Value>
where V: DecipherVisitor<'c> + Send + 'c, A: IntoAad<'a>,

Decrypt a single byte-oriented ciphertext authenticated against aad, driving the visitor’s visit_bytes_vec. Read more
Source§

fn decrypt_seq<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok<V::Value>
where V: DecipherVisitor<'c> + Send + 'c, A: IntoAad<'a>,

Decrypt a sequence of ciphertexts authenticated against aad, driving the visitor’s visit_seq. Each element is verified against Context::for_sequence_element of aad, mirroring how SeqCipher::encrypt_next binds it per element. Read more
Source§

fn decrypt_map<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok<V::Value>
where V: DecipherVisitor<'c> + Send + 'c, A: IntoAad<'a>,

Decrypt a map of ciphertexts authenticated against aad, driving the visitor’s visit_map. aad is applied to every value, mirroring MapCipher::encrypt_value. Read more
Source§

fn decrypt_any<'a, V, A>(self, visitor: V, aad: A) -> Self::Ok<V::Value>
where V: DecipherVisitor<'c> + Send + 'c, A: IntoAad<'a>,

Decrypt a ciphertext whose structural shape is not known to the caller, dispatching to the visitor method matching the actual shape: visit_bytes_vec for a single sealed value, visit_seq for a sequence, visit_map for a map, and visit_none for an authenticated absent marker (whose AAD binding must be verified before the visitor is called). Read more
Source§

fn decrypt_passthrough(self) -> Self::Ok<Self::Passthrough>

Recover a value stored via Cipher::passthrough. Returns an error if the ciphertext is not a passthrough. Read more
Source§

fn decrypt_option<'a, T, A>(self, aad: A) -> Self::Ok<Option<T>>
where T: Decrypt<'c> + 'c, A: IntoAad<'a>,

Decrypt an Option<T>, authenticating against aad. The decipher inspects the ciphertext shape: a None-marker variant produces Ok(None) (after AAD verification); any other shape is decrypted as T and wrapped in Some.

Auto Trait Implementations§

§

impl<'c> !Freeze for AesDecipher<'c>

§

impl<'c> !RefUnwindSafe for AesDecipher<'c>

§

impl<'c> !Send for AesDecipher<'c>

§

impl<'c> !Sync for AesDecipher<'c>

§

impl<'c> !UnwindSafe for AesDecipher<'c>

§

impl<'c> Unpin for AesDecipher<'c>

§

impl<'c> UnsafeUnpin for AesDecipher<'c>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.