Struct age::decryptor::PassphraseDecryptor
source · [−]pub struct PassphraseDecryptor<R>(_);
Expand description
Decryptor for an age file encrypted with a passphrase.
Implementations
sourceimpl<R: Read> PassphraseDecryptor<R>
impl<R: Read> PassphraseDecryptor<R>
sourcepub fn decrypt(
self,
passphrase: &SecretString,
max_work_factor: Option<u8>
) -> Result<StreamReader<R>, DecryptError>
pub fn decrypt(
self,
passphrase: &SecretString,
max_work_factor: Option<u8>
) -> Result<StreamReader<R>, DecryptError>
Attempts to decrypt the age file.
max_work_factor
is the maximum accepted work factor. If None
, the default
maximum is adjusted to around 16 seconds of work.
If successful, returns a reader that will provide the plaintext.
sourceimpl<R: AsyncRead + Unpin> PassphraseDecryptor<R>
impl<R: AsyncRead + Unpin> PassphraseDecryptor<R>
sourcepub fn decrypt_async(
self,
passphrase: &SecretString,
max_work_factor: Option<u8>
) -> Result<StreamReader<R>, DecryptError>
Available on crate feature async
only.
pub fn decrypt_async(
self,
passphrase: &SecretString,
max_work_factor: Option<u8>
) -> Result<StreamReader<R>, DecryptError>
async
only.Attempts to decrypt the age file.
max_work_factor
is the maximum accepted work factor. If None
, the default
maximum is adjusted to around 16 seconds of work.
If successful, returns a reader that will provide the plaintext.
Trait Implementations
sourceimpl<R> From<PassphraseDecryptor<R>> for Decryptor<R>
impl<R> From<PassphraseDecryptor<R>> for Decryptor<R>
sourcefn from(decryptor: PassphraseDecryptor<R>) -> Self
fn from(decryptor: PassphraseDecryptor<R>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<R> RefUnwindSafe for PassphraseDecryptor<R> where
R: RefUnwindSafe,
impl<R> Send for PassphraseDecryptor<R> where
R: Send,
impl<R> Sync for PassphraseDecryptor<R> where
R: Sync,
impl<R> Unpin for PassphraseDecryptor<R> where
R: Unpin,
impl<R> UnwindSafe for PassphraseDecryptor<R> where
R: UnwindSafe,
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