summaryrefslogtreecommitdiff
path: root/memoryhole/protection.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2016-07-06 15:35:24 +0200
committerRuben Pollan <meskio@sindominio.net>2016-07-06 15:35:24 +0200
commit2bf3ef57a1f2841116268010cd80984208725f45 (patch)
tree27384afc7f1094124169114f58c1960be396bdcd /memoryhole/protection.py
parent7396398e81fda41d4cb2ea7ffbdfa8f02746cad8 (diff)
[doc] document public methods
Diffstat (limited to 'memoryhole/protection.py')
-rw-r--r--memoryhole/protection.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/memoryhole/protection.py b/memoryhole/protection.py
index 900b29a..b179614 100644
--- a/memoryhole/protection.py
+++ b/memoryhole/protection.py
@@ -1,10 +1,28 @@
from email.mime.application import MIMEApplication
+from email.utils import getaddresses, parseaddr
from memoryhole.gpg import Gnupg
from memoryhole.rfc3156 import PGPEncrypted, MultipartEncrypted
def protect(msg, openpgp=Gnupg(), encrypt=True, obscure=True):
+ """
+ Protect an email with memory hole. It will protect the PROTECTED_HEADERS
+ and if obscure=True will obscure the OBSCURED_HEADERS
+
+ :param msg: the email to be protected
+ :type msg: Message
+ :param openpgp: the implementation of openpgp to use for encryption and/or
+ signature
+ :type openpgp: OpenPGP
+ :param encrypt: should the message be encrypted
+ :type encrypt: bool
+ :param obscure: should the headers be obscured
+ :type obsucre: bool
+
+ :return: an encrypted and/or signed email
+ :rtype: Message
+ """
if encrypt:
return _encrypt_mime(msg, openpgp)