mailman_pgp.utils package¶
Subpackages¶
Submodules¶
mailman_pgp.utils.config module¶
mailman_pgp.utils.email module¶
-
mailman_pgp.utils.email.
copy_headers
(from_msg, to_msg, overwrite=False)[source]¶ Copy the headers and unixfrom from a message to another one.
Parameters: - from_msg (email.message.Message) – The source Message.
- to_msg (email.message.Message) – The destination Message.
-
mailman_pgp.utils.email.
overwrite_message
(from_msg, to_msg)[source]¶ Overwrite message data of to_msg with that of from_msg.
Parameters: - from_msg (email.message.Message) – The source Message.
- to_msg (email.message.Message) – The destination Message.
mailman_pgp.utils.file module¶
mailman_pgp.utils.moderation module¶
mailman_pgp.utils.pgp module¶
Miscellaneous PGP utilities.
-
mailman_pgp.utils.pgp.
verifies
(verifications)[source]¶ Parameters: verifications (typing.Sequence[pgpy.types.SignatureVerification]) – Returns: bool
-
mailman_pgp.utils.pgp.
hashes
(verifications)[source]¶ Parameters: verifications – Returns: Return type: typing.Generator[bytes]
-
mailman_pgp.utils.pgp.
key_from_blob
(blob)[source]¶ Parameters: blob – Returns: Return type: pgpy.PGPKey
-
mailman_pgp.utils.pgp.
key_from_file
(file)[source]¶ Parameters: file – Returns: Return type: pgpy.PGPKey
-
mailman_pgp.utils.pgp.
revoc_from_blob
(blob)[source]¶ Load a key revocation signature from an ASCII-Armored blob.
Parameters: blob – Returns: Return type: pgpy.PGPSignature
-
mailman_pgp.utils.pgp.
key_revoked
(key)[source]¶ Parameters: key (pgpy.PGPKey) – Returns: Return type: bool
-
mailman_pgp.utils.pgp.
key_flags
(key)[source]¶ Parameters: key (pgpy.PGPKey) – Returns: Return type: Set[pgpy.constants.KeyFlags]
-
mailman_pgp.utils.pgp.
key_usable
(key, flags_required)[source]¶ Check that the key has the flags_required set of KeyFlags.
Checks only non-expired, non-revoked key/subkeys. Validates revocations it can, so not those made with some other designated revocation key.
Parameters: - key (pgpy.PGPKey) – The key to check.
- flags_required (set) – The set of flags required.
Returns: Whether the key has the flags_required.
Return type: bool