Enum sequoia_openpgp::packet::key::SecretKeyMaterial[][src]

pub enum SecretKeyMaterial {
    Unencrypted(Unencrypted),
    Encrypted(Encrypted),
}
Expand description

Holds secret key material.

This type allows postponing the decryption of the secret key material until it is actually needed.

If the secret key material is not encrypted with a password, then we encrypt it in memory. This helps protect against heartbleed-style attacks where a buffer over-read allows an attacker to read from the process’s address space. This protection is less important for Rust programs, which are memory safe. However, it is essential when Sequoia is used via its FFI.

See crypto::mem::Encrypted for details.

Variants

Unencrypted(Unencrypted)

Tuple Fields

Unencrypted secret key. Can be used as-is.

Encrypted(Encrypted)

Tuple Fields

The secret key is encrypted with a password.

Implementations

Decrypts the secret key material using password.

The SecretKeyMaterial type does not know what kind of key it contains. So, in order to know how many MPIs to parse, the public key algorithm needs to be provided explicitly.

This returns an error if the secret key material is not encrypted or the password is incorrect.

Decrypts the secret key material using password.

The SecretKeyMaterial type does not know what kind of key it contains. So, in order to know how many MPIs to parse, the public key algorithm needs to be provided explicitly.

This returns an error if the secret key material is not encrypted or the password is incorrect.

Encrypts the secret key material using password.

This returns an error if the secret key material is encrypted.

See Unencrypted::encrypt for details.

Encrypts the secret key material using password.

This returns an error if the secret key material is encrypted.

See Unencrypted::encrypt for details.

Returns whether the secret key material is encrypted.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.