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: FnOnce(&SecretKeyMaterial) -> T,
pub fn map<F, T>(&self, fun: F) -> Twhere
F: FnOnce(&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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Unencrypted
impl Debug for Unencrypted
Source§impl From<SecretKeyMaterial> for Unencrypted
impl From<SecretKeyMaterial> for Unencrypted
Source§fn from(mpis: SecretKeyMaterial) -> Self
fn from(mpis: SecretKeyMaterial) -> Self
Source§impl From<Unencrypted> for SecretKeyMaterial
impl From<Unencrypted> for SecretKeyMaterial
Source§fn from(key: Unencrypted) -> Self
fn from(key: Unencrypted) -> Self
Source§impl Hash for Unencrypted
impl Hash for Unencrypted
Source§impl PartialEq for Unencrypted
impl PartialEq for Unencrypted
Source§fn eq(&self, other: &Unencrypted) -> bool
fn eq(&self, other: &Unencrypted) -> bool
self and other values to be equal, and is used by ==.