1 /* gpgme.h - Public interface to GnuPG Made Easy. -*- c -*-
2 Copyright (C) 2000 Werner Koch (dd9jn)
3 Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009
6 This file is part of GPGME.
8 GPGME is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as
10 published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 GPGME is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this program; if not, see <http://www.gnu.org/licenses/>.
21 File: @configure_input@ */
27 #define _GPGME_INLINE __inline__
28 #elif __STDC_VERSION__ >= 199901L
29 #define _GPGME_INLINE inline
34 /* Include stdio.h for the FILE type definition. */
41 # include <sys/types.h>
46 #include <gpg-error.h>
50 #if 0 /* just to make Emacs auto-indent happy */
53 #endif /* __cplusplus */
57 /* Check for compiler features. */
59 #define _GPGME_GCC_VERSION (__GNUC__ * 10000 \
60 + __GNUC_MINOR__ * 100 \
61 + __GNUC_PATCHLEVEL__)
63 #if _GPGME_GCC_VERSION > 30100
64 #define _GPGME_DEPRECATED __attribute__ ((__deprecated__))
68 #ifndef _GPGME_DEPRECATED
69 #define _GPGME_DEPRECATED
72 /* The macro _GPGME_DEPRECATED_OUTSIDE_GPGME suppresses warnings for
73 fields we must access in GPGME for ABI compatibility. */
74 #ifdef _GPGME_IN_GPGME
75 #define _GPGME_DEPRECATED_OUTSIDE_GPGME
77 #define _GPGME_DEPRECATED_OUTSIDE_GPGME _GPGME_DEPRECATED
81 /* The version of this header should match the one of the library. Do
82 not use this symbol in your application, use gpgme_check_version
83 instead. The purpose of this macro is to let autoconf (using the
84 AM_PATH_GPGME macro) check that this header matches the installed
86 #define GPGME_VERSION "@PACKAGE_VERSION@"
88 /* Check for a matching _FILE_OFFSET_BITS definition. */
89 #if @NEED__FILE_OFFSET_BITS@
90 #ifndef _FILE_OFFSET_BITS
91 #error GPGME was compiled with _FILE_OFFSET_BITS = @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual.
93 #if (_FILE_OFFSET_BITS) != (@NEED__FILE_OFFSET_BITS@)
94 #error GPGME was compiled with a different value for _FILE_OFFSET_BITS, namely @NEED__FILE_OFFSET_BITS@, please see the section "Largefile support (LFS)" in the GPGME manual.
101 /* Some opaque data types used by GPGME. */
103 /* The context holds some global state and configration options, as
104 well as the results of a crypto operation. */
105 struct gpgme_context;
106 typedef struct gpgme_context *gpgme_ctx_t;
108 /* The data object is used by GPGME to exchange arbitrary data. */
110 typedef struct gpgme_data *gpgme_data_t;
113 /* Wrappers for the libgpg-error library. */
115 typedef gpg_error_t gpgme_error_t;
116 typedef gpg_err_code_t gpgme_err_code_t;
117 typedef gpg_err_source_t gpgme_err_source_t;
120 static _GPGME_INLINE gpgme_error_t
121 gpgme_err_make (gpgme_err_source_t source, gpgme_err_code_t code)
123 return gpg_err_make (source, code);
127 /* The user can define GPGME_ERR_SOURCE_DEFAULT before including this
128 file to specify a default source for gpgme_error. */
129 #ifndef GPGME_ERR_SOURCE_DEFAULT
130 #define GPGME_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1
133 static _GPGME_INLINE gpgme_error_t
134 gpgme_error (gpgme_err_code_t code)
136 return gpgme_err_make (GPGME_ERR_SOURCE_DEFAULT, code);
140 static _GPGME_INLINE gpgme_err_code_t
141 gpgme_err_code (gpgme_error_t err)
143 return gpg_err_code (err);
147 static _GPGME_INLINE gpgme_err_source_t
148 gpgme_err_source (gpgme_error_t err)
150 return gpg_err_source (err);
154 /* Return a pointer to a string containing a description of the error
155 code in the error value ERR. This function is not thread safe. */
156 const char *gpgme_strerror (gpgme_error_t err);
158 /* Return the error string for ERR in the user-supplied buffer BUF of
159 size BUFLEN. This function is, in contrast to gpg_strerror,
160 thread-safe if a thread-safe strerror_r() function is provided by
161 the system. If the function succeeds, 0 is returned and BUF
162 contains the string describing the error. If the buffer was not
163 large enough, ERANGE is returned and BUF contains as much of the
164 beginning of the error string as fits into the buffer. */
165 int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen);
167 /* Return a pointer to a string containing a description of the error
168 source in the error value ERR. */
169 const char *gpgme_strsource (gpgme_error_t err);
171 /* Retrieve the error code for the system error ERR. This returns
172 GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
174 gpgme_err_code_t gpgme_err_code_from_errno (int err);
176 /* Retrieve the system error for the error code CODE. This returns 0
177 if CODE is not a system error code. */
178 int gpgme_err_code_to_errno (gpgme_err_code_t code);
180 /* Retrieve the error code directly from the ERRNO variable. This
181 returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
182 (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
183 gpgme_err_code_t gpgme_err_code_from_syserror (void);
185 /* Set the ERRNO variable. This function is the preferred way to set
186 ERRNO due to peculiarities on WindowsCE. */
187 void gpgme_err_set_errno (int err);
189 /* Return an error value with the error source SOURCE and the system
190 error ERR. FIXME: Should be inline. */
191 gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err);
193 /* Return an error value with the system error ERR. FIXME: Should be inline. */
194 gpgme_error_t gpgme_error_from_errno (int err);
197 static _GPGME_INLINE gpgme_error_t
198 gpgme_error_from_syserror (void)
200 return gpgme_error (gpgme_err_code_from_syserror ());
204 /* The possible encoding mode of gpgme_data_t objects. */
207 GPGME_DATA_ENCODING_NONE = 0, /* Not specified. */
208 GPGME_DATA_ENCODING_BINARY = 1,
209 GPGME_DATA_ENCODING_BASE64 = 2,
210 GPGME_DATA_ENCODING_ARMOR = 3, /* Either PEM or OpenPGP Armor. */
211 GPGME_DATA_ENCODING_URL = 4, /* LF delimited URL list. */
212 GPGME_DATA_ENCODING_URLESC = 5, /* Ditto, but percent escaped. */
213 GPGME_DATA_ENCODING_URL0 = 6 /* Nul delimited URL list. */
215 gpgme_data_encoding_t;
218 /* Public key algorithms from libgcrypt. */
227 GPGME_PK_ECDSA = 301,
233 /* Hash algorithms from libgcrypt. */
241 GPGME_MD_TIGER = 6, /* TIGER/192. */
242 GPGME_MD_HAVAL = 7, /* HAVAL, 5 pass, 160 bit. */
245 GPGME_MD_SHA512 = 10,
247 GPGME_MD_CRC32 = 302,
248 GPGME_MD_CRC32_RFC1510 = 303,
249 GPGME_MD_CRC24_RFC2440 = 304
254 /* The possible signature stati. Deprecated, use error value in sig
258 GPGME_SIG_STAT_NONE = 0,
259 GPGME_SIG_STAT_GOOD = 1,
260 GPGME_SIG_STAT_BAD = 2,
261 GPGME_SIG_STAT_NOKEY = 3,
262 GPGME_SIG_STAT_NOSIG = 4,
263 GPGME_SIG_STAT_ERROR = 5,
264 GPGME_SIG_STAT_DIFF = 6,
265 GPGME_SIG_STAT_GOOD_EXP = 7,
266 GPGME_SIG_STAT_GOOD_EXPKEY = 8
269 typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED;
272 /* The available signature modes. */
275 GPGME_SIG_MODE_NORMAL = 0,
276 GPGME_SIG_MODE_DETACH = 1,
277 GPGME_SIG_MODE_CLEAR = 2
282 /* The available key and signature attributes. Deprecated, use the
283 individual result structures instead. */
286 GPGME_ATTR_KEYID = 1,
290 GPGME_ATTR_CREATED = 5,
291 GPGME_ATTR_EXPIRE = 6,
292 GPGME_ATTR_OTRUST = 7,
293 GPGME_ATTR_USERID = 8,
295 GPGME_ATTR_EMAIL = 10,
296 GPGME_ATTR_COMMENT = 11,
297 GPGME_ATTR_VALIDITY = 12,
298 GPGME_ATTR_LEVEL = 13,
299 GPGME_ATTR_TYPE = 14,
300 GPGME_ATTR_IS_SECRET = 15,
301 GPGME_ATTR_KEY_REVOKED = 16,
302 GPGME_ATTR_KEY_INVALID = 17,
303 GPGME_ATTR_UID_REVOKED = 18,
304 GPGME_ATTR_UID_INVALID = 19,
305 GPGME_ATTR_KEY_CAPS = 20,
306 GPGME_ATTR_CAN_ENCRYPT = 21,
307 GPGME_ATTR_CAN_SIGN = 22,
308 GPGME_ATTR_CAN_CERTIFY = 23,
309 GPGME_ATTR_KEY_EXPIRED = 24,
310 GPGME_ATTR_KEY_DISABLED = 25,
311 GPGME_ATTR_SERIAL = 26,
312 GPGME_ATTR_ISSUER = 27,
313 GPGME_ATTR_CHAINID = 28,
314 GPGME_ATTR_SIG_STATUS = 29,
315 GPGME_ATTR_ERRTOK = 30,
316 GPGME_ATTR_SIG_SUMMARY = 31,
317 GPGME_ATTR_SIG_CLASS = 32
320 typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED;
323 /* The available validities for a trust item or key. */
326 GPGME_VALIDITY_UNKNOWN = 0,
327 GPGME_VALIDITY_UNDEFINED = 1,
328 GPGME_VALIDITY_NEVER = 2,
329 GPGME_VALIDITY_MARGINAL = 3,
330 GPGME_VALIDITY_FULL = 4,
331 GPGME_VALIDITY_ULTIMATE = 5
336 /* The available protocols. */
339 GPGME_PROTOCOL_OpenPGP = 0, /* The default mode. */
340 GPGME_PROTOCOL_CMS = 1,
341 GPGME_PROTOCOL_GPGCONF = 2, /* Special code for gpgconf. */
342 GPGME_PROTOCOL_ASSUAN = 3, /* Low-level access to an Assuan server. */
343 GPGME_PROTOCOL_G13 = 4,
344 GPGME_PROTOCOL_UISERVER= 5,
345 GPGME_PROTOCOL_DEFAULT = 254,
346 GPGME_PROTOCOL_UNKNOWN = 255
351 /* The available keylist mode flags. */
352 #define GPGME_KEYLIST_MODE_LOCAL 1
353 #define GPGME_KEYLIST_MODE_EXTERN 2
354 #define GPGME_KEYLIST_MODE_SIGS 4
355 #define GPGME_KEYLIST_MODE_SIG_NOTATIONS 8
356 #define GPGME_KEYLIST_MODE_EPHEMERAL 128
357 #define GPGME_KEYLIST_MODE_VALIDATE 256
359 typedef unsigned int gpgme_keylist_mode_t;
362 /* The available export mode flags. */
363 #define GPGME_EXPORT_MODE_EXTERN 2
364 #define GPGME_EXPORT_MODE_MINIMAL 4
366 typedef unsigned int gpgme_export_mode_t;
369 /* Flags for the audit log functions. */
370 #define GPGME_AUDITLOG_HTML 1
371 #define GPGME_AUDITLOG_WITH_HELP 128
374 /* Signature notations. */
376 /* The available signature notation flags. */
377 #define GPGME_SIG_NOTATION_HUMAN_READABLE 1
378 #define GPGME_SIG_NOTATION_CRITICAL 2
380 typedef unsigned int gpgme_sig_notation_flags_t;
382 struct _gpgme_sig_notation
384 struct _gpgme_sig_notation *next;
386 /* If NAME is a null pointer, then VALUE contains a policy URL
387 rather than a notation. */
390 /* The value of the notation data. */
393 /* The length of the name of the notation data. */
396 /* The length of the value of the notation data. */
399 /* The accumulated flags. */
400 gpgme_sig_notation_flags_t flags;
402 /* Notation data is human-readable. */
403 unsigned int human_readable : 1;
405 /* Notation data is critical. */
406 unsigned int critical : 1;
408 /* Internal to GPGME, do not use. */
411 typedef struct _gpgme_sig_notation *gpgme_sig_notation_t;
414 /* The possible stati for the edit operation. */
417 GPGME_STATUS_EOF = 0,
418 /* mkstatus processing starts here */
419 GPGME_STATUS_ENTER = 1,
420 GPGME_STATUS_LEAVE = 2,
421 GPGME_STATUS_ABORT = 3,
423 GPGME_STATUS_GOODSIG = 4,
424 GPGME_STATUS_BADSIG = 5,
425 GPGME_STATUS_ERRSIG = 6,
427 GPGME_STATUS_BADARMOR = 7,
429 GPGME_STATUS_RSA_OR_IDEA = 8,
430 GPGME_STATUS_KEYEXPIRED = 9,
431 GPGME_STATUS_KEYREVOKED = 10,
433 GPGME_STATUS_TRUST_UNDEFINED = 11,
434 GPGME_STATUS_TRUST_NEVER = 12,
435 GPGME_STATUS_TRUST_MARGINAL = 13,
436 GPGME_STATUS_TRUST_FULLY = 14,
437 GPGME_STATUS_TRUST_ULTIMATE = 15,
439 GPGME_STATUS_SHM_INFO = 16,
440 GPGME_STATUS_SHM_GET = 17,
441 GPGME_STATUS_SHM_GET_BOOL = 18,
442 GPGME_STATUS_SHM_GET_HIDDEN = 19,
444 GPGME_STATUS_NEED_PASSPHRASE = 20,
445 GPGME_STATUS_VALIDSIG = 21,
446 GPGME_STATUS_SIG_ID = 22,
447 GPGME_STATUS_ENC_TO = 23,
448 GPGME_STATUS_NODATA = 24,
449 GPGME_STATUS_BAD_PASSPHRASE = 25,
450 GPGME_STATUS_NO_PUBKEY = 26,
451 GPGME_STATUS_NO_SECKEY = 27,
452 GPGME_STATUS_NEED_PASSPHRASE_SYM = 28,
453 GPGME_STATUS_DECRYPTION_FAILED = 29,
454 GPGME_STATUS_DECRYPTION_OKAY = 30,
455 GPGME_STATUS_MISSING_PASSPHRASE = 31,
456 GPGME_STATUS_GOOD_PASSPHRASE = 32,
457 GPGME_STATUS_GOODMDC = 33,
458 GPGME_STATUS_BADMDC = 34,
459 GPGME_STATUS_ERRMDC = 35,
460 GPGME_STATUS_IMPORTED = 36,
461 GPGME_STATUS_IMPORT_OK = 37,
462 GPGME_STATUS_IMPORT_PROBLEM = 38,
463 GPGME_STATUS_IMPORT_RES = 39,
464 GPGME_STATUS_FILE_START = 40,
465 GPGME_STATUS_FILE_DONE = 41,
466 GPGME_STATUS_FILE_ERROR = 42,
468 GPGME_STATUS_BEGIN_DECRYPTION = 43,
469 GPGME_STATUS_END_DECRYPTION = 44,
470 GPGME_STATUS_BEGIN_ENCRYPTION = 45,
471 GPGME_STATUS_END_ENCRYPTION = 46,
473 GPGME_STATUS_DELETE_PROBLEM = 47,
474 GPGME_STATUS_GET_BOOL = 48,
475 GPGME_STATUS_GET_LINE = 49,
476 GPGME_STATUS_GET_HIDDEN = 50,
477 GPGME_STATUS_GOT_IT = 51,
478 GPGME_STATUS_PROGRESS = 52,
479 GPGME_STATUS_SIG_CREATED = 53,
480 GPGME_STATUS_SESSION_KEY = 54,
481 GPGME_STATUS_NOTATION_NAME = 55,
482 GPGME_STATUS_NOTATION_DATA = 56,
483 GPGME_STATUS_POLICY_URL = 57,
484 GPGME_STATUS_BEGIN_STREAM = 58,
485 GPGME_STATUS_END_STREAM = 59,
486 GPGME_STATUS_KEY_CREATED = 60,
487 GPGME_STATUS_USERID_HINT = 61,
488 GPGME_STATUS_UNEXPECTED = 62,
489 GPGME_STATUS_INV_RECP = 63,
490 GPGME_STATUS_NO_RECP = 64,
491 GPGME_STATUS_ALREADY_SIGNED = 65,
492 GPGME_STATUS_SIGEXPIRED = 66,
493 GPGME_STATUS_EXPSIG = 67,
494 GPGME_STATUS_EXPKEYSIG = 68,
495 GPGME_STATUS_TRUNCATED = 69,
496 GPGME_STATUS_ERROR = 70,
497 GPGME_STATUS_NEWSIG = 71,
498 GPGME_STATUS_REVKEYSIG = 72,
499 GPGME_STATUS_SIG_SUBPACKET = 73,
500 GPGME_STATUS_NEED_PASSPHRASE_PIN = 74,
501 GPGME_STATUS_SC_OP_FAILURE = 75,
502 GPGME_STATUS_SC_OP_SUCCESS = 76,
503 GPGME_STATUS_CARDCTRL = 77,
504 GPGME_STATUS_BACKUP_KEY_CREATED = 78,
505 GPGME_STATUS_PKA_TRUST_BAD = 79,
506 GPGME_STATUS_PKA_TRUST_GOOD = 80,
508 GPGME_STATUS_PLAINTEXT = 81,
509 GPGME_STATUS_INV_SGNR = 82,
510 GPGME_STATUS_NO_SGNR = 83,
511 GPGME_STATUS_SUCCESS = 84
516 /* The engine information structure. */
517 struct _gpgme_engine_info
519 struct _gpgme_engine_info *next;
521 /* The protocol ID. */
522 gpgme_protocol_t protocol;
524 /* The file name of the engine binary. */
527 /* The version string of the installed engine. */
530 /* The minimum version required for GPGME. */
531 const char *req_version;
533 /* The home directory used, or NULL if default. */
536 typedef struct _gpgme_engine_info *gpgme_engine_info_t;
539 /* A subkey from a key. */
542 struct _gpgme_subkey *next;
544 /* True if subkey is revoked. */
545 unsigned int revoked : 1;
547 /* True if subkey is expired. */
548 unsigned int expired : 1;
550 /* True if subkey is disabled. */
551 unsigned int disabled : 1;
553 /* True if subkey is invalid. */
554 unsigned int invalid : 1;
556 /* True if subkey can be used for encryption. */
557 unsigned int can_encrypt : 1;
559 /* True if subkey can be used for signing. */
560 unsigned int can_sign : 1;
562 /* True if subkey can be used for certification. */
563 unsigned int can_certify : 1;
565 /* True if subkey is secret. */
566 unsigned int secret : 1;
568 /* True if subkey can be used for authentication. */
569 unsigned int can_authenticate : 1;
571 /* True if subkey is qualified for signatures according to German law. */
572 unsigned int is_qualified : 1;
574 /* True if the secret key is stored on a smart card. */
575 unsigned int is_cardkey : 1;
577 /* Internal to GPGME, do not use. */
578 unsigned int _unused : 21;
580 /* Public key algorithm supported by this subkey. */
581 gpgme_pubkey_algo_t pubkey_algo;
583 /* Length of the subkey. */
586 /* The key ID of the subkey. */
589 /* Internal to GPGME, do not use. */
592 /* The fingerprint of the subkey in hex digit form. */
595 /* The creation timestamp, -1 if invalid, 0 if not available. */
598 /* The expiration timestamp, 0 if the subkey does not expire. */
601 /* The serial number of a smart card holding this key or NULL. */
604 typedef struct _gpgme_subkey *gpgme_subkey_t;
607 /* A signature on a user ID. */
608 struct _gpgme_key_sig
610 struct _gpgme_key_sig *next;
612 /* True if the signature is a revocation signature. */
613 unsigned int revoked : 1;
615 /* True if the signature is expired. */
616 unsigned int expired : 1;
618 /* True if the signature is invalid. */
619 unsigned int invalid : 1;
621 /* True if the signature should be exported. */
622 unsigned int exportable : 1;
624 /* Internal to GPGME, do not use. */
625 unsigned int _unused : 28;
627 /* The public key algorithm used to create the signature. */
628 gpgme_pubkey_algo_t pubkey_algo;
630 /* The key ID of key used to create the signature. */
633 /* Internal to GPGME, do not use. */
636 /* The creation timestamp, -1 if invalid, 0 if not available. */
639 /* The expiration timestamp, 0 if the subkey does not expire. */
642 /* Same as in gpgme_signature_t. */
643 gpgme_error_t status;
646 unsigned int _obsolete_class _GPGME_DEPRECATED;
648 /* Must be set to SIG_CLASS below. */
649 unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME;
652 /* The user ID string. */
655 /* The name part of the user ID. */
658 /* The email part of the user ID. */
661 /* The comment part of the user ID. */
664 /* Crypto backend specific signature class. */
665 unsigned int sig_class;
667 /* Notation data and policy URLs. */
668 gpgme_sig_notation_t notations;
670 /* Internal to GPGME, do not use. */
671 gpgme_sig_notation_t _last_notation;
673 typedef struct _gpgme_key_sig *gpgme_key_sig_t;
676 /* An user ID from a key. */
677 struct _gpgme_user_id
679 struct _gpgme_user_id *next;
681 /* True if the user ID is revoked. */
682 unsigned int revoked : 1;
684 /* True if the user ID is invalid. */
685 unsigned int invalid : 1;
687 /* Internal to GPGME, do not use. */
688 unsigned int _unused : 30;
690 /* The validity of the user ID. */
691 gpgme_validity_t validity;
693 /* The user ID string. */
696 /* The name part of the user ID. */
699 /* The email part of the user ID. */
702 /* The comment part of the user ID. */
705 /* The signatures of the user ID. */
706 gpgme_key_sig_t signatures;
708 /* Internal to GPGME, do not use. */
709 gpgme_key_sig_t _last_keysig;
711 typedef struct _gpgme_user_id *gpgme_user_id_t;
714 /* A key from the keyring. */
717 /* Internal to GPGME, do not use. */
720 /* True if key is revoked. */
721 unsigned int revoked : 1;
723 /* True if key is expired. */
724 unsigned int expired : 1;
726 /* True if key is disabled. */
727 unsigned int disabled : 1;
729 /* True if key is invalid. */
730 unsigned int invalid : 1;
732 /* True if key can be used for encryption. */
733 unsigned int can_encrypt : 1;
735 /* True if key can be used for signing. */
736 unsigned int can_sign : 1;
738 /* True if key can be used for certification. */
739 unsigned int can_certify : 1;
741 /* True if key is secret. */
742 unsigned int secret : 1;
744 /* True if key can be used for authentication. */
745 unsigned int can_authenticate : 1;
747 /* True if subkey is qualified for signatures according to German law. */
748 unsigned int is_qualified : 1;
750 /* Internal to GPGME, do not use. */
751 unsigned int _unused : 22;
753 /* This is the protocol supported by this key. */
754 gpgme_protocol_t protocol;
756 /* If protocol is GPGME_PROTOCOL_CMS, this string contains the
760 /* If protocol is GPGME_PROTOCOL_CMS, this string contains the
764 /* If protocol is GPGME_PROTOCOL_CMS, this string contains the chain
768 /* If protocol is GPGME_PROTOCOL_OpenPGP, this field contains the
770 gpgme_validity_t owner_trust;
772 /* The subkeys of the key. */
773 gpgme_subkey_t subkeys;
775 /* The user IDs of the key. */
776 gpgme_user_id_t uids;
778 /* Internal to GPGME, do not use. */
779 gpgme_subkey_t _last_subkey;
781 /* Internal to GPGME, do not use. */
782 gpgme_user_id_t _last_uid;
784 /* The keylist mode that was active when listing the key. */
785 gpgme_keylist_mode_t keylist_mode;
787 typedef struct _gpgme_key *gpgme_key_t;
791 /* Types for callback functions. */
793 /* Request a passphrase from the user. */
794 typedef gpgme_error_t (*gpgme_passphrase_cb_t) (void *hook,
795 const char *uid_hint,
796 const char *passphrase_info,
797 int prev_was_bad, int fd);
799 /* Inform the user about progress made. */
800 typedef void (*gpgme_progress_cb_t) (void *opaque, const char *what,
801 int type, int current, int total);
803 /* Interact with the user about an edit operation. */
804 typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque,
805 gpgme_status_code_t status,
806 const char *args, int fd);
811 /* Context management functions. */
813 /* Create a new context and return it in CTX. */
814 gpgme_error_t gpgme_new (gpgme_ctx_t *ctx);
816 /* Release the context CTX. */
817 void gpgme_release (gpgme_ctx_t ctx);
819 /* Set the protocol to be used by CTX to PROTO. */
820 gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto);
822 /* Get the protocol used with CTX */
823 gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx);
825 /* Set the crypto protocol to be used by CTX to PROTO.
826 gpgme_set_protocol actually sets the backend engine. This sets the
827 crypto protocol used in engines that support more than one crypto
828 prococol (for example, an UISERVER can support OpenPGP and CMS).
829 This is reset to the default with gpgme_set_protocol. */
830 gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx,
831 gpgme_protocol_t proto);
833 /* Get the sub protocol. */
834 gpgme_protocol_t gpgme_get_sub_protocol (gpgme_ctx_t ctx);
836 /* Get the string describing protocol PROTO, or NULL if invalid. */
837 const char *gpgme_get_protocol_name (gpgme_protocol_t proto);
839 /* If YES is non-zero, enable armor mode in CTX, disable it otherwise. */
840 void gpgme_set_armor (gpgme_ctx_t ctx, int yes);
842 /* Return non-zero if armor mode is set in CTX. */
843 int gpgme_get_armor (gpgme_ctx_t ctx);
845 /* If YES is non-zero, enable text mode in CTX, disable it otherwise. */
846 void gpgme_set_textmode (gpgme_ctx_t ctx, int yes);
848 /* Return non-zero if text mode is set in CTX. */
849 int gpgme_get_textmode (gpgme_ctx_t ctx);
851 /* Use whatever the default of the backend crypto engine is. */
852 #define GPGME_INCLUDE_CERTS_DEFAULT -256
854 /* Include up to NR_OF_CERTS certificates in an S/MIME message. */
855 void gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs);
857 /* Return the number of certs to include in an S/MIME message. */
858 int gpgme_get_include_certs (gpgme_ctx_t ctx);
860 /* Set keylist mode in CTX to MODE. */
861 gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t ctx,
862 gpgme_keylist_mode_t mode);
864 /* Get keylist mode in CTX. */
865 gpgme_keylist_mode_t gpgme_get_keylist_mode (gpgme_ctx_t ctx);
867 /* Set the passphrase callback function in CTX to CB. HOOK_VALUE is
868 passed as first argument to the passphrase callback function. */
869 void gpgme_set_passphrase_cb (gpgme_ctx_t ctx,
870 gpgme_passphrase_cb_t cb, void *hook_value);
872 /* Get the current passphrase callback function in *CB and the current
873 hook value in *HOOK_VALUE. */
874 void gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *cb,
877 /* Set the progress callback function in CTX to CB. HOOK_VALUE is
878 passed as first argument to the progress callback function. */
879 void gpgme_set_progress_cb (gpgme_ctx_t c, gpgme_progress_cb_t cb,
882 /* Get the current progress callback function in *CB and the current
883 hook value in *HOOK_VALUE. */
884 void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *cb,
887 /* This function sets the locale for the context CTX, or the default
888 locale if CTX is a null pointer. */
889 gpgme_error_t gpgme_set_locale (gpgme_ctx_t ctx, int category,
892 /* Get the information about the configured engines. A pointer to the
893 first engine in the statically allocated linked list is returned.
894 The returned data is valid until the next gpgme_ctx_set_engine_info. */
895 gpgme_engine_info_t gpgme_ctx_get_engine_info (gpgme_ctx_t ctx);
897 /* Set the engine info for the context CTX, protocol PROTO, to the
898 file name FILE_NAME and the home directory HOME_DIR. */
899 gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx,
900 gpgme_protocol_t proto,
901 const char *file_name,
902 const char *home_dir);
905 /* Return a statically allocated string with the name of the public
906 key algorithm ALGO, or NULL if that name is not known. */
907 const char *gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo);
909 /* Return a statically allocated string with the name of the hash
910 algorithm ALGO, or NULL if that name is not known. */
911 const char *gpgme_hash_algo_name (gpgme_hash_algo_t algo);
914 /* Delete all signers from CTX. */
915 void gpgme_signers_clear (gpgme_ctx_t ctx);
917 /* Add KEY to list of signers in CTX. */
918 gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key);
920 /* Return the SEQth signer's key in CTX. */
921 gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);
923 /* Retrieve the signature status of signature IDX in CTX after a
924 successful verify operation in R_STAT (if non-null). The creation
925 time stamp of the signature is returned in R_CREATED (if non-null).
926 The function returns a string containing the fingerprint.
927 Deprecated, use verify result directly. */
928 const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
929 _gpgme_sig_stat_t *r_stat,
930 time_t *r_created) _GPGME_DEPRECATED;
932 /* Retrieve certain attributes of a signature. IDX is the index
933 number of the signature after a successful verify operation. WHAT
934 is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
935 one. WHATIDX is to be passed as 0 for most attributes . */
936 unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx,
937 _gpgme_attr_t what, int whatidx)
939 const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx,
940 _gpgme_attr_t what, int whatidx)
944 /* Get the key used to create signature IDX in CTX and return it in
946 gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key)
950 /* Clear all notation data from the context. */
951 void gpgme_sig_notation_clear (gpgme_ctx_t ctx);
953 /* Add the human-readable notation data with name NAME and value VALUE
954 to the context CTX, using the flags FLAGS. If NAME is NULL, then
955 VALUE should be a policy URL. The flag
956 GPGME_SIG_NOTATION_HUMAN_READABLE is forced to be true for notation
957 data, and false for policy URLs. */
958 gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
960 gpgme_sig_notation_flags_t flags);
962 /* Get the sig notations for this context. */
963 gpgme_sig_notation_t gpgme_sig_notation_get (gpgme_ctx_t ctx);
968 /* The type of an I/O callback function. */
969 typedef gpgme_error_t (*gpgme_io_cb_t) (void *data, int fd);
971 /* The type of a function that can register FNC as the I/O callback
972 function for the file descriptor FD with direction dir (0: for writing,
973 1: for reading). FNC_DATA should be passed as DATA to FNC. The
974 function should return a TAG suitable for the corresponding
975 gpgme_remove_io_cb_t, and an error value. */
976 typedef gpgme_error_t (*gpgme_register_io_cb_t) (void *data, int fd, int dir,
978 void *fnc_data, void **tag);
980 /* The type of a function that can remove a previously registered I/O
981 callback function given TAG as returned by the register
983 typedef void (*gpgme_remove_io_cb_t) (void *tag);
989 GPGME_EVENT_NEXT_KEY,
990 GPGME_EVENT_NEXT_TRUSTITEM
994 struct gpgme_io_event_done_data
996 /* A fatal IPC error or an operational error in state-less
1000 /* An operational errors in session-based protocols. */
1001 gpgme_error_t op_err;
1003 typedef struct gpgme_io_event_done_data *gpgme_io_event_done_data_t;
1005 /* The type of a function that is called when a context finished an
1007 typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type,
1012 gpgme_register_io_cb_t add;
1014 gpgme_remove_io_cb_t remove;
1015 gpgme_event_io_cb_t event;
1018 typedef struct gpgme_io_cbs *gpgme_io_cbs_t;
1020 /* Set the I/O callback functions in CTX to IO_CBS. */
1021 void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
1023 /* Get the current I/O callback functions. */
1024 void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
1026 /* Wrappers around the internal I/O functions for use with
1027 gpgme_passphrase_cb_t and gpgme_edit_cb_t. */
1028 ssize_t gpgme_io_read (int fd, void *buffer, size_t count);
1029 ssize_t gpgme_io_write (int fd, const void *buffer, size_t count);
1031 /* Process the pending operation and, if HANG is non-zero, wait for
1032 the pending operation to finish. */
1033 gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang);
1035 gpgme_ctx_t gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
1036 gpgme_error_t *op_err, int hang);
1039 /* Functions to handle data objects. */
1041 /* Read up to SIZE bytes into buffer BUFFER from the data object with
1042 the handle HANDLE. Return the number of characters read, 0 on EOF
1043 and -1 on error. If an error occurs, errno is set. */
1044 typedef ssize_t (*gpgme_data_read_cb_t) (void *handle, void *buffer,
1047 /* Write up to SIZE bytes from buffer BUFFER to the data object with
1048 the handle HANDLE. Return the number of characters written, or -1
1049 on error. If an error occurs, errno is set. */
1050 typedef ssize_t (*gpgme_data_write_cb_t) (void *handle, const void *buffer,
1053 /* Set the current position from where the next read or write starts
1054 in the data object with the handle HANDLE to OFFSET, relativ to
1056 typedef off_t (*gpgme_data_seek_cb_t) (void *handle, off_t offset, int whence);
1058 /* Close the data object with the handle DL. */
1059 typedef void (*gpgme_data_release_cb_t) (void *handle);
1061 struct gpgme_data_cbs
1063 gpgme_data_read_cb_t read;
1064 gpgme_data_write_cb_t write;
1065 gpgme_data_seek_cb_t seek;
1066 gpgme_data_release_cb_t release;
1068 typedef struct gpgme_data_cbs *gpgme_data_cbs_t;
1070 /* Read up to SIZE bytes into buffer BUFFER from the data object with
1071 the handle DH. Return the number of characters read, 0 on EOF and
1072 -1 on error. If an error occurs, errno is set. */
1073 ssize_t gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size);
1075 /* Write up to SIZE bytes from buffer BUFFER to the data object with
1076 the handle DH. Return the number of characters written, or -1 on
1077 error. If an error occurs, errno is set. */
1078 ssize_t gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size);
1080 /* Set the current position from where the next read or write starts
1081 in the data object with the handle DH to OFFSET, relativ to
1083 off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence);
1085 /* Create a new data buffer and return it in R_DH. */
1086 gpgme_error_t gpgme_data_new (gpgme_data_t *r_dh);
1088 /* Destroy the data buffer DH. */
1089 void gpgme_data_release (gpgme_data_t dh);
1091 /* Create a new data buffer filled with SIZE bytes starting from
1092 BUFFER. If COPY is zero, copying is delayed until necessary, and
1093 the data is taken from the original location when needed. */
1094 gpgme_error_t gpgme_data_new_from_mem (gpgme_data_t *r_dh,
1095 const char *buffer, size_t size,
1098 /* Destroy the data buffer DH and return a pointer to its content.
1099 The memory has be to released with gpgme_free() by the user. It's
1100 size is returned in R_LEN. */
1101 char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len);
1103 /* Release the memory returned by gpgme_data_release_and_get_mem(). */
1104 void gpgme_free (void *buffer);
1106 gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
1107 gpgme_data_cbs_t cbs,
1110 gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd);
1112 gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream);
1114 /* Return the encoding attribute of the data buffer DH */
1115 gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh);
1117 /* Set the encoding attribute of data buffer DH to ENC */
1118 gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh,
1119 gpgme_data_encoding_t enc);
1121 /* Get the file name associated with the data object with handle DH, or
1122 NULL if there is none. */
1123 char *gpgme_data_get_file_name (gpgme_data_t dh);
1125 /* Set the file name associated with the data object with handle DH to
1127 gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh,
1128 const char *file_name);
1131 /* Create a new data buffer which retrieves the data from the callback
1132 function READ_CB. Deprecated, please use gpgme_data_new_from_cbs
1134 gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
1135 int (*read_cb) (void*,char *,
1137 void *read_cb_value)
1140 /* Create a new data buffer filled with the content of file FNAME.
1141 COPY must be non-zero. For delayed read, please use
1142 gpgme_data_new_from_fd or gpgme_data_new_from stream instead. */
1143 gpgme_error_t gpgme_data_new_from_file (gpgme_data_t *r_dh,
1147 /* Create a new data buffer filled with LENGTH bytes starting from
1148 OFFSET within the file FNAME or stream FP (exactly one must be
1150 gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh,
1151 const char *fname, FILE *fp,
1152 off_t offset, size_t length);
1154 /* Reset the read pointer in DH. Deprecated, please use
1155 gpgme_data_seek instead. */
1156 gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED;
1159 /* Key and trust functions. */
1161 /* Get the key with the fingerprint FPR from the crypto backend. If
1162 SECRET is true, get the secret key. */
1163 gpgme_error_t gpgme_get_key (gpgme_ctx_t ctx, const char *fpr,
1164 gpgme_key_t *r_key, int secret);
1166 /* Acquire a reference to KEY. */
1167 void gpgme_key_ref (gpgme_key_t key);
1169 /* Release a reference to KEY. If this was the last one the key is
1171 void gpgme_key_unref (gpgme_key_t key);
1172 void gpgme_key_release (gpgme_key_t key);
1174 /* Return the value of the attribute WHAT of KEY, which has to be
1175 representable by a string. IDX specifies the sub key or user ID
1176 for attributes related to sub keys or user IDs. Deprecated, use
1177 key structure directly instead. */
1178 const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
1179 const void *reserved, int idx)
1182 /* Return the value of the attribute WHAT of KEY, which has to be
1183 representable by an unsigned integer. IDX specifies the sub key or
1184 user ID for attributes related to sub keys or user IDs.
1185 Deprecated, use key structure directly instead. */
1186 unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
1187 const void *reserved, int idx)
1190 /* Return the value of the attribute WHAT of a signature on user ID
1191 UID_IDX in KEY, which has to be representable by a string. IDX
1192 specifies the signature. Deprecated, use key structure directly
1194 const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
1196 const void *reserved, int idx)
1199 /* Return the value of the attribute WHAT of a signature on user ID
1200 UID_IDX in KEY, which has to be representable by an unsigned
1201 integer string. IDX specifies the signature. Deprecated, use key
1202 structure directly instead. */
1203 unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx,
1205 const void *reserved, int idx)
1209 /* Crypto Operations. */
1211 /* Cancel a pending asynchronous operation. */
1212 gpgme_error_t gpgme_cancel (gpgme_ctx_t ctx);
1214 /* Cancel a pending operation asynchronously. */
1215 gpgme_error_t gpgme_cancel_async (gpgme_ctx_t ctx);
1218 struct _gpgme_invalid_key
1220 struct _gpgme_invalid_key *next;
1222 gpgme_error_t reason;
1224 typedef struct _gpgme_invalid_key *gpgme_invalid_key_t;
1228 struct _gpgme_op_encrypt_result
1230 /* The list of invalid recipients. */
1231 gpgme_invalid_key_t invalid_recipients;
1233 typedef struct _gpgme_op_encrypt_result *gpgme_encrypt_result_t;
1235 /* Retrieve a pointer to the result of the encrypt operation. */
1236 gpgme_encrypt_result_t gpgme_op_encrypt_result (gpgme_ctx_t ctx);
1238 /* The valid encryption flags. */
1241 GPGME_ENCRYPT_ALWAYS_TRUST = 1,
1242 GPGME_ENCRYPT_NO_ENCRYPT_TO = 2,
1243 GPGME_ENCRYPT_PREPARE = 4,
1244 GPGME_ENCRYPT_EXPECT_SIGN = 8
1246 gpgme_encrypt_flags_t;
1248 /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
1249 store the resulting ciphertext in CIPHER. */
1250 gpgme_error_t gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
1251 gpgme_encrypt_flags_t flags,
1252 gpgme_data_t plain, gpgme_data_t cipher);
1253 gpgme_error_t gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[],
1254 gpgme_encrypt_flags_t flags,
1255 gpgme_data_t plain, gpgme_data_t cipher);
1257 /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
1258 store the resulting ciphertext in CIPHER. Also sign the ciphertext
1259 with the signers in CTX. */
1260 gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx,
1262 gpgme_encrypt_flags_t flags,
1264 gpgme_data_t cipher);
1265 gpgme_error_t gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[],
1266 gpgme_encrypt_flags_t flags,
1267 gpgme_data_t plain, gpgme_data_t cipher);
1272 struct _gpgme_recipient
1274 struct _gpgme_recipient *next;
1276 /* The key ID of key for which the text was encrypted. */
1279 /* Internal to GPGME, do not use. */
1280 char _keyid[16 + 1];
1282 /* The public key algorithm of the recipient key. */
1283 gpgme_pubkey_algo_t pubkey_algo;
1285 /* The status of the recipient. */
1286 gpgme_error_t status;
1288 typedef struct _gpgme_recipient *gpgme_recipient_t;
1290 struct _gpgme_op_decrypt_result
1292 char *unsupported_algorithm;
1294 /* Key should not have been used for encryption. */
1295 unsigned int wrong_key_usage : 1;
1297 /* Internal to GPGME, do not use. */
1300 gpgme_recipient_t recipients;
1302 /* The original file name of the plaintext message, if
1306 typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t;
1308 /* Retrieve a pointer to the result of the decrypt operation. */
1309 gpgme_decrypt_result_t gpgme_op_decrypt_result (gpgme_ctx_t ctx);
1311 /* Decrypt ciphertext CIPHER within CTX and store the resulting
1312 plaintext in PLAIN. */
1313 gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
1314 gpgme_data_t plain);
1315 gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx,
1316 gpgme_data_t cipher, gpgme_data_t plain);
1318 /* Decrypt ciphertext CIPHER and make a signature verification within
1319 CTX and store the resulting plaintext in PLAIN. */
1320 gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx,
1321 gpgme_data_t cipher,
1322 gpgme_data_t plain);
1323 gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher,
1324 gpgme_data_t plain);
1328 struct _gpgme_new_signature
1330 struct _gpgme_new_signature *next;
1332 /* The type of the signature. */
1333 gpgme_sig_mode_t type;
1335 /* The public key algorithm used to create the signature. */
1336 gpgme_pubkey_algo_t pubkey_algo;
1338 /* The hash algorithm used to create the signature. */
1339 gpgme_hash_algo_t hash_algo;
1341 /* Internal to GPGME, do not use. Must be set to the same value as
1343 unsigned long _obsolete_class;
1345 /* Signature creation time. */
1348 /* The fingerprint of the signature. */
1352 unsigned int _obsolete_class_2;
1354 /* Must be set to SIG_CLASS below. */
1355 unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME;
1358 /* Crypto backend specific signature class. */
1359 unsigned int sig_class;
1361 typedef struct _gpgme_new_signature *gpgme_new_signature_t;
1363 struct _gpgme_op_sign_result
1365 /* The list of invalid signers. */
1366 gpgme_invalid_key_t invalid_signers;
1367 gpgme_new_signature_t signatures;
1369 typedef struct _gpgme_op_sign_result *gpgme_sign_result_t;
1371 /* Retrieve a pointer to the result of the signing operation. */
1372 gpgme_sign_result_t gpgme_op_sign_result (gpgme_ctx_t ctx);
1374 /* Sign the plaintext PLAIN and store the signature in SIG. */
1375 gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx,
1376 gpgme_data_t plain, gpgme_data_t sig,
1377 gpgme_sig_mode_t mode);
1378 gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx,
1379 gpgme_data_t plain, gpgme_data_t sig,
1380 gpgme_sig_mode_t mode);
1385 /* Flags used for the SUMMARY field in a gpgme_signature_t. */
1388 GPGME_SIGSUM_VALID = 0x0001, /* The signature is fully valid. */
1389 GPGME_SIGSUM_GREEN = 0x0002, /* The signature is good. */
1390 GPGME_SIGSUM_RED = 0x0004, /* The signature is bad. */
1391 GPGME_SIGSUM_KEY_REVOKED = 0x0010, /* One key has been revoked. */
1392 GPGME_SIGSUM_KEY_EXPIRED = 0x0020, /* One key has expired. */
1393 GPGME_SIGSUM_SIG_EXPIRED = 0x0040, /* The signature has expired. */
1394 GPGME_SIGSUM_KEY_MISSING = 0x0080, /* Can't verify: key missing. */
1395 GPGME_SIGSUM_CRL_MISSING = 0x0100, /* CRL not available. */
1396 GPGME_SIGSUM_CRL_TOO_OLD = 0x0200, /* Available CRL is too old. */
1397 GPGME_SIGSUM_BAD_POLICY = 0x0400, /* A policy was not met. */
1398 GPGME_SIGSUM_SYS_ERROR = 0x0800 /* A system error occured. */
1402 struct _gpgme_signature
1404 struct _gpgme_signature *next;
1406 /* A summary of the signature status. */
1407 gpgme_sigsum_t summary;
1409 /* The fingerprint or key ID of the signature. */
1412 /* The status of the signature. */
1413 gpgme_error_t status;
1415 /* Notation data and policy URLs. */
1416 gpgme_sig_notation_t notations;
1418 /* Signature creation time. */
1419 unsigned long timestamp;
1421 /* Signature exipration time or 0. */
1422 unsigned long exp_timestamp;
1424 /* Key should not have been used for signing. */
1425 unsigned int wrong_key_usage : 1;
1427 /* PKA status: 0 = not available, 1 = bad, 2 = okay, 3 = RFU. */
1428 unsigned int pka_trust : 2;
1430 /* Validity has been verified using the chain model. */
1431 unsigned int chain_model : 1;
1433 /* Internal to GPGME, do not use. */
1436 gpgme_validity_t validity;
1437 gpgme_error_t validity_reason;
1439 /* The public key algorithm used to create the signature. */
1440 gpgme_pubkey_algo_t pubkey_algo;
1442 /* The hash algorithm used to create the signature. */
1443 gpgme_hash_algo_t hash_algo;
1445 /* The mailbox from the PKA information or NULL. */
1448 typedef struct _gpgme_signature *gpgme_signature_t;
1450 struct _gpgme_op_verify_result
1452 gpgme_signature_t signatures;
1454 /* The original file name of the plaintext message, if
1458 typedef struct _gpgme_op_verify_result *gpgme_verify_result_t;
1460 /* Retrieve a pointer to the result of the verify operation. */
1461 gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx);
1463 /* Verify within CTX that SIG is a valid signature for TEXT. */
1464 gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig,
1465 gpgme_data_t signed_text,
1466 gpgme_data_t plaintext);
1467 gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig,
1468 gpgme_data_t signed_text,
1469 gpgme_data_t plaintext);
1474 /* The key was new. */
1475 #define GPGME_IMPORT_NEW 1
1477 /* The key contained new user IDs. */
1478 #define GPGME_IMPORT_UID 2
1480 /* The key contained new signatures. */
1481 #define GPGME_IMPORT_SIG 4
1483 /* The key contained new sub keys. */
1484 #define GPGME_IMPORT_SUBKEY 8
1486 /* The key contained a secret key. */
1487 #define GPGME_IMPORT_SECRET 16
1490 struct _gpgme_import_status
1492 struct _gpgme_import_status *next;
1497 /* If a problem occured, the reason why the key could not be
1498 imported. Otherwise GPGME_No_Error. */
1499 gpgme_error_t result;
1501 /* The result of the import, the GPGME_IMPORT_* values bit-wise
1502 ORed. 0 means the key was already known and no new components
1504 unsigned int status;
1506 typedef struct _gpgme_import_status *gpgme_import_status_t;
1509 struct _gpgme_op_import_result
1511 /* Number of considered keys. */
1514 /* Keys without user ID. */
1517 /* Imported keys. */
1520 /* Imported RSA keys. */
1523 /* Unchanged keys. */
1526 /* Number of new user ids. */
1529 /* Number of new sub keys. */
1532 /* Number of new signatures. */
1535 /* Number of new revocations. */
1536 int new_revocations;
1538 /* Number of secret keys read. */
1541 /* Number of secret keys imported. */
1542 int secret_imported;
1544 /* Number of secret keys unchanged. */
1545 int secret_unchanged;
1547 /* Number of new keys skipped. */
1548 int skipped_new_keys;
1550 /* Number of keys not imported. */
1553 /* List of keys for which an import was attempted. */
1554 gpgme_import_status_t imports;
1556 typedef struct _gpgme_op_import_result *gpgme_import_result_t;
1558 /* Retrieve a pointer to the result of the import operation. */
1559 gpgme_import_result_t gpgme_op_import_result (gpgme_ctx_t ctx);
1561 /* Import the key in KEYDATA into the keyring. */
1562 gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata);
1563 gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata);
1564 gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata,
1565 int *nr) _GPGME_DEPRECATED;
1567 /* Import the keys from the array KEYS into the keyring. */
1568 gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t keys[]);
1569 gpgme_error_t gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t keys[]);
1573 /* Export the keys found by PATTERN into KEYDATA. */
1574 gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern,
1575 gpgme_export_mode_t mode,
1576 gpgme_data_t keydata);
1577 gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, const char *pattern,
1578 gpgme_export_mode_t mode,
1579 gpgme_data_t keydata);
1581 gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx,
1582 const char *pattern[],
1583 gpgme_export_mode_t mode,
1584 gpgme_data_t keydata);
1585 gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[],
1586 gpgme_export_mode_t mode,
1587 gpgme_data_t keydata);
1589 /* Export the keys from the array KEYS into KEYDATA. */
1590 gpgme_error_t gpgme_op_export_keys_start (gpgme_ctx_t ctx,
1592 gpgme_export_mode_t mode,
1593 gpgme_data_t keydata);
1594 gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t ctx,
1596 gpgme_export_mode_t mode,
1597 gpgme_data_t keydata);
1601 /* Key generation. */
1602 struct _gpgme_op_genkey_result
1604 /* A primary key was generated. */
1605 unsigned int primary : 1;
1607 /* A sub key was generated. */
1608 unsigned int sub : 1;
1610 /* Internal to GPGME, do not use. */
1611 unsigned int _unused : 30;
1613 /* The fingerprint of the generated key. */
1616 typedef struct _gpgme_op_genkey_result *gpgme_genkey_result_t;
1618 /* Generate a new keypair and add it to the keyring. PUBKEY and
1619 SECKEY should be null for now. PARMS specifies what keys should be
1621 gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms,
1622 gpgme_data_t pubkey, gpgme_data_t seckey);
1623 gpgme_error_t gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms,
1624 gpgme_data_t pubkey, gpgme_data_t seckey);
1626 /* Retrieve a pointer to the result of the genkey operation. */
1627 gpgme_genkey_result_t gpgme_op_genkey_result (gpgme_ctx_t ctx);
1630 /* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret
1631 keys are also deleted. */
1632 gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key,
1634 gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key,
1638 /* Edit the key KEY. Send status and command requests to FNC and
1639 output of edit commands to OUT. */
1640 gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
1641 gpgme_edit_cb_t fnc, void *fnc_value,
1643 gpgme_error_t gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
1644 gpgme_edit_cb_t fnc, void *fnc_value,
1647 /* Edit the card for the key KEY. Send status and command requests to
1648 FNC and output of edit commands to OUT. */
1649 gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
1650 gpgme_edit_cb_t fnc, void *fnc_value,
1652 gpgme_error_t gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
1653 gpgme_edit_cb_t fnc, void *fnc_value,
1657 /* Key management functions. */
1658 struct _gpgme_op_keylist_result
1660 unsigned int truncated : 1;
1662 /* Internal to GPGME, do not use. */
1663 unsigned int _unused : 31;
1665 typedef struct _gpgme_op_keylist_result *gpgme_keylist_result_t;
1667 /* Retrieve a pointer to the result of the key listing operation. */
1668 gpgme_keylist_result_t gpgme_op_keylist_result (gpgme_ctx_t ctx);
1670 /* Start a keylist operation within CTX, searching for keys which
1671 match PATTERN. If SECRET_ONLY is true, only secret keys are
1673 gpgme_error_t gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern,
1675 gpgme_error_t gpgme_op_keylist_ext_start (gpgme_ctx_t ctx,
1676 const char *pattern[],
1677 int secret_only, int reserved);
1679 /* Return the next key from the keylist in R_KEY. */
1680 gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key);
1682 /* Terminate a pending keylist operation within CTX. */
1683 gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx);
1685 /* Change the passphrase for KEY. FLAGS is reserved for future use
1686 and must be passed as 0. */
1687 gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t ctx, gpgme_key_t key,
1688 unsigned int flags);
1689 gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key,
1690 unsigned int flags);
1694 /* Trust items and operations. */
1696 struct _gpgme_trust_item
1698 /* Internal to GPGME, do not use. */
1701 /* The key ID to which the trust item belongs. */
1704 /* Internal to GPGME, do not use. */
1705 char _keyid[16 + 1];
1707 /* The type of the trust item, 1 refers to a key, 2 to a user ID. */
1710 /* The trust level. */
1713 /* The owner trust if TYPE is 1. */
1716 /* Internal to GPGME, do not use. */
1717 char _owner_trust[2];
1719 /* The calculated validity. */
1722 /* Internal to GPGME, do not use. */
1725 /* The user name if TYPE is 2. */
1728 typedef struct _gpgme_trust_item *gpgme_trust_item_t;
1730 /* Start a trustlist operation within CTX, searching for trust items
1731 which match PATTERN. */
1732 gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx,
1733 const char *pattern, int max_level);
1735 /* Return the next trust item from the trustlist in R_ITEM. */
1736 gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx,
1737 gpgme_trust_item_t *r_item);
1739 /* Terminate a pending trustlist operation within CTX. */
1740 gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx);
1742 /* Acquire a reference to ITEM. */
1743 void gpgme_trust_item_ref (gpgme_trust_item_t item);
1745 /* Release a reference to ITEM. If this was the last one the trust
1746 item is destroyed. */
1747 void gpgme_trust_item_unref (gpgme_trust_item_t item);
1749 /* Release the trust item ITEM. Deprecated, use
1750 gpgme_trust_item_unref. */
1751 void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED;
1753 /* Return the value of the attribute WHAT of ITEM, which has to be
1754 representable by a string. Deprecated, use trust item structure
1756 const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
1758 const void *reserved, int idx)
1761 /* Return the value of the attribute WHAT of KEY, which has to be
1762 representable by an integer. IDX specifies a running index if the
1763 attribute appears more than once in the key. Deprecated, use trust
1764 item structure directly. */
1765 int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
1766 const void *reserved, int idx)
1770 /* Return the auditlog for the current session. This may be called
1771 after a successful or failed operation. If no audit log is
1772 available GPG_ERR_NO_DATA is returned. */
1773 gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output,
1774 unsigned int flags);
1775 gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
1776 unsigned int flags);
1780 /* Low-level Assuan protocol access. */
1781 typedef gpgme_error_t (*gpgme_assuan_data_cb_t)
1782 (void *opaque, const void *data, size_t datalen);
1784 typedef gpgme_error_t (*gpgme_assuan_inquire_cb_t)
1785 (void *opaque, const char *name, const char *args,
1786 gpgme_data_t *r_data);
1788 typedef gpgme_error_t (*gpgme_assuan_status_cb_t)
1789 (void *opaque, const char *status, const char *args);
1791 /* Send the Assuan COMMAND and return results via the callbacks.
1792 Asynchronous variant. */
1793 gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
1794 const char *command,
1795 gpgme_assuan_data_cb_t data_cb,
1796 void *data_cb_value,
1797 gpgme_assuan_inquire_cb_t inq_cb,
1799 gpgme_assuan_status_cb_t stat_cb,
1800 void *stat_cb_value);
1802 /* Send the Assuan COMMAND and return results via the callbacks.
1803 Synchronous variant. */
1804 gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
1805 const char *command,
1806 gpgme_assuan_data_cb_t data_cb,
1807 void *data_cb_value,
1808 gpgme_assuan_inquire_cb_t inq_cb,
1810 gpgme_assuan_status_cb_t stat_cb,
1811 void *stat_cb_value,
1812 gpgme_error_t *op_err);
1815 struct _gpgme_op_assuan_result
1817 /* Deprecated. Use the second value in a DONE event or the
1818 synchronous variant gpgme_op_assuan_transact_ext. */
1819 gpgme_error_t err _GPGME_DEPRECATED_OUTSIDE_GPGME;
1821 typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
1824 /* Return the result of the last Assuan command. */
1825 gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx)
1829 gpgme_op_assuan_transact (gpgme_ctx_t ctx,
1830 const char *command,
1831 gpgme_assuan_data_cb_t data_cb,
1832 void *data_cb_value,
1833 gpgme_assuan_inquire_cb_t inq_cb,
1835 gpgme_assuan_status_cb_t status_cb,
1836 void *status_cb_value) _GPGME_DEPRECATED;
1839 /* Crypto container support. */
1840 struct _gpgme_op_vfs_mount_result
1844 typedef struct _gpgme_op_vfs_mount_result *gpgme_vfs_mount_result_t;
1846 gpgme_vfs_mount_result_t gpgme_op_vfs_mount_result (gpgme_ctx_t ctx);
1848 /* The container is automatically unmounted when the context is reset
1849 or destroyed. Transmission errors are returned directly,
1850 operational errors are returned in OP_ERR. */
1851 gpgme_error_t gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
1852 const char *mount_dir, unsigned int flags,
1853 gpgme_error_t *op_err);
1855 gpgme_error_t gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
1856 const char *container_file,
1857 unsigned int flags, gpgme_error_t *op_err);
1860 /* Interface to gpgconf(1). */
1862 /* The expert level at which a configuration option or group of
1863 options should be displayed. See the gpgconf(1) documentation for
1867 GPGME_CONF_BASIC = 0,
1868 GPGME_CONF_ADVANCED = 1,
1869 GPGME_CONF_EXPERT = 2,
1870 GPGME_CONF_INVISIBLE = 3,
1871 GPGME_CONF_INTERNAL = 4
1876 /* The data type of a configuration option argument. See the gpgconf(1)
1877 documentation for more details. */
1881 GPGME_CONF_NONE = 0,
1882 GPGME_CONF_STRING = 1,
1883 GPGME_CONF_INT32 = 2,
1884 GPGME_CONF_UINT32 = 3,
1886 /* Complex types. */
1887 GPGME_CONF_FILENAME = 32,
1888 GPGME_CONF_LDAP_SERVER = 33,
1889 GPGME_CONF_KEY_FPR = 34,
1890 GPGME_CONF_PUB_KEY = 35,
1891 GPGME_CONF_SEC_KEY = 36,
1892 GPGME_CONF_ALIAS_LIST = 37
1896 /* For now, compatibility. */
1897 #define GPGME_CONF_PATHNAME GPGME_CONF_FILENAME
1900 /* This represents a single argument for a configuration option.
1901 Which of the members of value is used depends on the ALT_TYPE. */
1902 typedef struct gpgme_conf_arg
1904 struct gpgme_conf_arg *next;
1905 /* True if the option appears without an (optional) argument. */
1906 unsigned int no_arg;
1910 unsigned int uint32;
1914 } *gpgme_conf_arg_t;
1917 /* The flags of a configuration option. See the gpg-conf
1918 documentation for details. */
1919 #define GPGME_CONF_GROUP (1 << 0)
1920 #define GPGME_CONF_OPTIONAL (1 << 1)
1921 #define GPGME_CONF_LIST (1 << 2)
1922 #define GPGME_CONF_RUNTIME (1 << 3)
1923 #define GPGME_CONF_DEFAULT (1 << 4)
1924 #define GPGME_CONF_DEFAULT_DESC (1 << 5)
1925 #define GPGME_CONF_NO_ARG_DESC (1 << 6)
1926 #define GPGME_CONF_NO_CHANGE (1 << 7)
1929 /* The representation of a single configuration option. See the
1930 gpg-conf documentation for details. */
1931 typedef struct gpgme_conf_opt
1933 struct gpgme_conf_opt *next;
1935 /* The option name. */
1938 /* The flags for this option. */
1941 /* The level of this option. */
1942 gpgme_conf_level_t level;
1944 /* The localized description of this option. */
1947 /* The type and alternate type of this option. */
1948 gpgme_conf_type_t type;
1949 gpgme_conf_type_t alt_type;
1951 /* The localized (short) name of the argument, if any. */
1954 /* The default value. */
1955 gpgme_conf_arg_t default_value;
1956 char *default_description;
1958 /* The default value if the option is not set. */
1959 gpgme_conf_arg_t no_arg_value;
1960 char *no_arg_description;
1962 /* The current value if the option is set. */
1963 gpgme_conf_arg_t value;
1965 /* The new value, if any. NULL means reset to default. */
1967 gpgme_conf_arg_t new_value;
1969 /* Free for application use. */
1971 } *gpgme_conf_opt_t;
1974 /* The representation of a component that can be configured. See the
1975 gpg-conf documentation for details. */
1976 typedef struct gpgme_conf_comp
1978 struct gpgme_conf_comp *next;
1980 /* Internal to GPGME, do not use! */
1981 gpgme_conf_opt_t *_last_opt_p;
1983 /* The component name. */
1986 /* A human-readable description for the component. */
1989 /* The program name (an absolute path to the program). */
1992 /* A linked list of options for this component. */
1993 struct gpgme_conf_opt *options;
1994 } *gpgme_conf_comp_t;
1997 /* Allocate a new gpgme_conf_arg_t. If VALUE is NULL, a "no arg
1998 default" is prepared. If type is a string type, VALUE should point
1999 to the string. Else, it should point to an unsigned or signed
2000 integer respectively. */
2001 gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
2002 gpgme_conf_type_t type, const void *value);
2004 /* This also releases all chained argument structures! */
2005 void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
2007 /* Register a change for the value of OPT to ARG. If RESET is 1 (do
2008 not use any values but 0 or 1), ARG is ignored and the option is
2009 not changed (reverting a previous change). Otherwise, if ARG is
2010 NULL, the option is cleared or reset to its default. */
2011 gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
2012 gpgme_conf_arg_t arg);
2014 /* Release a set of configurations. */
2015 void gpgme_conf_release (gpgme_conf_comp_t conf);
2017 /* Retrieve the current configurations. */
2018 gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
2020 /* Save the configuration of component comp. This function does not
2021 follow chained components! */
2022 gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
2025 /* UIServer support. */
2027 /* Create a dummy key to specify an email address. */
2028 gpgme_error_t gpgme_key_from_uid (gpgme_key_t *key, const char *name);
2032 /* Various functions. */
2034 /* Check that the library fulfills the version requirement. Note:
2035 This is here only for the case where a user takes a pointer from
2036 the old version of this function. The new version and macro for
2037 run-time checks are below. */
2038 const char *gpgme_check_version (const char *req_version);
2040 /* Check that the library fulfills the version requirement and check
2041 for struct layout mismatch involving bitfields. */
2042 const char *gpgme_check_version_internal (const char *req_version,
2043 size_t offset_sig_validity);
2045 #define gpgme_check_version(req_version) \
2046 gpgme_check_version_internal (req_version, \
2047 offsetof (struct _gpgme_signature, validity))
2049 /* Get the information about the configured and installed engines. A
2050 pointer to the first engine in the statically allocated linked list
2051 is returned in *INFO. If an error occurs, it is returned. The
2052 returned data is valid until the next gpgme_set_engine_info. */
2053 gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *engine_info);
2055 /* Set the default engine info for the protocol PROTO to the file name
2056 FILE_NAME and the home directory HOME_DIR. */
2057 gpgme_error_t gpgme_set_engine_info (gpgme_protocol_t proto,
2058 const char *file_name,
2059 const char *home_dir);
2062 /* Engine support functions. */
2064 /* Verify that the engine implementing PROTO is installed and
2066 gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto);
2069 void gpgme_result_ref (void *result);
2070 void gpgme_result_unref (void *result);
2073 /* Deprecated types. */
2074 typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED;
2075 typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED;
2076 typedef gpgme_error_t GpgmeError _GPGME_DEPRECATED;
2077 typedef gpgme_data_encoding_t GpgmeDataEncoding _GPGME_DEPRECATED;
2078 typedef gpgme_pubkey_algo_t GpgmePubKeyAlgo _GPGME_DEPRECATED;
2079 typedef gpgme_hash_algo_t GpgmeHashAlgo _GPGME_DEPRECATED;
2080 typedef gpgme_sig_stat_t GpgmeSigStat _GPGME_DEPRECATED;
2081 typedef gpgme_sig_mode_t GpgmeSigMode _GPGME_DEPRECATED;
2082 typedef gpgme_attr_t GpgmeAttr _GPGME_DEPRECATED;
2083 typedef gpgme_validity_t GpgmeValidity _GPGME_DEPRECATED;
2084 typedef gpgme_protocol_t GpgmeProtocol _GPGME_DEPRECATED;
2085 typedef gpgme_engine_info_t GpgmeEngineInfo _GPGME_DEPRECATED;
2086 typedef gpgme_subkey_t GpgmeSubkey _GPGME_DEPRECATED;
2087 typedef gpgme_key_sig_t GpgmeKeySig _GPGME_DEPRECATED;
2088 typedef gpgme_user_id_t GpgmeUserID _GPGME_DEPRECATED;
2089 typedef gpgme_key_t GpgmeKey _GPGME_DEPRECATED;
2090 typedef gpgme_passphrase_cb_t GpgmePassphraseCb _GPGME_DEPRECATED;
2091 typedef gpgme_progress_cb_t GpgmeProgressCb _GPGME_DEPRECATED;
2092 typedef gpgme_io_cb_t GpgmeIOCb _GPGME_DEPRECATED;
2093 typedef gpgme_register_io_cb_t GpgmeRegisterIOCb _GPGME_DEPRECATED;
2094 typedef gpgme_remove_io_cb_t GpgmeRemoveIOCb _GPGME_DEPRECATED;
2095 typedef gpgme_event_io_t GpgmeEventIO _GPGME_DEPRECATED;
2096 typedef gpgme_event_io_cb_t GpgmeEventIOCb _GPGME_DEPRECATED;
2097 #define GpgmeIOCbs gpgme_io_cbs
2098 typedef gpgme_data_read_cb_t GpgmeDataReadCb _GPGME_DEPRECATED;
2099 typedef gpgme_data_write_cb_t GpgmeDataWriteCb _GPGME_DEPRECATED;
2100 typedef gpgme_data_seek_cb_t GpgmeDataSeekCb _GPGME_DEPRECATED;
2101 typedef gpgme_data_release_cb_t GpgmeDataReleaseCb _GPGME_DEPRECATED;
2102 #define GpgmeDataCbs gpgme_data_cbs
2103 typedef gpgme_encrypt_result_t GpgmeEncryptResult _GPGME_DEPRECATED;
2104 typedef gpgme_sig_notation_t GpgmeSigNotation _GPGME_DEPRECATED;
2105 typedef gpgme_signature_t GpgmeSignature _GPGME_DEPRECATED;
2106 typedef gpgme_verify_result_t GpgmeVerifyResult _GPGME_DEPRECATED;
2107 typedef gpgme_import_status_t GpgmeImportStatus _GPGME_DEPRECATED;
2108 typedef gpgme_import_result_t GpgmeImportResult _GPGME_DEPRECATED;
2109 typedef gpgme_genkey_result_t GpgmeGenKeyResult _GPGME_DEPRECATED;
2110 typedef gpgme_trust_item_t GpgmeTrustItem _GPGME_DEPRECATED;
2111 typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED;
2116 #endif /* GPGME_H */
2118 @emacs_local_vars_begin@
2119 @emacs_local_vars_read_only@
2120 @emacs_local_vars_end@