~ubuntu-branches/ubuntu/trusty/pygpgme/trusty-proposed

« back to all changes in this revision

Viewing changes to examples/encrypt.py

  • Committer: Package Import Robot
  • Author(s): Jonathan Wiltshire
  • Date: 2011-10-17 00:47:49 UTC
  • mfrom: (3.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20111017004749-1i8o6o1sxmeuf9b6
Tags: 0.2-1
* New upstream release (Closes: #638795)
* Convert to dh_python2
* Refresh patches for new upstream
* debian/python-gpgme.examples: Upstream no longer ships example file
* Remove quilt logic, not necessary with format 3.0 (quilt)
* Convert to debhelper 8 and dh auto-sequencer

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import gpgme
2
 
from StringIO import StringIO
3
 
 
4
 
ctx = gpgme.Context()
5
 
ctx.armor = True
6
 
 
7
 
key = ctx.get_key('B10A449E4CFB9A60A2DB996701AF93D991CFA34D')
8
 
 
9
 
plain = StringIO('Hello World\n')
10
 
cipher = StringIO()
11
 
 
12
 
ctx.encrypt([key], 0, plain, cipher)
13
 
 
14
 
print cipher.getvalue()