[][src]Enum sequoia_openpgp::crypto::mpis::Ciphertext

pub enum Ciphertext {
    RSA {
        c: MPI,
    },
    Elgamal {
        e: MPI,
        c: MPI,
    },
    ECDH {
        e: MPI,
        key: Box<[u8]>,
    },
    Unknown {
        mpis: Box<[MPI]>,
        rest: Box<[u8]>,
    },
}

Holds a ciphertext.

Provides a typed and structured way of storing multiple MPIs in packets.

Variants

RSA

RSA ciphertext.

Fields of RSA

c: MPI

m^e mod N.

Elgamal

Elgamal ciphertext

Fields of Elgamal

e: MPI

Ephemeral key.

c: MPI

.

ECDH

Elliptic curve Elgamal public key.

Fields of ECDH

e: MPI

Ephemeral key.

key: Box<[u8]>

Symmetrically encrypted session key.

Unknown

Unknown number of MPIs for an unknown algorithm.

Fields of Unknown

mpis: Box<[MPI]>

The successfully parsed MPIs.

rest: Box<[u8]>

Any data that failed to parse.

Methods

impl Ciphertext[src]

pub fn serialized_len(&self) -> usize[src]

Number of octets all MPIs of this instance occupy when serialized.

pub fn pk_algo(&self) -> Option<PublicKeyAlgorithm>[src]

Returns, if known, the public-key algorithm for this ciphertext.

impl Ciphertext[src]

pub fn parse<T: AsRef<[u8]>>(algo: PublicKeyAlgorithm, buf: T) -> Result<Self>[src]

Parses a set of OpenPGP MPIs representing a ciphertext.

Expects MPIs for a public key algorithm algos ciphertext. See Section 3.2 of RFC 4880 for details.

Trait Implementations

impl Arbitrary for Ciphertext[src]

impl Clone for Ciphertext[src]

impl Debug for Ciphertext[src]

impl Eq for Ciphertext[src]

impl Hash for Ciphertext[src]

fn hash(&self, hash: &mut Context)[src]

Update the Hash with a hash of the MPIs.

impl Hash for Ciphertext[src]

impl Ord for Ciphertext[src]

impl PartialEq<Ciphertext> for Ciphertext[src]

impl PartialOrd<Ciphertext> for Ciphertext[src]

impl Serialize for Ciphertext[src]

impl SerializeInto for Ciphertext[src]

impl StructuralEq for Ciphertext[src]

impl StructuralPartialEq for Ciphertext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,