Skip to main content

CachedIdentity

Struct CachedIdentity 

Source
pub struct CachedIdentity { /* private fields */ }
Expand description

Zero-KDF identity for session reads.

Returns the cached FileKey directly without any cryptographic operations.

Implementations§

Source§

impl CachedIdentity

Source

pub fn new(material: &CachedMaterial) -> Self

Create a new cached identity from previously captured key material.

Trait Implementations§

Source§

impl Drop for CachedIdentity

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Identity for CachedIdentity

Source§

fn unwrap_stanza( &self, stanza: &Stanza, ) -> Option<Result<FileKey, DecryptError>>

Return the cached FileKey for any matching stanza.

This intentionally skips body verification: the cached file key was already authenticated during the initial full-KDF Argon2idIdentity decryption. If the file key is wrong (e.g. corrupted keychain), the age STREAM layer will detect it via its per-chunk Poly1305 MAC and return a decryption error — no silent data corruption is possible.

Source§

fn unwrap_stanzas( &self, stanzas: &[Stanza], ) -> Option<Result<FileKey, DecryptError>>

Attempts to unwrap any of the given stanzas, which are assumed to come from the same age file header, and therefore contain the same file key. Read more

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V