Files
pcp/bindings/py/test.py

23 lines
469 B
Python
Raw Normal View History

2014-12-14 14:38:30 +01:00
#!/usr/local/bin/python
from pypcp import *
2014-12-14 18:06:45 +01:00
from pprint import pprint
2014-12-14 14:38:30 +01:00
zbobsec = open("../../tests/key-bobby-sec", "r").read()
2014-12-14 14:38:30 +01:00
bobsec = Key(encoded=zbobsec, passphrase="b")
#bobsec.dump()
2014-12-14 18:06:45 +01:00
zalipub = open("../../tests/key-alicia-pub", "r").read()
alipub = PublicKey(encoded=zalipub)
#alipub.dump()
2014-12-14 18:06:45 +01:00
ctx = Context()
encrypted = ctx.encrypt(string="hello world", passphrase="x")
ctx.addkey(bobsec)
ctx.recipients(alipub)
encrypted = ctx.encrypt(string="hello world")
2014-12-14 18:06:45 +01:00