[][src]Trait age::Identity

pub trait Identity {
    pub fn unwrap_stanza(
        &self,
        stanza: &Stanza
    ) -> Option<Result<FileKey, DecryptError>>; pub fn unwrap_stanzas(
        &self,
        stanzas: &[Stanza]
    ) -> Option<Result<FileKey, DecryptError>> { ... } }

A private key or other value that can unwrap an opaque file key from a recipient stanza.

Required methods

pub fn unwrap_stanza(
    &self,
    stanza: &Stanza
) -> Option<Result<FileKey, DecryptError>>
[src]

Attempts to unwrap the given stanza with this identity.

This method is part of the Identity trait to expose age's one joint for external implementations. You should not need to call this directly; instead, pass identities to RecipientsDecryptor::decrypt.

Returns:

  • Some(Ok(file_key)) on success.
  • Some(Err(e)) if a decryption error occurs.
  • None if the recipient stanza does not match this key.
Loading content...

Provided methods

pub fn unwrap_stanzas(
    &self,
    stanzas: &[Stanza]
) -> Option<Result<FileKey, DecryptError>>
[src]

Attempts to unwrap any of the given stanzas, which are assumed to come from the same age file header, and therefore contain the same file key.

This method is part of the Identity trait to expose age's one joint for external implementations. You should not need to call this directly; instead, pass identities to RecipientsDecryptor::decrypt.

Returns:

  • Some(Ok(file_key)) on success.
  • Some(Err(e)) if a decryption error occurs.
  • None if none of the recipient stanzas match this identity.
Loading content...

Implementors

impl Identity for Identity[src]

Loading content...