Enum age::ssh::Identity

source ·
pub enum Identity {
    Unencrypted(UnencryptedKey),
    Encrypted(EncryptedKey),
    Unsupported(UnsupportedKey),
}
Available on crate feature ssh only.
Expand description

An SSH private key for decrypting an age file.

Variants§

§

Unencrypted(UnencryptedKey)

An unencrypted key.

§

Encrypted(EncryptedKey)

An encrypted key.

§

Unsupported(UnsupportedKey)

A key that we know how to parse, but that we do not support.

Implementations§

source§

impl Identity

source

pub fn from_buffer<R: BufRead>( data: R, filename: Option<String> ) -> Result<Self>

Parses one or more identities from a buffered input containing valid UTF-8.

filename is the path to the file that the input is reading from, if any.

source

pub fn with_callbacks<C: Callbacks>(self, callbacks: C) -> impl Identity

Wraps this identity with the provided callbacks, so that if this is an encrypted identity, it can potentially be decrypted.

Trait Implementations§

source§

impl Clone for Identity

source§

fn clone(&self) -> Identity

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<EncryptedKey> for Identity

source§

fn from(key: EncryptedKey) -> Self

Converts to this type from the input type.
source§

impl From<UnsupportedKey> for Identity

source§

fn from(key: UnsupportedKey) -> Self

Converts to this type from the input type.
source§

impl Identity for Identity

source§

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

Attempts to unwrap the given stanza with this identity. Read more
source§

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

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. Read more
source§

impl TryFrom<Identity> for Recipient

§

type Error = ParseRecipientKeyError

The type returned in the event of a conversion error.
source§

fn try_from(identity: Identity) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V