pub enum Identity {
Unencrypted(UnencryptedKey),
Encrypted(EncryptedKey),
Unsupported(UnsupportedKey),
}
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
sourceimpl 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
sourceimpl From<EncryptedKey> for Identity
impl From<EncryptedKey> for Identity
sourcefn from(key: EncryptedKey) -> Self
fn from(key: EncryptedKey) -> Self
Converts to this type from the input type.
sourceimpl From<UnsupportedKey> for Identity
impl From<UnsupportedKey> for Identity
sourcefn from(key: UnsupportedKey) -> Self
fn from(key: UnsupportedKey) -> Self
Converts to this type from the input type.
sourceimpl Identity for Identity
impl Identity for Identity
sourcefn 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
sourcefn 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 RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more