pub trait RecipientPluginV1 {
    // Required methods
    fn add_recipient(
        &mut self,
        index: usize,
        plugin_name: &str,
        bytes: &[u8]
    ) -> Result<(), Error>;
    fn add_identity(
        &mut self,
        index: usize,
        plugin_name: &str,
        bytes: &[u8]
    ) -> Result<(), Error>;
    fn wrap_file_keys(
        &mut self,
        file_keys: Vec<FileKey>,
        callbacks: impl Callbacks<Error>
    ) -> Result<Result<Vec<Vec<Stanza>>, Vec<Error>>>;
}
Expand description

The interface that age implementations will use to interact with an age plugin.

Required Methods§

source

fn add_recipient( &mut self, index: usize, plugin_name: &str, bytes: &[u8] ) -> Result<(), Error>

Stores a recipient that the user would like to encrypt age files to.

plugin_name is the name of the binary that resolved to this plugin.

Returns an error if the recipient is unknown or invalid.

source

fn add_identity( &mut self, index: usize, plugin_name: &str, bytes: &[u8] ) -> Result<(), Error>

Stores an identity that the user would like to encrypt age files to.

plugin_name is the name of the binary that resolved to this plugin.

Returns an error if the identity is unknown or invalid.

source

fn wrap_file_keys( &mut self, file_keys: Vec<FileKey>, callbacks: impl Callbacks<Error> ) -> Result<Result<Vec<Vec<Stanza>>, Vec<Error>>>

Wraps each file_key to all recipients and identities previously added via add_recipient and add_identity.

Returns either one stanza per recipient and identity for each file key, or any errors if one or more recipients or identities could not be wrapped to.

callbacks can be used to interact with the user, to have them take some physical action or request a secret value.

Object Safety§

This trait is not object safe.

Implementors§