You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
931 B
33 lines
931 B
"""
|
|
>>> import pEp
|
|
>>> me = pEp.Identity("alice.smith@peptest.ch", "Alice Smith", "23")
|
|
>>> me.username
|
|
'Alice Smith'
|
|
>>> print(me)
|
|
Alice Smith <alice.smith@peptest.ch>
|
|
>>> you = pEp.Identity("bob.bourne@peptest.ch", "Bob Bourne", "42")
|
|
>>> print(you)
|
|
Bob Bourne <bob.bourne@peptest.ch>
|
|
>>> m = pEp.outgoing_message(me)
|
|
>>> m.to = [you]
|
|
>>> m.shortmsg = "let's meet next week"
|
|
>>> m.longmsg = "Please call me back"
|
|
>>> print(str(m).replace('\\r', ''))
|
|
From: Alice Smith <alice.smith@peptest.ch>
|
|
To: Bob Bourne <bob.bourne@peptest.ch>
|
|
Subject: let's meet next week
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset="utf-8"
|
|
Content-Transfer-Encoding: quoted-printable
|
|
Content-Disposition: inline; filename="msg.txt"
|
|
<BLANKLINE>
|
|
Please call me back
|
|
>>> m2 = m.encrypt()
|
|
>>> m3, keys, rating, flags = m2.decrypt()
|
|
>>> rating
|
|
pEp.PEP_rating.PEP_rating_reliable
|
|
"""
|
|
|
|
if __name__ == "__main__":
|
|
import doctest
|
|
doctest.testmod()
|
|
|