Enum sequoia_openpgp::packet::SKESK
source · [−]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
V4(SKESK4)
SKESK packet version 4.
V5(SKESK5)
SKESK packet version 5.
This feature is experimental.
Implementations
sourceimpl 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
sourceimpl Any<SKESK> for Packet
impl Any<SKESK> for Packet
sourcefn downcast(self) -> Result<SKESK, Packet>
fn downcast(self) -> Result<SKESK, Packet>
Attempts to downcast to T
, returning the packet if it fails. Read more
sourcefn downcast_ref(&self) -> Option<&SKESK>
fn downcast_ref(&self) -> Option<&SKESK>
Attempts to downcast to &T
, returning None
if it fails. Read more
sourcefn downcast_mut(&mut self) -> Option<&mut SKESK>
fn downcast_mut(&mut self) -> Option<&mut SKESK>
Attempts to downcast to &mut T
, returning None
if it fails. Read more
sourceimpl IntoIterator for SKESK
impl IntoIterator for SKESK
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
sourceimpl MarshalInto for SKESK
impl MarshalInto for SKESK
sourcefn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
sourcefn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
sourceimpl<'a> Parse<'a, SKESK> for SKESK
impl<'a> Parse<'a, SKESK> for SKESK
impl Eq for SKESK
impl StructuralEq for SKESK
impl StructuralPartialEq for SKESK
Auto Trait Implementations
impl RefUnwindSafe for SKESK
impl Send for SKESK
impl Sync for SKESK
impl Unpin for SKESK
impl UnwindSafe for SKESK
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more