Enum pgp::composed::message::Message [−][src]
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
Tuple Fields of Literal
0: LiteralData
Tuple Fields of Compressed
Fields of Signed
Implementations
Compresses the message.
Decompresses the data if compressed.
pub fn encrypt_to_keys<R: CryptoRng + Rng>(
&self,
rng: &mut R,
alg: SymmetricKeyAlgorithm,
pkeys: &[&impl PublicKeyTrait]
) -> Result<Self>
pub fn encrypt_to_keys<R: CryptoRng + Rng>(
&self,
rng: &mut R,
alg: SymmetricKeyAlgorithm,
pkeys: &[&impl PublicKeyTrait]
) -> Result<Self>
Encrypt the message to the list of passed in public keys.
pub fn encrypt_with_password<R, F>(
&self,
rng: &mut R,
s2k: StringToKey,
alg: SymmetricKeyAlgorithm,
msg_pw: F
) -> Result<Self> where
R: Rng + CryptoRng,
F: FnOnce() -> String + Clone,
pub fn encrypt_with_password<R, F>(
&self,
rng: &mut R,
s2k: StringToKey,
alg: SymmetricKeyAlgorithm,
msg_pw: F
) -> Result<Self> where
R: Rng + CryptoRng,
F: FnOnce() -> String + Clone,
Encrytp the message using the given password.
pub fn sign<F>(
self,
key: &impl SecretKeyTrait,
key_pw: F,
hash_algorithm: HashAlgorithm
) -> Result<Self> where
F: FnOnce() -> String,
pub fn sign<F>(
self,
key: &impl SecretKeyTrait,
key_pw: F,
hash_algorithm: HashAlgorithm
) -> Result<Self> where
F: FnOnce() -> String,
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
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.
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self