pub enum Message {
    Literal(LiteralData),
    Compressed(CompressedData),
    Signed {
        message: Option<Box<Message>>,
        one_pass_signature: Option<OnePassSignature>,
        signature: Signature,
    },
    Encrypted {
        esk: Vec<Esk>,
        edata: Vec<Edata>,
    },
}
Expand description

Variants

Literal(LiteralData)

Compressed(CompressedData)

Signed

Fields

message: Option<Box<Message>>

nested message

one_pass_signature: Option<OnePassSignature>

for signature packets that contain a one pass message

signature: Signature

Encrypted

Fields

esk: Vec<Esk>
edata: Vec<Edata>

Implementations

Compresses the message.

Decompresses the data if compressed.

Encrypt the message to the list of passed in public keys.

Encrytp the message using the given password.

Sign this message using the provided key.

Convert the message to a standalone signature according to the cleartext framework.

Verify this message. For signed messages this verifies the signature and for compressed messages they are decompressed and checked for signatures to verify.

Returns a list of KeyIds that the message is encrypted to. For non encrypted messages this list is empty.

Decrypt the message using the given key. Returns a message decrypter, and a list of KeyIds that are valid recipients of this message.

Decrypt the message using the given key. Returns a message decrypter, and a list of KeyIds that are valid recipients of this message.

Check if this message is a signature, that was signed with a one pass signature.

Returns the underlying content and None if the message is encrypted.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Parse a composed message. Ref: https://tools.ietf.org/html/rfc4880#section-11.3

Parse a single byte encoded composition.

Parse a single armor encoded composition.

Parse an armor encoded list of compositions.

Armored ascii data.

Armored ascii data.

Parse a list of compositions in raw byte format.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.