python: Support manipulating the TOFU policy.
[gpgme.git] / lang / python / gpg / constants / __init__.py
1 # Constants.
2 #
3 # Copyright (C) 2016 g10 Code GmbH
4 #
5 # This file is part of GPGME.
6 #
7 # GPGME is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2.1 of the
10 # License, or (at your option) any later version.
11 #
12 # GPGME is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15 # Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
19
20 from __future__ import absolute_import, print_function, unicode_literals
21 del absolute_import, print_function, unicode_literals
22
23 from gpg import util
24 util.process_constants('GPGME_', globals())
25 del util
26
27 # For convenience, we import the modules here.
28 from . import data, keylist, sig, tofu # The subdirs.
29 from . import create, event, keysign, md, pk, protocol, sigsum, status, validity
30
31 # A complication arises because 'import' is a reserved keyword.
32 # Import it as 'Import' instead.
33 globals()['Import'] = getattr(__import__('', globals(), locals(),
34                                          [str('import')], 1), "import")
35
36 __all__ = ['data', 'event', 'import', 'keysign', 'keylist', 'md', 'pk',
37            'protocol', 'sig', 'sigsum', 'status', 'tofu', 'validity', 'create']
38
39 # GPGME 1.7 replaced gpgme_op_edit with gpgme_op_interact.  We
40 # implement gpg.Context.op_edit using gpgme_op_interact, so the
41 # callbacks will be called with string keywords instead of numeric
42 # status messages.  Code that is using these constants will continue
43 # to work.
44
45 STATUS_ABORT = "ABORT"
46 STATUS_ALREADY_SIGNED = "ALREADY_SIGNED"
47 STATUS_ATTRIBUTE = "ATTRIBUTE"
48 STATUS_BACKUP_KEY_CREATED = "BACKUP_KEY_CREATED"
49 STATUS_BAD_PASSPHRASE = "BAD_PASSPHRASE"
50 STATUS_BADARMOR = "BADARMOR"
51 STATUS_BADMDC = "BADMDC"
52 STATUS_BADSIG = "BADSIG"
53 STATUS_BEGIN_DECRYPTION = "BEGIN_DECRYPTION"
54 STATUS_BEGIN_ENCRYPTION = "BEGIN_ENCRYPTION"
55 STATUS_BEGIN_SIGNING = "BEGIN_SIGNING"
56 STATUS_BEGIN_STREAM = "BEGIN_STREAM"
57 STATUS_CARDCTRL = "CARDCTRL"
58 STATUS_DECRYPTION_FAILED = "DECRYPTION_FAILED"
59 STATUS_DECRYPTION_INFO = "DECRYPTION_INFO"
60 STATUS_DECRYPTION_OKAY = "DECRYPTION_OKAY"
61 STATUS_DELETE_PROBLEM = "DELETE_PROBLEM"
62 STATUS_ENC_TO = "ENC_TO"
63 STATUS_END_DECRYPTION = "END_DECRYPTION"
64 STATUS_END_ENCRYPTION = "END_ENCRYPTION"
65 STATUS_END_STREAM = "END_STREAM"
66 STATUS_ENTER = "ENTER"
67 STATUS_ERRMDC = "ERRMDC"
68 STATUS_ERROR = "ERROR"
69 STATUS_ERRSIG = "ERRSIG"
70 STATUS_EXPKEYSIG = "EXPKEYSIG"
71 STATUS_EXPSIG = "EXPSIG"
72 STATUS_FAILURE = "FAILURE"
73 STATUS_FILE_DONE = "FILE_DONE"
74 STATUS_FILE_ERROR = "FILE_ERROR"
75 STATUS_FILE_START = "FILE_START"
76 STATUS_GET_BOOL = "GET_BOOL"
77 STATUS_GET_HIDDEN = "GET_HIDDEN"
78 STATUS_GET_LINE = "GET_LINE"
79 STATUS_GOOD_PASSPHRASE = "GOOD_PASSPHRASE"
80 STATUS_GOODMDC = "GOODMDC"
81 STATUS_GOODSIG = "GOODSIG"
82 STATUS_GOT_IT = "GOT_IT"
83 STATUS_IMPORT_OK = "IMPORT_OK"
84 STATUS_IMPORT_PROBLEM = "IMPORT_PROBLEM"
85 STATUS_IMPORT_RES = "IMPORT_RES"
86 STATUS_IMPORTED = "IMPORTED"
87 STATUS_INQUIRE_MAXLEN = "INQUIRE_MAXLEN"
88 STATUS_INV_RECP = "INV_RECP"
89 STATUS_INV_SGNR = "INV_SGNR"
90 STATUS_KEY_CONSIDERED = "KEY_CONSIDERED"
91 STATUS_KEY_CREATED = "KEY_CREATED"
92 STATUS_KEY_NOT_CREATED = "KEY_NOT_CREATED"
93 STATUS_KEYEXPIRED = "KEYEXPIRED"
94 STATUS_KEYREVOKED = "KEYREVOKED"
95 STATUS_LEAVE = "LEAVE"
96 STATUS_MISSING_PASSPHRASE = "MISSING_PASSPHRASE"
97 STATUS_MOUNTPOINT = "MOUNTPOINT"
98 STATUS_NEED_PASSPHRASE = "NEED_PASSPHRASE"
99 STATUS_NEED_PASSPHRASE_PIN = "NEED_PASSPHRASE_PIN"
100 STATUS_NEED_PASSPHRASE_SYM = "NEED_PASSPHRASE_SYM"
101 STATUS_NEWSIG = "NEWSIG"
102 STATUS_NO_PUBKEY = "NO_PUBKEY"
103 STATUS_NO_RECP = "NO_RECP"
104 STATUS_NO_SECKEY = "NO_SECKEY"
105 STATUS_NO_SGNR = "NO_SGNR"
106 STATUS_NODATA = "NODATA"
107 STATUS_NOTATION_DATA = "NOTATION_DATA"
108 STATUS_NOTATION_FLAGS = "NOTATION_FLAGS"
109 STATUS_NOTATION_NAME = "NOTATION_NAME"
110 STATUS_PINENTRY_LAUNCHED = "PINENTRY_LAUNCHED"
111 STATUS_PKA_TRUST_BAD = "PKA_TRUST_BAD"
112 STATUS_PKA_TRUST_GOOD = "PKA_TRUST_GOOD"
113 STATUS_PLAINTEXT = "PLAINTEXT"
114 STATUS_PLAINTEXT_LENGTH = "PLAINTEXT_LENGTH"
115 STATUS_POLICY_URL = "POLICY_URL"
116 STATUS_PROGRESS = "PROGRESS"
117 STATUS_REVKEYSIG = "REVKEYSIG"
118 STATUS_RSA_OR_IDEA = "RSA_OR_IDEA"
119 STATUS_SC_OP_FAILURE = "SC_OP_FAILURE"
120 STATUS_SC_OP_SUCCESS = "SC_OP_SUCCESS"
121 STATUS_SESSION_KEY = "SESSION_KEY"
122 STATUS_SHM_GET = "SHM_GET"
123 STATUS_SHM_GET_BOOL = "SHM_GET_BOOL"
124 STATUS_SHM_GET_HIDDEN = "SHM_GET_HIDDEN"
125 STATUS_SHM_INFO = "SHM_INFO"
126 STATUS_SIG_CREATED = "SIG_CREATED"
127 STATUS_SIG_ID = "SIG_ID"
128 STATUS_SIG_SUBPACKET = "SIG_SUBPACKET"
129 STATUS_SIGEXPIRED = "SIGEXPIRED"
130 STATUS_SUCCESS = "SUCCESS"
131 STATUS_TOFU_STATS = "TOFU_STATS"
132 STATUS_TOFU_STATS_LONG = "TOFU_STATS_LONG"
133 STATUS_TOFU_USER = "TOFU_USER"
134 STATUS_TRUNCATED = "TRUNCATED"
135 STATUS_TRUST_FULLY = "TRUST_FULLY"
136 STATUS_TRUST_MARGINAL = "TRUST_MARGINAL"
137 STATUS_TRUST_NEVER = "TRUST_NEVER"
138 STATUS_TRUST_ULTIMATE = "TRUST_ULTIMATE"
139 STATUS_TRUST_UNDEFINED = "TRUST_UNDEFINED"
140 STATUS_UNEXPECTED = "UNEXPECTED"
141 STATUS_USERID_HINT = "USERID_HINT"
142 STATUS_VALIDSIG = "VALIDSIG"