Enum sequoia_openpgp::crypto::mpi::Ciphertext
source · [−]#[non_exhaustive]
pub enum Ciphertext {
RSA {
c: MPI,
},
ElGamal {
e: MPI,
c: MPI,
},
ECDH {
e: MPI,
key: Box<[u8]>,
},
Unknown {
mpis: Box<[MPI]>,
rest: Box<[u8]>,
},
}
Expand description
An encrypted session key.
Provides a typed and structured way of storing multiple MPIs in
PKESK
packets.
Note: This enum cannot be exhaustively matched to allow future extensions.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
RSA
Fields
c: MPI
m^e mod N.
RSA ciphertext.
ElGamal
ElGamal ciphertext.
ECDH
Elliptic curve ElGamal public key.
Unknown
Unknown number of MPIs for an unknown algorithm.
Implementations
sourceimpl Ciphertext
impl Ciphertext
sourcepub fn pk_algo(&self) -> Option<PublicKeyAlgorithm>
pub fn pk_algo(&self) -> Option<PublicKeyAlgorithm>
Returns, if known, the public-key algorithm for this ciphertext.
sourceimpl Ciphertext
impl Ciphertext
sourcepub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
pub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
Parses a set of OpenPGP MPIs representing a ciphertext.
Expects MPIs for a public key algorithm algo
s ciphertext.
See Section 3.2 of RFC 4880 for details.
Trait Implementations
sourceimpl Clone for Ciphertext
impl Clone for Ciphertext
sourcefn clone(&self) -> Ciphertext
fn clone(&self) -> Ciphertext
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Ciphertext
impl Debug for Ciphertext
sourceimpl Hash for Ciphertext
impl Hash for Ciphertext
sourceimpl Hash for Ciphertext
impl Hash for Ciphertext
sourceimpl Marshal for Ciphertext
impl Marshal for Ciphertext
sourceimpl MarshalInto for Ciphertext
impl MarshalInto for Ciphertext
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 Ord for Ciphertext
impl Ord for Ciphertext
sourceimpl PartialEq<Ciphertext> for Ciphertext
impl PartialEq<Ciphertext> for Ciphertext
sourcefn eq(&self, other: &Ciphertext) -> bool
fn eq(&self, other: &Ciphertext) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Ciphertext) -> bool
fn ne(&self, other: &Ciphertext) -> bool
This method tests for !=
.
sourceimpl PartialOrd<Ciphertext> for Ciphertext
impl PartialOrd<Ciphertext> for Ciphertext
sourcefn partial_cmp(&self, other: &Ciphertext) -> Option<Ordering>
fn partial_cmp(&self, other: &Ciphertext) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Ciphertext
impl StructuralEq for Ciphertext
impl StructuralPartialEq for Ciphertext
Auto Trait Implementations
impl RefUnwindSafe for Ciphertext
impl Send for Ciphertext
impl Sync for Ciphertext
impl Unpin for Ciphertext
impl UnwindSafe for Ciphertext
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