pub struct Unencrypted { /* private fields */ }Expand description
Unencrypted secret key material.
This data structure is used by the SecretKeyMaterial enum.
Unlike an Encrypted key, this key can be used as-is.
The secret key is encrypted in memory and only decrypted on demand. 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.
Implementations§
Source§impl Unencrypted
impl Unencrypted
Sourcepub fn map<F, T>(&self, fun: F) -> Twhere
F: FnMut(&SecretKeyMaterial) -> T,
pub fn map<F, T>(&self, fun: F) -> Twhere
F: FnMut(&SecretKeyMaterial) -> T,
Maps the given function over the secret.
Sourcepub fn encrypt<P, R>(
&self,
key: &Key<P, R>,
password: &Password,
) -> Result<Encrypted>
pub fn encrypt<P, R>( &self, key: &Key<P, R>, password: &Password, ) -> Result<Encrypted>
Encrypts the secret key material using password.
This encrypts the secret key material using AES-128/OCB and a
key derived from the password using the default S2K
scheme.
Sourcepub fn encrypt_with<P, R>(
&self,
key: &Key<P, R>,
s2k: S2K,
symm: SymmetricAlgorithm,
aead: Option<AEADAlgorithm>,
password: &Password,
) -> Result<Encrypted>
pub fn encrypt_with<P, R>( &self, key: &Key<P, R>, s2k: S2K, symm: SymmetricAlgorithm, aead: Option<AEADAlgorithm>, password: &Password, ) -> Result<Encrypted>
Encrypts the secret key material using password and the
given parameters.
Trait Implementations§
Source§impl Clone for Unencrypted
impl Clone for Unencrypted
Source§fn clone(&self) -> Unencrypted
fn clone(&self) -> Unencrypted
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more