pub struct Encrypted { /* private fields */ }Expand description
Secret key material encrypted with a password.
This data structure is used by the SecretKeyMaterial enum.
Implementations§
Source§impl Encrypted
impl Encrypted
Sourcepub fn new(
s2k: S2K,
algo: SymmetricAlgorithm,
checksum: Option<SecretKeyChecksum>,
ciphertext: Box<[u8]>,
) -> Self
pub fn new( s2k: S2K, algo: SymmetricAlgorithm, checksum: Option<SecretKeyChecksum>, ciphertext: Box<[u8]>, ) -> Self
Creates a new encrypted key object.
Sourcepub fn new_aead(
s2k: S2K,
sym_algo: SymmetricAlgorithm,
aead_algo: AEADAlgorithm,
aead_iv: Box<[u8]>,
ciphertext: Box<[u8]>,
) -> Self
pub fn new_aead( s2k: S2K, sym_algo: SymmetricAlgorithm, aead_algo: AEADAlgorithm, aead_iv: Box<[u8]>, ciphertext: Box<[u8]>, ) -> Self
Creates a new encrypted key object.
Sourcepub fn algo(&self) -> SymmetricAlgorithm
pub fn algo(&self) -> SymmetricAlgorithm
Returns the symmetric algorithm used to encrypt the secret key material.
Sourcepub fn aead_algo(&self) -> Option<AEADAlgorithm>
pub fn aead_algo(&self) -> Option<AEADAlgorithm>
Returns the AEAD algorithm used to encrypt the secret key material.
Sourcepub fn aead_iv(&self) -> Option<&[u8]>
pub fn aead_iv(&self) -> Option<&[u8]>
Returns the AEAD IV used to encrypt the secret key material.
Sourcepub fn checksum(&self) -> Option<SecretKeyChecksum>
pub fn checksum(&self) -> Option<SecretKeyChecksum>
Returns the checksum method used to protect the encrypted secret key material, if any.
Sourcepub fn ciphertext(&self) -> Result<&[u8]>
pub fn ciphertext(&self) -> Result<&[u8]>
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.
Trait Implementations§
Source§impl From<Encrypted> for SecretKeyMaterial
impl From<Encrypted> for SecretKeyMaterial
impl Eq for Encrypted
Auto Trait Implementations§
impl Freeze for Encrypted
impl RefUnwindSafe for Encrypted
impl Send for Encrypted
impl Sync for Encrypted
impl Unpin for Encrypted
impl UnwindSafe for Encrypted
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more