3 # Copyright (C) 2016 g10 Code GmbH
4 # Copyright (C) 2002 John Goerzen <jgoerzen@complete.org>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
19 from __future__ import absolute_import, print_function, unicode_literals
20 del absolute_import, print_function, unicode_literals
24 from gpg.constants.sig import mode
26 with gpg.Context() as c:
27 signed, _ = c.sign(b"Test message", mode=mode.CLEAR)
28 sys.stdout.buffer.write(signed)