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
impl Identity
Sourcepub fn from_buffer<R: BufRead>(
data: R,
filename: Option<String>,
) -> Result<Self>
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.
Sourcepub fn with_callbacks<C: Callbacks>(self, callbacks: C) -> impl Identity
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 From<EncryptedKey> for Identity
impl From<EncryptedKey> for Identity
Source§fn from(key: EncryptedKey) -> Self
fn from(key: EncryptedKey) -> Self
Converts to this type from the input type.
Source§impl From<UnsupportedKey> for Identity
impl From<UnsupportedKey> for Identity
Source§fn from(key: UnsupportedKey) -> Self
fn from(key: UnsupportedKey) -> Self
Converts to this type from the input type.
Source§impl Identity for Identity
impl Identity for Identity
Source§fn unwrap_stanza(
&self,
stanza: &Stanza,
) -> Option<Result<FileKey, DecryptError>>
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>>
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
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more