Struct sequoia_openpgp::crypto::Password [−][src]
pub struct Password(_);
Expand description
Holds a password.
Password
s can be converted from various types using From
.
The password is encrypted in memory and only decrypted on demand.
See mem::Encrypted
for details.
Examples
use sequoia_openpgp as openpgp; use openpgp::crypto::Password; // Convert from a &str. let p: Password = "hunter2".into(); // Convert from a &[u8]. let p: Password = b"hunter2"[..].into(); // Convert from a String. let p: Password = String::from("hunter2").into(); // ...
Implementations
Maps the given function over the password.
The password is stored encrypted in memory. This function temporarily decrypts it for the given function to use.
Examples
use sequoia_openpgp as openpgp; use openpgp::crypto::Password; let p: Password = "hunter2".into(); p.map(|p| assert_eq!(p.as_ref(), &b"hunter2"[..]));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Password
impl UnwindSafe for Password
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self