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