age

Trait Callbacks

Source
pub trait Callbacks {
    // Required methods
    fn prompt(&self, message: &str);
    fn request_public_string(&self, description: &str) -> Option<String>;
    fn request_passphrase(&self, description: &str) -> Option<SecretString>;
}
Expand description

Callbacks that might be triggered during encryption or decryption.

Structs that implement this trait should be given directly to the individual Recipient or Identity implementations that require them.

Required Methods§

Source

fn prompt(&self, message: &str)

Shows a message to the user.

This can be used to prompt the user to take some physical action, such as inserting a hardware key.

Source

fn request_public_string(&self, description: &str) -> Option<String>

Requests non-private input from the user.

To request private inputs, use Callbacks::request_passphrase.

Source

fn request_passphrase(&self, description: &str) -> Option<SecretString>

Requests a passphrase to decrypt a key.

Implementors§

Source§

impl Callbacks for UiCallbacks

Available on crate feature cli-common only.