Skip to main content

PasswordProvider

Trait PasswordProvider 

Source
pub trait PasswordProvider: Send + Sync {
    // Required method
    fn get_password(
        &self,
        key: Option<&Key<'_>>,
        context: &str,
    ) -> Option<Cow<'_, str>>;
}
Expand description

What the library calls when it needs a passphrase to unlock a secret key.

Implementations return the password as Cow<str>; it is copied into the librnp-provided buffer before the callback returns.

Required Methods§

Source

fn get_password( &self, key: Option<&Key<'_>>, context: &str, ) -> Option<Cow<'_, str>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§