Skip to main content

PassphraseCache

Trait PassphraseCache 

Source
pub trait PassphraseCache: Send + Sync {
    // Required methods
    fn store(
        &self,
        alias: &str,
        passphrase: &str,
        stored_at_unix: i64,
    ) -> Result<(), AgentError>;
    fn load(
        &self,
        alias: &str,
    ) -> Result<Option<(Zeroizing<String>, i64)>, AgentError>;
    fn delete(&self, alias: &str) -> Result<(), AgentError>;
}
Expand description

Trait for storing/retrieving passphrases in the OS keychain.

Required Methods§

Source

fn store( &self, alias: &str, passphrase: &str, stored_at_unix: i64, ) -> Result<(), AgentError>

Store a passphrase for the given alias.

Source

fn load( &self, alias: &str, ) -> Result<Option<(Zeroizing<String>, i64)>, AgentError>

Load a cached passphrase for the given alias. Returns None if no cached passphrase exists.

Source

fn delete(&self, alias: &str) -> Result<(), AgentError>

Delete a cached passphrase for the given alias.

Implementors§