Struct sequoia_openpgp::packet::key::Encrypted [−][src]
pub struct Encrypted { /* fields omitted */ }
Expand description
Secret key material encrypted with a password.
This data structure is used by the SecretKeyMaterial
enum.
Implementations
pub fn new(
s2k: S2K,
algo: SymmetricAlgorithm,
checksum: Option<SecretKeyChecksum>,
ciphertext: Box<[u8]>
) -> Self
[src]
pub fn new(
s2k: S2K,
algo: SymmetricAlgorithm,
checksum: Option<SecretKeyChecksum>,
ciphertext: Box<[u8]>
) -> Self
[src]Creates a new encrypted key object.
Returns the symmetric algorithm used to encrypt the secret key material.
Returns the checksum method used to protect the encrypted secret key material, if any.
Returns the encrypted secret key material.
If the S2K
mechanism is not supported by Sequoia, this
function will fail. Note that the information is not lost,
but stored in the packet. If the packet is serialized again,
it is written out.
pub fn decrypt(
&self,
pk_algo: PublicKeyAlgorithm,
password: &Password
) -> Result<Unencrypted>
[src]
pub fn decrypt(
&self,
pk_algo: PublicKeyAlgorithm,
password: &Password
) -> Result<Unencrypted>
[src]Decrypts the secret key material using password
.
The Encrypted
key does not know what kind of key it is, so
the public key algorithm is needed to parse the correct number
of MPIs.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Encrypted
impl UnwindSafe for Encrypted
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self