Skip to main content

Custody

Trait Custody 

Source
pub trait Custody<T>: Send + Sync
where T: KeyMaterial,
{ // Required methods fn unlock(&self) -> Result<Option<T>, KeyError>; fn persist(&self, material: &T) -> Result<(), KeyError>; fn forget(&self) -> Result<(), KeyError>; fn close(&self); }
Expand description

The app’s own store for key material this device holds (E1).

Required Methods§

Source

fn unlock(&self) -> Result<Option<T>, KeyError>

Called once at open; None when this device has never held T. Retain the unlocked persistence capability until close.

Source

fn persist(&self, material: &T) -> Result<(), KeyError>

Keeps material, replacing what was kept.

Source

fn forget(&self) -> Result<(), KeyError>

Removes what was kept; succeeds if nothing was kept.

Source

fn close(&self)

Erase held memory after users finish; performs no persistence or IO.

Implementors§

Source§

impl<T> Custody<T> for KeyringCustody<T>
where T: KeyMaterial,

Source§

impl<T> Custody<T> for InMemoryCustody<T>
where T: KeyMaterial,

Source§

impl<T> Custody<T> for PassphraseCustody<T>
where T: KeyMaterial,