Module pgp

Module pgp 

Source
Expand description

OpenPGP helper module using rPGP facilities.

Structsยง

KeyPair
A PGP keypair.

Constantsยง

HASH_ALGORITHM ๐Ÿ”’
Preferred cryptographic hash.
HEADER_SETUPCODE ๐Ÿ”’
SYMMETRIC_KEY_ALGORITHM ๐Ÿ”’
Preferred symmetric encryption algorithm.

Functionsยง

check_symmetric_encryption ๐Ÿ”’
Returns Ok(()) if we want to try symmetrically decrypting the message, and Err with a reason if symmetric decryption should not be tried.
create_keypair ๐Ÿ”’
Create a new key pair.
decrypt
Decrypts the message:
pk_calc_signature
Produces a detached signature for plain text using private_key_for_signing.
pk_encrypt
Encrypts plain textย using public_keys_for_encryption and signs it using private_key_for_signing.
pk_validate
Validates detached signature.
select_pk_for_encryption ๐Ÿ”’
Selects a subkey of the public key to use for encryption.
split_armored_data
Split data from PGP Armored Data as defined in https://tools.ietf.org/html/rfc4880#section-6.2.
symm_decrypt
Symmetric decryption.
symm_encrypt_autocrypt_setup
Symmetric encryption for the autocrypt setup message (ASM).
symm_encrypt_message
Symmetrically encrypt the message. This is used for broadcast channels and for version 2 of the Securejoin protocol. shared secret is the secret that will be used for symmetric encryption.
valid_signature_fingerprints
Returns fingerprints of all keys from the public_keys_for_validation keyring that have valid signatures there.