Skip to main content

DeviceIdentityCustody

Trait DeviceIdentityCustody 

Source
pub trait DeviceIdentityCustody: Send + Sync {
    // Required methods
    fn unlock(&self) -> Result<Option<UserKeypair>, KeyError>;
    fn persist(&self, keypair: &UserKeypair) -> Result<(), KeyError>;
    fn forget(&self) -> Result<(), KeyError>;
}
Expand description

A device’s signing identity’s custody FOR ONE STORE: who unlocks it, where a newly established one is written, and how it is removed. The signing-key sibling of MasterKeyCustody, same three-method shape and the same per-store selection, over UserKeypair instead of a store’s master keyring.

Required Methods§

Source

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

This store’s established signing identity. Ok(None) means none has ever been established — distinct from a failure to produce one (wrong passphrase, unreadable backing store), which is Err.

Source

fn persist(&self, keypair: &UserKeypair) -> Result<(), KeyError>

Protect and store keypair, replacing whatever is stored. Idempotent.

Source

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

Remove the stored identity. Ok when nothing was stored.

Implementors§