pub trait IdentityPluginV1 {
    fn add_identity(
        &mut self,
        index: usize,
        plugin_name: &str,
        bytes: &[u8]
    ) -> Result<(), Error>; fn unwrap_file_keys(
        &mut self,
        files: Vec<Vec<Stanza>>,
        callbacks: impl Callbacks<Error>
    ) -> Result<HashMap<usize, Result<FileKey, Vec<Error>>>>; }
Expand description

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

Required Methods

Stores an identity that the user would like to use for decrypting age files.

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

Returns an error if the identity is unknown or invalid.

Attempts to unwrap the file keys contained within the given age recipient stanzas, using identities previously stored via add_identity.

Returns a HashMap containing the unwrapping results for each file:

  • A list of errors, if any stanzas for a file cannot be unwrapped that detectably should be unwrappable.

  • A FileKey, if any stanza for a file can be successfully unwrapped.

Note that if all known and valid stanzas for a given file cannot be unwrapped, and none are expected to be unwrappable, that file has no entry in the HashMap. That is, file keys that cannot be unwrapped are implicit.

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

Implementors