Enum sequoia_openpgp::packet::SKESK
source · #[non_exhaustive]pub enum SKESK {
V4(SKESK4),
V5(SKESK5),
}
Expand description
Holds a symmetrically encrypted session key.
The session key is used to decrypt the actual ciphertext, which is typically stored in a SEIP or AED packet. See Section 5.3 of RFC 4880 for details.
An SKESK packet is not normally instantiated directly. In most
cases, you’ll create one as a side-effect of encrypting a message
using the streaming serializer, or parsing an encrypted message
using the PacketParser
.
Note: This enum cannot be exhaustively matched to allow future extensions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
source§impl SKESK
impl SKESK
sourcepub fn decrypt(
&self,
password: &Password,
) -> Result<(SymmetricAlgorithm, SessionKey)>
pub fn decrypt( &self, password: &Password, ) -> Result<(SymmetricAlgorithm, SessionKey)>
Derives the key inside this SKESK from password
. Returns a
tuple of the symmetric cipher to use with the key and the key
itself.
Trait Implementations§
source§impl Any<SKESK> for Packet
impl Any<SKESK> for Packet
source§impl IntoIterator for SKESK
impl IntoIterator for SKESK
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
source§impl MarshalInto for SKESK
impl MarshalInto for SKESK
source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
source§impl<'a> Parse<'a, SKESK> for SKESK
impl<'a> Parse<'a, SKESK> for SKESK
source§fn from_buffered_reader<R>(reader: R) -> Result<Self>where
R: BufferedReader<Cookie> + 'a,
fn from_buffered_reader<R>(reader: R) -> Result<Self>where
R: BufferedReader<Cookie> + 'a,
Reads from the given buffered reader.
source§fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
Reads from the given reader.
source§impl PartialEq for SKESK
impl PartialEq for SKESK
impl Eq for SKESK
impl StructuralPartialEq for SKESK
Auto Trait Implementations§
impl Freeze for SKESK
impl RefUnwindSafe for SKESK
impl Send for SKESK
impl Sync for SKESK
impl Unpin for SKESK
impl UnwindSafe for SKESK
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)