Imported Upstream version 1.14.0
[platform/upstream/gpgme.git] / src / gpgme.h.in
index 7cfe8f6..b4f817b 100644 (file)
@@ -1,6 +1,6 @@
 /* gpgme.h - Public interface to GnuPG Made Easy.                   -*- c -*-
  * Copyright (C) 2000 Werner Koch (dd9jn)
- * Copyright (C) 2001-2016 g10 Code GmbH
+ * Copyright (C) 2001-2018 g10 Code GmbH
  *
  * This file is part of GPGME.
  *
@@ -15,7 +15,8 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * License along with this program; if not, see <https://gnu.org/licenses/>.
+ * SPDX-License-Identifier: LGPL-2.1-or-later
  *
  * Generated from gpgme.h.in for @GPGME_CONFIG_HOST@.
  */
@@ -37,14 +38,14 @@ extern "C" {
 
 
 /* The version of this header should match the one of the library.  Do
  not use this symbol in your application, use gpgme_check_version
  instead.  The purpose of this macro is to let autoconf (using the
  AM_PATH_GPGME macro) check that this header matches the installed
  library.  */
* not use this symbol in your application, use gpgme_check_version
* instead.  The purpose of this macro is to let autoconf (using the
* AM_PATH_GPGME macro) check that this header matches the installed
* library.  */
 #define GPGME_VERSION "@PACKAGE_VERSION@"
 
 /* The version number of this header.  It may be used to handle minor
  API incompatibilities.  */
* API incompatibilities.  */
 #define GPGME_VERSION_NUMBER @VERSION_NUMBER@
 
 
@@ -87,13 +88,19 @@ extern "C" {
 
 
 /* The macro _GPGME_DEPRECATED_OUTSIDE_GPGME suppresses warnings for
  fields we must access in GPGME for ABI compatibility.  */
* fields we must access in GPGME for ABI compatibility.  */
 #ifdef _GPGME_IN_GPGME
 #define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b)
 #else
 #define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b) _GPGME_DEPRECATED(a,b)
 #endif
 
+/* We used to use some symbols which clash with keywords in some
+ * languages.  This macro is used to obsolete them.  */
+#if defined(__cplusplus) || defined(SWIGPYTHON)
+# define _GPGME_OBSOLETE_SOME_SYMBOLS 1
+#endif
+
 
 /* Check for a matching _FILE_OFFSET_BITS definition.  */
 #if @NEED__FILE_OFFSET_BITS@
@@ -113,7 +120,7 @@ extern "C" {
  */
 
 /* The context holds some global state and configuration options, as
  well as the results of a crypto operation.  */
* well as the results of a crypto operation.  */
 struct gpgme_context;
 typedef struct gpgme_context *gpgme_ctx_t;
 
@@ -124,7 +131,8 @@ typedef struct gpgme_data *gpgme_data_t;
 
 \f
 /*
- * Wrappers for the libgpg-error library.
+ * Wrappers for the libgpg-error library.  They are generally not
+ * needed and the gpg-error versions may be used instead.
  */
 
 typedef gpg_error_t gpgme_error_t;
@@ -140,7 +148,7 @@ gpgme_err_make (gpgme_err_source_t source, gpgme_err_code_t code)
 
 
 /* The user can define GPGME_ERR_SOURCE_DEFAULT before including this
  file to specify a default source for gpgme_error.  */
* file to specify a default source for gpgme_error.  */
 #ifndef GPGME_ERR_SOURCE_DEFAULT
 #define GPGME_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_USER_1
 #endif
@@ -167,45 +175,46 @@ gpgme_err_source (gpgme_error_t err)
 
 
 /* Return a pointer to a string containing a description of the error
  code in the error value ERR.  This function is not thread safe.  */
* code in the error value ERR.  This function is not thread safe.  */
 const char *gpgme_strerror (gpgme_error_t err);
 
 /* Return the error string for ERR in the user-supplied buffer BUF of
  size BUFLEN.  This function is, in contrast to gpg_strerror,
  thread-safe if a thread-safe strerror_r() function is provided by
  the system.  If the function succeeds, 0 is returned and BUF
  contains the string describing the error.  If the buffer was not
  large enough, ERANGE is returned and BUF contains as much of the
  beginning of the error string as fits into the buffer.  */
* size BUFLEN.  This function is, in contrast to gpg_strerror,
* thread-safe if a thread-safe strerror_r() function is provided by
* the system.  If the function succeeds, 0 is returned and BUF
* contains the string describing the error.  If the buffer was not
* large enough, ERANGE is returned and BUF contains as much of the
* beginning of the error string as fits into the buffer.  */
 int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen);
 
 /* Return a pointer to a string containing a description of the error
  source in the error value ERR.  */
* source in the error value ERR.  */
 const char *gpgme_strsource (gpgme_error_t err);
 
 /* Retrieve the error code for the system error ERR.  This returns
  GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
  this).  */
* GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
* this).  */
 gpgme_err_code_t gpgme_err_code_from_errno (int err);
 
 /* Retrieve the system error for the error code CODE.  This returns 0
  if CODE is not a system error code.  */
* if CODE is not a system error code.  */
 int gpgme_err_code_to_errno (gpgme_err_code_t code);
 
 /* Retrieve the error code directly from the ERRNO variable.  This
  returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
  (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
* returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
* (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
 gpgme_err_code_t gpgme_err_code_from_syserror (void);
 
 /* Set the ERRNO variable.  This function is the preferred way to set
  ERRNO due to peculiarities on WindowsCE.  */
* ERRNO due to peculiarities on WindowsCE.  */
 void gpgme_err_set_errno (int err);
 
 /* Return an error value with the error source SOURCE and the system
-   error ERR.  FIXME: Should be inline.  */
*  error ERR.  FIXME: Should be inline.  */
 gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err);
 
-/* Return an error value with the system error ERR.  FIXME: Should be inline.  */
+/* Return an error value with the system error ERR.
+ * inline.  */
 gpgme_error_t gpgme_error_from_errno (int err);
 
 
@@ -294,24 +303,6 @@ typedef enum
 gpgme_hash_algo_t;
 
 
-/* The possible signature stati.  Deprecated, use error value in sig
-   status.  */
-typedef enum
-  {
-    GPGME_SIG_STAT_NONE  = 0,
-    GPGME_SIG_STAT_GOOD  = 1,
-    GPGME_SIG_STAT_BAD   = 2,
-    GPGME_SIG_STAT_NOKEY = 3,
-    GPGME_SIG_STAT_NOSIG = 4,
-    GPGME_SIG_STAT_ERROR = 5,
-    GPGME_SIG_STAT_DIFF  = 6,
-    GPGME_SIG_STAT_GOOD_EXP = 7,
-    GPGME_SIG_STAT_GOOD_EXPKEY = 8
-  }
-_gpgme_sig_stat_t;
-typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED(0,4);
-
-
 /* The available signature modes.  */
 typedef enum
   {
@@ -322,48 +313,7 @@ typedef enum
 gpgme_sig_mode_t;
 
 
-/* The available key and signature attributes.  Deprecated, use the
-   individual result structures instead.  */
-typedef enum
-  {
-    GPGME_ATTR_KEYID        = 1,
-    GPGME_ATTR_FPR          = 2,
-    GPGME_ATTR_ALGO         = 3,
-    GPGME_ATTR_LEN          = 4,
-    GPGME_ATTR_CREATED      = 5,
-    GPGME_ATTR_EXPIRE       = 6,
-    GPGME_ATTR_OTRUST       = 7,
-    GPGME_ATTR_USERID       = 8,
-    GPGME_ATTR_NAME         = 9,
-    GPGME_ATTR_EMAIL        = 10,
-    GPGME_ATTR_COMMENT      = 11,
-    GPGME_ATTR_VALIDITY     = 12,
-    GPGME_ATTR_LEVEL        = 13,
-    GPGME_ATTR_TYPE         = 14,
-    GPGME_ATTR_IS_SECRET    = 15,
-    GPGME_ATTR_KEY_REVOKED  = 16,
-    GPGME_ATTR_KEY_INVALID  = 17,
-    GPGME_ATTR_UID_REVOKED  = 18,
-    GPGME_ATTR_UID_INVALID  = 19,
-    GPGME_ATTR_KEY_CAPS     = 20,
-    GPGME_ATTR_CAN_ENCRYPT  = 21,
-    GPGME_ATTR_CAN_SIGN     = 22,
-    GPGME_ATTR_CAN_CERTIFY  = 23,
-    GPGME_ATTR_KEY_EXPIRED  = 24,
-    GPGME_ATTR_KEY_DISABLED = 25,
-    GPGME_ATTR_SERIAL       = 26,
-    GPGME_ATTR_ISSUER       = 27,
-    GPGME_ATTR_CHAINID      = 28,
-    GPGME_ATTR_SIG_STATUS   = 29,
-    GPGME_ATTR_ERRTOK       = 30,
-    GPGME_ATTR_SIG_SUMMARY  = 31,
-    GPGME_ATTR_SIG_CLASS    = 32
-  }
-_gpgme_attr_t;
-typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED(0,4);
-
-
-/* The available validities for a trust item or key.  */
+/* The available validities for a key.  */
 typedef enum
   {
     GPGME_VALIDITY_UNKNOWN   = 0,
@@ -389,6 +339,21 @@ typedef enum
 gpgme_tofu_policy_t;
 
 
+/* The key origin values. */
+typedef enum
+  {
+    GPGME_KEYORG_UNKNOWN      = 0,
+    GPGME_KEYORG_KS           = 1,
+    GPGME_KEYORG_DANE         = 3,
+    GPGME_KEYORG_WKD          = 4,
+    GPGME_KEYORG_URL          = 5,
+    GPGME_KEYORG_FILE         = 6,
+    GPGME_KEYORG_SELF         = 7,
+    GPGME_KEYORG_OTHER        = 31
+  }
+gpgme_keyorg_t;
+
+
 /* The available protocols.  */
 typedef enum
   {
@@ -414,9 +379,12 @@ gpgme_protocol_t;
 #define GPGME_KEYLIST_MODE_SIG_NOTATIONS       8
 #define GPGME_KEYLIST_MODE_WITH_SECRET         16
 #define GPGME_KEYLIST_MODE_WITH_TOFU           32
+#define GPGME_KEYLIST_MODE_WITH_KEYGRIP        64
 #define GPGME_KEYLIST_MODE_EPHEMERAL            128
 #define GPGME_KEYLIST_MODE_VALIDATE            256
 
+#define GPGME_KEYLIST_MODE_LOCATE              (1|2)
+
 typedef unsigned int gpgme_keylist_mode_t;
 
 
@@ -438,143 +406,34 @@ gpgme_pinentry_mode_t;
 #define GPGME_EXPORT_MODE_SECRET               16
 #define GPGME_EXPORT_MODE_RAW                  32
 #define GPGME_EXPORT_MODE_PKCS12               64
+#define GPGME_EXPORT_MODE_NOUID               128  /* Experimental(!)*/
+#define GPGME_EXPORT_MODE_SSH                 256
 
 typedef unsigned int gpgme_export_mode_t;
 
 
 /* Flags for the audit log functions.  */
+#define GPGME_AUDITLOG_DEFAULT   0
 #define GPGME_AUDITLOG_HTML      1
+#define GPGME_AUDITLOG_DIAG      2
 #define GPGME_AUDITLOG_WITH_HELP 128
 
 
-/* The possible stati for gpgme_op_edit.  The use of that function and
- * these status codes are deprecated in favor of gpgme_op_interact. */
-typedef enum
-  {
-    GPGME_STATUS_EOF = 0,
-    /* mkstatus processing starts here */
-    GPGME_STATUS_ENTER = 1,
-    GPGME_STATUS_LEAVE = 2,
-    GPGME_STATUS_ABORT = 3,
-
-    GPGME_STATUS_GOODSIG = 4,
-    GPGME_STATUS_BADSIG = 5,
-    GPGME_STATUS_ERRSIG = 6,
-
-    GPGME_STATUS_BADARMOR = 7,
-
-    GPGME_STATUS_RSA_OR_IDEA = 8,      /* (legacy) */
-    GPGME_STATUS_KEYEXPIRED = 9,
-    GPGME_STATUS_KEYREVOKED = 10,
-
-    GPGME_STATUS_TRUST_UNDEFINED = 11,
-    GPGME_STATUS_TRUST_NEVER = 12,
-    GPGME_STATUS_TRUST_MARGINAL = 13,
-    GPGME_STATUS_TRUST_FULLY = 14,
-    GPGME_STATUS_TRUST_ULTIMATE = 15,
-
-    GPGME_STATUS_SHM_INFO = 16,        /* (legacy) */
-    GPGME_STATUS_SHM_GET = 17,         /* (legacy) */
-    GPGME_STATUS_SHM_GET_BOOL = 18,    /* (legacy) */
-    GPGME_STATUS_SHM_GET_HIDDEN = 19,  /* (legacy) */
-
-    GPGME_STATUS_NEED_PASSPHRASE = 20,
-    GPGME_STATUS_VALIDSIG = 21,
-    GPGME_STATUS_SIG_ID = 22,
-    GPGME_STATUS_ENC_TO = 23,
-    GPGME_STATUS_NODATA = 24,
-    GPGME_STATUS_BAD_PASSPHRASE = 25,
-    GPGME_STATUS_NO_PUBKEY = 26,
-    GPGME_STATUS_NO_SECKEY = 27,
-    GPGME_STATUS_NEED_PASSPHRASE_SYM = 28,
-    GPGME_STATUS_DECRYPTION_FAILED = 29,
-    GPGME_STATUS_DECRYPTION_OKAY = 30,
-    GPGME_STATUS_MISSING_PASSPHRASE = 31,
-    GPGME_STATUS_GOOD_PASSPHRASE = 32,
-    GPGME_STATUS_GOODMDC = 33,
-    GPGME_STATUS_BADMDC = 34,
-    GPGME_STATUS_ERRMDC = 35,
-    GPGME_STATUS_IMPORTED = 36,
-    GPGME_STATUS_IMPORT_OK = 37,
-    GPGME_STATUS_IMPORT_PROBLEM = 38,
-    GPGME_STATUS_IMPORT_RES = 39,
-    GPGME_STATUS_FILE_START = 40,
-    GPGME_STATUS_FILE_DONE = 41,
-    GPGME_STATUS_FILE_ERROR = 42,
-
-    GPGME_STATUS_BEGIN_DECRYPTION = 43,
-    GPGME_STATUS_END_DECRYPTION = 44,
-    GPGME_STATUS_BEGIN_ENCRYPTION = 45,
-    GPGME_STATUS_END_ENCRYPTION = 46,
-
-    GPGME_STATUS_DELETE_PROBLEM = 47,
-    GPGME_STATUS_GET_BOOL = 48,
-    GPGME_STATUS_GET_LINE = 49,
-    GPGME_STATUS_GET_HIDDEN = 50,
-    GPGME_STATUS_GOT_IT = 51,
-    GPGME_STATUS_PROGRESS = 52,
-    GPGME_STATUS_SIG_CREATED = 53,
-    GPGME_STATUS_SESSION_KEY = 54,
-    GPGME_STATUS_NOTATION_NAME = 55,
-    GPGME_STATUS_NOTATION_DATA = 56,
-    GPGME_STATUS_POLICY_URL = 57,
-    GPGME_STATUS_BEGIN_STREAM = 58,    /* (legacy) */
-    GPGME_STATUS_END_STREAM = 59,      /* (legacy) */
-    GPGME_STATUS_KEY_CREATED = 60,
-    GPGME_STATUS_USERID_HINT = 61,
-    GPGME_STATUS_UNEXPECTED = 62,
-    GPGME_STATUS_INV_RECP = 63,
-    GPGME_STATUS_NO_RECP = 64,
-    GPGME_STATUS_ALREADY_SIGNED = 65,
-    GPGME_STATUS_SIGEXPIRED = 66,      /* (legacy) */
-    GPGME_STATUS_EXPSIG = 67,
-    GPGME_STATUS_EXPKEYSIG = 68,
-    GPGME_STATUS_TRUNCATED = 69,
-    GPGME_STATUS_ERROR = 70,
-    GPGME_STATUS_NEWSIG = 71,
-    GPGME_STATUS_REVKEYSIG = 72,
-    GPGME_STATUS_SIG_SUBPACKET = 73,
-    GPGME_STATUS_NEED_PASSPHRASE_PIN = 74,
-    GPGME_STATUS_SC_OP_FAILURE = 75,
-    GPGME_STATUS_SC_OP_SUCCESS = 76,
-    GPGME_STATUS_CARDCTRL = 77,
-    GPGME_STATUS_BACKUP_KEY_CREATED = 78,
-    GPGME_STATUS_PKA_TRUST_BAD = 79,
-    GPGME_STATUS_PKA_TRUST_GOOD = 80,
-    GPGME_STATUS_PLAINTEXT = 81,
-    GPGME_STATUS_INV_SGNR = 82,
-    GPGME_STATUS_NO_SGNR = 83,
-    GPGME_STATUS_SUCCESS = 84,
-    GPGME_STATUS_DECRYPTION_INFO = 85,
-    GPGME_STATUS_PLAINTEXT_LENGTH = 86,
-    GPGME_STATUS_MOUNTPOINT = 87,
-    GPGME_STATUS_PINENTRY_LAUNCHED = 88,
-    GPGME_STATUS_ATTRIBUTE = 89,
-    GPGME_STATUS_BEGIN_SIGNING = 90,
-    GPGME_STATUS_KEY_NOT_CREATED = 91,
-    GPGME_STATUS_INQUIRE_MAXLEN = 92,
-    GPGME_STATUS_FAILURE = 93,
-    GPGME_STATUS_KEY_CONSIDERED = 94,
-    GPGME_STATUS_TOFU_USER = 95,
-    GPGME_STATUS_TOFU_STATS = 96,
-    GPGME_STATUS_TOFU_STATS_LONG = 97,
-    GPGME_STATUS_NOTATION_FLAGS = 98
-  }
-gpgme_status_code_t;
-
-
 /* The available signature notation flags.  */
 #define GPGME_SIG_NOTATION_HUMAN_READABLE      1
 #define GPGME_SIG_NOTATION_CRITICAL            2
 
 typedef unsigned int gpgme_sig_notation_flags_t;
 
+/* An object to hold information about notation data.  This structure
+ * shall be considered read-only and an application must not allocate
+ * such a structure on its own.  */
 struct _gpgme_sig_notation
 {
   struct _gpgme_sig_notation *next;
 
   /* If NAME is a null pointer, then VALUE contains a policy URL
-     rather than a notation.  */
+   * rather than a notation.  */
   char *name;
 
   /* The value of the notation data.  */
@@ -606,7 +465,9 @@ typedef struct _gpgme_sig_notation *gpgme_sig_notation_t;
  * Public structures.
  */
 
-/* The engine information structure.  */
+/* The engine information structure.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_engine_info
 {
   struct _gpgme_engine_info *next;
@@ -629,7 +490,9 @@ struct _gpgme_engine_info
 typedef struct _gpgme_engine_info *gpgme_engine_info_t;
 
 
-/* An object with TOFU information.  */
+/* An object with TOFU information.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_tofu_info
 {
   struct _gpgme_tofu_info *next;
@@ -666,7 +529,9 @@ struct _gpgme_tofu_info
 typedef struct _gpgme_tofu_info *gpgme_tofu_info_t;
 
 
-/* A subkey from a key.  */
+/* A subkey from a key.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_subkey
 {
   struct _gpgme_subkey *next;
@@ -704,8 +569,11 @@ struct _gpgme_subkey
   /* True if the secret key is stored on a smart card.  */
   unsigned int is_cardkey : 1;
 
+  /* True if the key is compliant to the de-vs mode.  */
+  unsigned int is_de_vs : 1;
+
   /* Internal to GPGME, do not use.  */
-  unsigned int _unused : 21;
+  unsigned int _unused : 20;
 
   /* Public key algorithm supported by this subkey.  */
   gpgme_pubkey_algo_t pubkey_algo;
@@ -734,13 +602,15 @@ struct _gpgme_subkey
   /* The name of the curve for ECC algorithms or NULL.  */
   char *curve;
 
-  /* The keygrip of the subkey in hex digit form or NULL if not availabale.  */
+  /* The keygrip of the subkey in hex digit form or NULL if not available.  */
   char *keygrip;
 };
 typedef struct _gpgme_subkey *gpgme_subkey_t;
 
 
-/* A signature on a user ID.  */
+/* A signature on a user ID.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_key_sig
 {
   struct _gpgme_key_sig *next;
@@ -778,10 +648,10 @@ struct _gpgme_key_sig
   /* Same as in gpgme_signature_t.  */
   gpgme_error_t status;
 
-#ifdef __cplusplus
+  /* Deprecated; use SIG_CLASS instead.  */
+#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
   unsigned int _obsolete_class _GPGME_DEPRECATED(0,4);
 #else
-  /* Must be set to SIG_CLASS below.  */
   unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
 #endif
 
@@ -809,7 +679,9 @@ struct _gpgme_key_sig
 typedef struct _gpgme_key_sig *gpgme_key_sig_t;
 
 
-/* An user ID from a key.  */
+/* An user ID from a key.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_user_id
 {
   struct _gpgme_user_id *next;
@@ -821,7 +693,10 @@ struct _gpgme_user_id
   unsigned int invalid : 1;
 
   /* Internal to GPGME, do not use.  */
-  unsigned int _unused : 30;
+  unsigned int _unused : 25;
+
+  /* Origin of this user ID.  */
+  unsigned int origin : 5;
 
   /* The validity of the user ID.  */
   gpgme_validity_t validity;
@@ -852,11 +727,19 @@ struct _gpgme_user_id
 
   /* The malloced TOFU information or NULL.  */
   gpgme_tofu_info_t tofu;
+
+  /* Time of the last refresh of this user id.  0 if unknown.  */
+  unsigned long last_update;
+
+  /* The string to exactly identify a userid.  Might be NULL.  */
+  char *uidhash;
 };
 typedef struct _gpgme_user_id *gpgme_user_id_t;
 
 
-/* A key from the keyring.  */
+/* A key from the keyring.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_key
 {
   /* Internal to GPGME, do not use.  */
@@ -893,7 +776,10 @@ struct _gpgme_key
   unsigned int is_qualified : 1;
 
   /* Internal to GPGME, do not use.  */
-  unsigned int _unused : 22;
+  unsigned int _unused : 17;
+
+  /* Origin of this key.  */
+  unsigned int origin : 5;
 
   /* This is the protocol supported by this key.  */
   gpgme_protocol_t protocol;
@@ -933,11 +819,16 @@ struct _gpgme_key
    * this is a copy of the FPR of the first subkey.  We need it here
    * to allow for an incomplete key object.  */
   char *fpr;
+
+  /* Time of the last refresh of the entire key.  0 if unknown.  */
+  unsigned long last_update;
 };
 typedef struct _gpgme_key *gpgme_key_t;
 
 
-/* An invalid key object.  */
+/* An invalid key object.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_invalid_key
 {
   struct _gpgme_invalid_key *next;
@@ -976,13 +867,6 @@ typedef gpgme_error_t (*gpgme_interact_cb_t) (void *opaque,
                                               const char *keyword,
                                               const char *args, int fd);
 
-/* The callback type used by the deprecated functions gpgme_op_edit
- * and gpgme_op_card_edit.  */
-typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque,
-                                         gpgme_status_code_t status,
-                                         const char *args, int fd);
-
-
 
 \f
 /*
@@ -1009,10 +893,10 @@ gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto);
 gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx);
 
 /* Set the crypto protocol to be used by CTX to PROTO.
  gpgme_set_protocol actually sets the backend engine.  This sets the
  crypto protocol used in engines that support more than one crypto
  prococol (for example, an UISERVER can support OpenPGP and CMS).
  This is reset to the default with gpgme_set_protocol.  */
* gpgme_set_protocol actually sets the backend engine.  This sets the
* crypto protocol used in engines that support more than one crypto
* prococol (for example, an UISERVER can support OpenPGP and CMS).
* This is reset to the default with gpgme_set_protocol.  */
 gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx,
                                      gpgme_protocol_t proto);
 
@@ -1064,47 +948,47 @@ gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t ctx,
 gpgme_pinentry_mode_t gpgme_get_pinentry_mode (gpgme_ctx_t ctx);
 
 /* Set the passphrase callback function in CTX to CB.  HOOK_VALUE is
  passed as first argument to the passphrase callback function.  */
* passed as first argument to the passphrase callback function.  */
 void gpgme_set_passphrase_cb (gpgme_ctx_t ctx,
                               gpgme_passphrase_cb_t cb, void *hook_value);
 
 /* Get the current passphrase callback function in *CB and the current
  hook value in *HOOK_VALUE.  */
* hook value in *HOOK_VALUE.  */
 void gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *cb,
                              void **hook_value);
 
 /* Set the progress callback function in CTX to CB.  HOOK_VALUE is
  passed as first argument to the progress callback function.  */
* passed as first argument to the progress callback function.  */
 void gpgme_set_progress_cb (gpgme_ctx_t c, gpgme_progress_cb_t cb,
                            void *hook_value);
 
 /* Get the current progress callback function in *CB and the current
  hook value in *HOOK_VALUE.  */
* hook value in *HOOK_VALUE.  */
 void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *cb,
                            void **hook_value);
 
 /* Set the status callback function in CTX to CB.  HOOK_VALUE is
  passed as first argument to the status callback function.  */
* passed as first argument to the status callback function.  */
 void gpgme_set_status_cb (gpgme_ctx_t c, gpgme_status_cb_t cb,
                           void *hook_value);
 
 /* Get the current status callback function in *CB and the current
  hook value in *HOOK_VALUE.  */
* hook value in *HOOK_VALUE.  */
 void gpgme_get_status_cb (gpgme_ctx_t ctx, gpgme_status_cb_t *cb,
                           void **hook_value);
 
 /* This function sets the locale for the context CTX, or the default
  locale if CTX is a null pointer.  */
* locale if CTX is a null pointer.  */
 gpgme_error_t gpgme_set_locale (gpgme_ctx_t ctx, int category,
                                const char *value);
 
 /* Get the information about the configured engines.  A pointer to the
  first engine in the statically allocated linked list is returned.
  The returned data is valid until the next gpgme_ctx_set_engine_info.  */
* first engine in the statically allocated linked list is returned.
* The returned data is valid until the next gpgme_ctx_set_engine_info.  */
 gpgme_engine_info_t gpgme_ctx_get_engine_info (gpgme_ctx_t ctx);
 
 /* Set the engine info for the context CTX, protocol PROTO, to the
  file name FILE_NAME and the home directory HOME_DIR.  */
* file name FILE_NAME and the home directory HOME_DIR.  */
 gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx,
                                         gpgme_protocol_t proto,
                                         const char *file_name,
@@ -1122,41 +1006,14 @@ unsigned int gpgme_signers_count (const gpgme_ctx_t ctx);
 /* Return the SEQth signer's key in CTX.  */
 gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);
 
-/* Retrieve the signature status of signature IDX in CTX after a
-   successful verify operation in R_STAT (if non-null).  The creation
-   time stamp of the signature is returned in R_CREATED (if non-null).
-   The function returns a string containing the fingerprint.
-   Deprecated, use verify result directly.  */
-const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
-                                  _gpgme_sig_stat_t *r_stat,
-                                 time_t *r_created) _GPGME_DEPRECATED(0,4);
-
-/* Retrieve certain attributes of a signature.  IDX is the index
-   number of the signature after a successful verify operation.  WHAT
-   is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
-   one.  WHATIDX is to be passed as 0 for most attributes . */
-unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx,
-                                        _gpgme_attr_t what, int whatidx)
-     _GPGME_DEPRECATED(0,4);
-const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx,
-                                      _gpgme_attr_t what, int whatidx)
-     _GPGME_DEPRECATED(0,4);
-
-
-/* Get the key used to create signature IDX in CTX and return it in
-   R_KEY.  */
-gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key)
-     _GPGME_DEPRECATED(0,4);
-
-
 /* Clear all notation data from the context.  */
 void gpgme_sig_notation_clear (gpgme_ctx_t ctx);
 
 /* Add the human-readable notation data with name NAME and value VALUE
  to the context CTX, using the flags FLAGS.  If NAME is NULL, then
  VALUE should be a policy URL.  The flag
  GPGME_SIG_NOTATION_HUMAN_READABLE is forced to be true for notation
  data, and false for policy URLs.  */
* to the context CTX, using the flags FLAGS.  If NAME is NULL, then
* VALUE should be a policy URL.  The flag
* GPGME_SIG_NOTATION_HUMAN_READABLE is forced to be true for notation
* data, and false for policy URLs.  */
 gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
                                      const char *value,
                                      gpgme_sig_notation_flags_t flags);
@@ -1180,17 +1037,17 @@ const char *gpgme_get_sender (gpgme_ctx_t ctx);
 typedef gpgme_error_t (*gpgme_io_cb_t) (void *data, int fd);
 
 /* The type of a function that can register FNC as the I/O callback
  function for the file descriptor FD with direction dir (0: for writing,
  1: for reading).  FNC_DATA should be passed as DATA to FNC.  The
  function should return a TAG suitable for the corresponding
  gpgme_remove_io_cb_t, and an error value.  */
* function for the file descriptor FD with direction dir (0: for writing,
* 1: for reading).  FNC_DATA should be passed as DATA to FNC.  The
* function should return a TAG suitable for the corresponding
* gpgme_remove_io_cb_t, and an error value.  */
 typedef gpgme_error_t (*gpgme_register_io_cb_t) (void *data, int fd, int dir,
                                                 gpgme_io_cb_t fnc,
                                                 void *fnc_data, void **tag);
 
 /* The type of a function that can remove a previously registered I/O
  callback function given TAG as returned by the register
  function.  */
* callback function given TAG as returned by the register
* function.  */
 typedef void (*gpgme_remove_io_cb_t) (void *tag);
 
 typedef enum
@@ -1198,14 +1055,14 @@ typedef enum
     GPGME_EVENT_START,
     GPGME_EVENT_DONE,
     GPGME_EVENT_NEXT_KEY,
-    GPGME_EVENT_NEXT_TRUSTITEM
+    GPGME_EVENT_NEXT_TRUSTITEM  /* NOT USED.  */
   }
 gpgme_event_io_t;
 
 struct gpgme_io_event_done_data
 {
   /* A fatal IPC error or an operational error in state-less
-     protocols.  */
+   * protocols.  */
   gpgme_error_t err;
 
   /* An operational errors in session-based protocols.  */
@@ -1214,7 +1071,7 @@ struct gpgme_io_event_done_data
 typedef struct gpgme_io_event_done_data *gpgme_io_event_done_data_t;
 
 /* The type of a function that is called when a context finished an
  operation.  */
* operation.  */
 typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type,
                                     void *type_data);
 
@@ -1235,13 +1092,13 @@ void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
 void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
 
 /* Wrappers around the internal I/O functions for use with
  gpgme_passphrase_cb_t and gpgme_interact_cb_t.  */
* gpgme_passphrase_cb_t and gpgme_interact_cb_t.  */
 @API__SSIZE_T@ gpgme_io_read (int fd, void *buffer, size_t count);
 @API__SSIZE_T@ gpgme_io_write (int fd, const void *buffer, size_t count);
 int     gpgme_io_writen (int fd, const void *buffer, size_t count);
 
 /* Process the pending operation and, if HANG is non-zero, wait for
  the pending operation to finish.  */
* the pending operation to finish.  */
 gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang);
 
 gpgme_ctx_t gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
@@ -1260,21 +1117,21 @@ gpgme_error_t gpgme_cancel_async (gpgme_ctx_t ctx);
  */
 
 /* Read up to SIZE bytes into buffer BUFFER from the data object with
  the handle HANDLE.  Return the number of characters read, 0 on EOF
  and -1 on error.  If an error occurs, errno is set.  */
* the handle HANDLE.  Return the number of characters read, 0 on EOF
* and -1 on error.  If an error occurs, errno is set.  */
 typedef @API__SSIZE_T@ (*gpgme_data_read_cb_t) (void *handle, void *buffer,
                                         size_t size);
 
 /* Write up to SIZE bytes from buffer BUFFER to the data object with
  the handle HANDLE.  Return the number of characters written, or -1
  on error.  If an error occurs, errno is set.  */
* the handle HANDLE.  Return the number of characters written, or -1
* on error.  If an error occurs, errno is set.  */
 typedef @API__SSIZE_T@ (*gpgme_data_write_cb_t) (void *handle, const void *buffer,
                                          size_t size);
 
 /* Set the current position from where the next read or write starts
  in the data object with the handle HANDLE to OFFSET, relativ to
  WHENCE.  Returns the new offset in bytes from the beginning of the
  data object.  */
* in the data object with the handle HANDLE to OFFSET, relativ to
* WHENCE.  Returns the new offset in bytes from the beginning of the
* data object.  */
 typedef @API__OFF_T@ (*gpgme_data_seek_cb_t) (void *handle,
                                        @API__OFF_T@ offset, int whence);
 
@@ -1291,19 +1148,19 @@ struct gpgme_data_cbs
 typedef struct gpgme_data_cbs *gpgme_data_cbs_t;
 
 /* Read up to SIZE bytes into buffer BUFFER from the data object with
  the handle DH.  Return the number of characters read, 0 on EOF and
  -1 on error.  If an error occurs, errno is set.  */
* the handle DH.  Return the number of characters read, 0 on EOF and
* -1 on error.  If an error occurs, errno is set.  */
 @API__SSIZE_T@ gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size);
 
 /* Write up to SIZE bytes from buffer BUFFER to the data object with
  the handle DH.  Return the number of characters written, or -1 on
  error.  If an error occurs, errno is set.  */
* the handle DH.  Return the number of characters written, or -1 on
* error.  If an error occurs, errno is set.  */
 @API__SSIZE_T@ gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size);
 
 /* Set the current position from where the next read or write starts
  in the data object with the handle DH to OFFSET, relativ to WHENCE.
  Returns the new offset in bytes from the beginning of the data
  object.  */
* in the data object with the handle DH to OFFSET, relativ to WHENCE.
* Returns the new offset in bytes from the beginning of the data
* object.  */
 @API__OFF_T@ gpgme_data_seek (gpgme_data_t dh, @API__OFF_T@ offset, int whence);
 
 /* Create a new data buffer and return it in R_DH.  */
@@ -1313,19 +1170,19 @@ gpgme_error_t gpgme_data_new (gpgme_data_t *r_dh);
 void gpgme_data_release (gpgme_data_t dh);
 
 /* Create a new data buffer filled with SIZE bytes starting from
  BUFFER.  If COPY is zero, copying is delayed until necessary, and
  the data is taken from the original location when needed.  */
* BUFFER.  If COPY is zero, copying is delayed until necessary, and
* the data is taken from the original location when needed.  */
 gpgme_error_t gpgme_data_new_from_mem (gpgme_data_t *r_dh,
                                       const char *buffer, size_t size,
                                       int copy);
 
 /* Destroy the data buffer DH and return a pointer to its content.
  The memory has be to released with gpgme_free() by the user.  It's
  size is returned in R_LEN.  */
* The memory has be to released with gpgme_free() by the user.  It's
* size is returned in R_LEN.  */
 char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len);
 
 /* Release the memory returned by gpgme_data_release_and_get_mem() and
  some other functions.  */
* some other functions.  */
 void gpgme_free (void *buffer);
 
 gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
@@ -1335,6 +1192,8 @@ gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
 gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd);
 
 gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream);
+gpgme_error_t gpgme_data_new_from_estream (gpgme_data_t *r_dh,
+                                           gpgrt_stream_t stream);
 
 /* Return the encoding attribute of the data buffer DH */
 gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh);
@@ -1344,11 +1203,11 @@ gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh,
                                       gpgme_data_encoding_t enc);
 
 /* Get the file name associated with the data object with handle DH, or
  NULL if there is none.  */
* NULL if there is none.  */
 char *gpgme_data_get_file_name (gpgme_data_t dh);
 
 /* Set the file name associated with the data object with handle DH to
  FILE_NAME.  */
* FILE_NAME.  */
 gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh,
                                        const char *file_name);
 
@@ -1360,32 +1219,22 @@ gpg_error_t gpgme_data_set_flag (gpgme_data_t dh,
 gpgme_data_type_t gpgme_data_identify (gpgme_data_t dh, int reserved);
 
 
-/* Create a new data buffer which retrieves the data from the callback
-   function READ_CB.  Deprecated, please use gpgme_data_new_from_cbs
-   instead.  */
-gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
-                                          int (*read_cb) (void*,char *,
-                                                          size_t,size_t*),
-                                          void *read_cb_value)
-     _GPGME_DEPRECATED(0,4);
-
 /* Create a new data buffer filled with the content of file FNAME.
  COPY must be non-zero.  For delayed read, please use
  gpgme_data_new_from_fd or gpgme_data_new_from_stream instead.  */
* COPY must be non-zero.  For delayed read, please use
* gpgme_data_new_from_fd or gpgme_data_new_from_stream instead.  */
 gpgme_error_t gpgme_data_new_from_file (gpgme_data_t *r_dh,
                                        const char *fname,
                                        int copy);
 
 /* Create a new data buffer filled with LENGTH bytes starting from
  OFFSET within the file FNAME or stream FP (exactly one must be
  non-zero).  */
* OFFSET within the file FNAME or stream FP (exactly one must be
* non-zero).  */
 gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh,
                                            const char *fname, FILE *fp,
                                            @API__OFF_T@ offset, size_t length);
 
-/* Reset the read pointer in DH.  Deprecated, please use
-   gpgme_data_seek instead.  */
-gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED(0,4);
+/* Convenience function to do a gpgme_data_seek (dh, 0, SEEK_SET).  */
+gpgme_error_t gpgme_data_rewind (gpgme_data_t dh);
 
 
 \f
@@ -1394,7 +1243,7 @@ gpgme_error_t gpgme_data_rewind (gpgme_data_t dh) _GPGME_DEPRECATED(0,4);
  */
 
 /* Get the key with the fingerprint FPR from the crypto backend.  If
  SECRET is true, get the secret key.  */
* SECRET is true, get the secret key.  */
 gpgme_error_t gpgme_get_key (gpgme_ctx_t ctx, const char *fpr,
                             gpgme_key_t *r_key, int secret);
 
@@ -1405,50 +1254,19 @@ gpgme_error_t gpgme_key_from_uid (gpgme_key_t *key, const char *name);
 void gpgme_key_ref (gpgme_key_t key);
 
 /* Release a reference to KEY.  If this was the last one the key is
  destroyed.  */
* destroyed.  */
 void gpgme_key_unref (gpgme_key_t key);
 void gpgme_key_release (gpgme_key_t key);
 
-/* Return the value of the attribute WHAT of KEY, which has to be
-   representable by a string.  IDX specifies the sub key or user ID
-   for attributes related to sub keys or user IDs.  Deprecated, use
-   key structure directly instead. */
-const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
-                                      const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
-/* Return the value of the attribute WHAT of KEY, which has to be
-   representable by an unsigned integer.  IDX specifies the sub key or
-   user ID for attributes related to sub keys or user IDs.
-   Deprecated, use key structure directly instead.  */
-unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
-                                       const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
-/* Return the value of the attribute WHAT of a signature on user ID
-   UID_IDX in KEY, which has to be representable by a string.  IDX
-   specifies the signature.  Deprecated, use key structure directly
-   instead.  */
-const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
-                                          _gpgme_attr_t what,
-                                          const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
-/* Return the value of the attribute WHAT of a signature on user ID
-   UID_IDX in KEY, which has to be representable by an unsigned
-   integer string.  IDX specifies the signature.  Deprecated, use key
-   structure directly instead.  */
-unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx,
-                                           _gpgme_attr_t what,
-                                           const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
 
 \f
 /*
  * Encryption.
  */
 
+/* An object to return results from an encryption operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_encrypt_result
 {
   /* The list of invalid recipients.  */
@@ -1467,22 +1285,37 @@ typedef enum
     GPGME_ENCRYPT_PREPARE = 4,
     GPGME_ENCRYPT_EXPECT_SIGN = 8,
     GPGME_ENCRYPT_NO_COMPRESS = 16,
-    GPGME_ENCRYPT_SYMMETRIC = 32
+    GPGME_ENCRYPT_SYMMETRIC = 32,
+    GPGME_ENCRYPT_THROW_KEYIDS = 64,
+    GPGME_ENCRYPT_WRAP = 128,
+    GPGME_ENCRYPT_WANT_ADDRESS = 256
   }
 gpgme_encrypt_flags_t;
 
 /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
  store the resulting ciphertext in CIPHER.  */
* store the resulting ciphertext in CIPHER.  */
 gpgme_error_t gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
                                      gpgme_encrypt_flags_t flags,
-                                     gpgme_data_t plain, gpgme_data_t cipher);
+                                     gpgme_data_t plain,
+                                      gpgme_data_t cipher);
 gpgme_error_t gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[],
                                gpgme_encrypt_flags_t flags,
-                               gpgme_data_t plain, gpgme_data_t cipher);
+                               gpgme_data_t plain,
+                                gpgme_data_t cipher);
+gpgme_error_t gpgme_op_encrypt_ext_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
+                                          const char *recpstring,
+                                          gpgme_encrypt_flags_t flags,
+                                          gpgme_data_t plain,
+                                          gpgme_data_t cipher);
+gpgme_error_t gpgme_op_encrypt_ext (gpgme_ctx_t ctx, gpgme_key_t recp[],
+                                    const char *recpstring,
+                                    gpgme_encrypt_flags_t flags,
+                                    gpgme_data_t plain,
+                                    gpgme_data_t cipher);
 
 /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
  store the resulting ciphertext in CIPHER.  Also sign the ciphertext
  with the signers in CTX.  */
* store the resulting ciphertext in CIPHER.  Also sign the ciphertext
* with the signers in CTX.  */
 gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx,
                                           gpgme_key_t recp[],
                                           gpgme_encrypt_flags_t flags,
@@ -1490,13 +1323,28 @@ gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx,
                                           gpgme_data_t cipher);
 gpgme_error_t gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[],
                                     gpgme_encrypt_flags_t flags,
-                                    gpgme_data_t plain, gpgme_data_t cipher);
+                                    gpgme_data_t plain,
+                                     gpgme_data_t cipher);
+gpgme_error_t gpgme_op_encrypt_sign_ext_start (gpgme_ctx_t ctx,
+                                               gpgme_key_t recp[],
+                                               const char *recpstring,
+                                               gpgme_encrypt_flags_t flags,
+                                               gpgme_data_t plain,
+                                               gpgme_data_t cipher);
+gpgme_error_t gpgme_op_encrypt_sign_ext (gpgme_ctx_t ctx, gpgme_key_t recp[],
+                                         const char *recpstring,
+                                         gpgme_encrypt_flags_t flags,
+                                         gpgme_data_t plain,
+                                         gpgme_data_t cipher);
 
 \f
 /*
  * Decryption.
  */
 
+/* An object to hold information about a recipient.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_recipient
 {
   struct _gpgme_recipient *next;
@@ -1515,6 +1363,10 @@ struct _gpgme_recipient
 };
 typedef struct _gpgme_recipient *gpgme_recipient_t;
 
+
+/* An object to return results from a decryption operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_decrypt_result
 {
   char *unsupported_algorithm;
@@ -1522,44 +1374,86 @@ struct _gpgme_op_decrypt_result
   /* Key should not have been used for encryption.  */
   unsigned int wrong_key_usage : 1;
 
+  /* True if the message was encrypted in compliance to the de-vs
+   * mode.  */
+  unsigned int is_de_vs : 1;
+
+  /* The message claims that the content is a MIME object.  */
+  unsigned int is_mime : 1;
+
+  /* The message was made by a legacy algorithm without any integrity
+   * protection.  This might be an old but legitimate message. */
+  unsigned int legacy_cipher_nomdc : 1;
+
   /* Internal to GPGME, do not use.  */
-  int _unused : 31;
+  int _unused : 28;
 
   gpgme_recipient_t recipients;
 
   /* The original file name of the plaintext message, if
-     available.  */
+   * available.  */
   char *file_name;
 
   /* A textual representation of the session key used to decrypt the
    * message, if available */
   char *session_key;
+
+  /* A string with the symmetric encryption algorithm and mode using
+   * the format "<algo>.<mode>".  */
+  char *symkey_algo;
 };
 typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t;
 
+
 /* Retrieve a pointer to the result of the decrypt operation.  */
 gpgme_decrypt_result_t gpgme_op_decrypt_result (gpgme_ctx_t ctx);
 
+
+/* The valid decryption flags.  */
+typedef enum
+  {
+    GPGME_DECRYPT_VERIFY = 1,
+    GPGME_DECRYPT_UNWRAP = 128
+  }
+gpgme_decrypt_flags_t;
+
+
 /* Decrypt ciphertext CIPHER within CTX and store the resulting
  plaintext in PLAIN.  */
* plaintext in PLAIN.  */
 gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
                                      gpgme_data_t plain);
 gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx,
                                gpgme_data_t cipher, gpgme_data_t plain);
 
 /* Decrypt ciphertext CIPHER and make a signature verification within
  CTX and store the resulting plaintext in PLAIN.  */
* CTX and store the resulting plaintext in PLAIN.  */
 gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx,
                                             gpgme_data_t cipher,
                                             gpgme_data_t plain);
 gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher,
                                       gpgme_data_t plain);
 
-\f
+/* Decrypt ciphertext CIPHER within CTX and store the resulting
+ * plaintext in PLAIN.  With the flag GPGME_DECRYPT_VERIFY also do a
+ * signature verification pn the plaintext.  */
+gpgme_error_t gpgme_op_decrypt_ext_start (gpgme_ctx_t ctx,
+                                          gpgme_decrypt_flags_t flags,
+                                          gpgme_data_t cipher,
+                                          gpgme_data_t plain);
+gpgme_error_t gpgme_op_decrypt_ext (gpgme_ctx_t ctx,
+                                    gpgme_decrypt_flags_t flags,
+                                    gpgme_data_t cipher,
+                                    gpgme_data_t plain);
+
+
+\f
 /*
  * Signing.
  */
 
+/* An object with signatures data.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_new_signature
 {
   struct _gpgme_new_signature *next;
@@ -1574,7 +1468,7 @@ struct _gpgme_new_signature
   gpgme_hash_algo_t hash_algo;
 
   /* Internal to GPGME, do not use.  Must be set to the same value as
-     CLASS below.  */
+   * CLASS below.  */
   unsigned long _obsolete_class;
 
   /* Signature creation time.  */
@@ -1583,10 +1477,10 @@ struct _gpgme_new_signature
   /* The fingerprint of the signature.  */
   char *fpr;
 
-#ifdef __cplusplus
+  /* Deprecated; use SIG_CLASS instead.  */
+#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
   unsigned int _obsolete_class_2;
 #else
-  /* Must be set to SIG_CLASS below.  */
   unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
 #endif
 
@@ -1595,6 +1489,10 @@ struct _gpgme_new_signature
 };
 typedef struct _gpgme_new_signature *gpgme_new_signature_t;
 
+
+/* An object to return results from a signing operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_sign_result
 {
   /* The list of invalid signers.  */
@@ -1603,6 +1501,7 @@ struct _gpgme_op_sign_result
 };
 typedef struct _gpgme_op_sign_result *gpgme_sign_result_t;
 
+
 /* Retrieve a pointer to the result of the signing operation.  */
 gpgme_sign_result_t gpgme_op_sign_result (gpgme_ctx_t ctx);
 
@@ -1638,6 +1537,9 @@ typedef enum
 gpgme_sigsum_t;
 
 
+/* An object to hold the verification status of a signature.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_signature
 {
   struct _gpgme_signature *next;
@@ -1669,8 +1571,11 @@ struct _gpgme_signature
   /* Validity has been verified using the chain model. */
   unsigned int chain_model : 1;
 
+  /* True if the signature is in compliance to the de-vs mode.  */
+  unsigned int is_de_vs : 1;
+
   /* Internal to GPGME, do not use.  */
-  int _unused : 28;
+  int _unused : 27;
 
   gpgme_validity_t validity;
   gpgme_error_t validity_reason;
@@ -1690,16 +1595,28 @@ struct _gpgme_signature
 };
 typedef struct _gpgme_signature *gpgme_signature_t;
 
+
+/* An object to return the results of a verify operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_verify_result
 {
   gpgme_signature_t signatures;
 
-  /* The original file name of the plaintext message, if
-     available.  */
+  /* The original file name of the plaintext message, if available.
+   * Warning: This information is not covered by the signature.  */
   char *file_name;
+
+  /* The message claims that the content is a MIME object.  */
+  /* Warning: This flag is not covered by the signature.  */
+  unsigned int is_mime : 1;
+
+  /* Internal to GPGME; do not use.  */
+  unsigned int _unused : 31;
 };
 typedef struct _gpgme_op_verify_result *gpgme_verify_result_t;
 
+
 /* Retrieve a pointer to the result of the verify operation.  */
 gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx);
 
@@ -1723,6 +1640,9 @@ gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig,
 #define GPGME_IMPORT_SECRET    16  /* The key contained a secret key.  */
 
 
+/* An object to hold results for one imported key.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_import_status
 {
   struct _gpgme_import_status *next;
@@ -1741,7 +1661,10 @@ struct _gpgme_import_status
 };
 typedef struct _gpgme_import_status *gpgme_import_status_t;
 
-/* Import result object.  */
+
+/* Import result object.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_import_result
 {
   /* Number of considered keys.  */
@@ -1788,17 +1711,19 @@ struct _gpgme_op_import_result
 
   /* List of keys for which an import was attempted.  */
   gpgme_import_status_t imports;
+
+  /* Number of v3 keys skipped.  */
+  int skipped_v3_keys;
 };
 typedef struct _gpgme_op_import_result *gpgme_import_result_t;
 
+
 /* Retrieve a pointer to the result of the import operation.  */
 gpgme_import_result_t gpgme_op_import_result (gpgme_ctx_t ctx);
 
 /* Import the key in KEYDATA into the keyring.  */
 gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata);
 gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata);
-gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata,
-                                  int *nr) _GPGME_DEPRECATED(0,4);
 
 /* Import the keys from the array KEYS into the keyring.  */
 gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t keys[]);
@@ -1848,7 +1773,12 @@ gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t ctx,
 #define GPGME_CREATE_WANTPUB    (1 << 10) /* Return the public key.    */
 #define GPGME_CREATE_WANTSEC    (1 << 11) /* Return the secret key.    */
 #define GPGME_CREATE_FORCE      (1 << 12) /* Force creation.           */
+#define GPGME_CREATE_NOEXPIRE   (1 << 13) /* Create w/o expiration.    */
+
 
+/* An object to return result from a key generation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_genkey_result
 {
   /* A primary key was generated.  */
@@ -1876,9 +1806,10 @@ struct _gpgme_op_genkey_result
 };
 typedef struct _gpgme_op_genkey_result *gpgme_genkey_result_t;
 
+
 /* Generate a new keypair and add it to the keyring.  PUBKEY and
  SECKEY should be null for now.  PARMS specifies what keys should be
  generated.  */
* SECKEY should be null for now.  PARMS specifies what keys should be
* generated.  */
 gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms,
                                     gpgme_data_t pubkey, gpgme_data_t seckey);
 gpgme_error_t gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms,
@@ -1929,6 +1860,13 @@ gpgme_error_t gpgme_op_revuid       (gpgme_ctx_t ctx,
                                      gpgme_key_t key, const char *userid,
                                      unsigned int reserved);
 
+/* Set a flag on the USERID of KEY.  See the manual for supported flags.  */
+gpgme_error_t gpgme_op_set_uid_flag_start (gpgme_ctx_t ctx,
+                                           gpgme_key_t key, const char *userid,
+                                           const char *name, const char *value);
+gpgme_error_t gpgme_op_set_uid_flag       (gpgme_ctx_t ctx,
+                                           gpgme_key_t key, const char *userid,
+                                           const char *name, const char *value);
 
 
 /* Retrieve a pointer to the result of a genkey, createkey, or
@@ -1937,12 +1875,21 @@ gpgme_genkey_result_t gpgme_op_genkey_result (gpgme_ctx_t ctx);
 
 
 /* Delete KEY from the keyring.  If ALLOW_SECRET is non-zero, secret
  keys are also deleted.  */
* keys are also deleted.  */
 gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key,
                                     int allow_secret);
 gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key,
                               int allow_secret);
 
+/* Flags for the key delete functions.  */
+#define GPGME_DELETE_ALLOW_SECRET (1 << 0)  /* Also delete secret key.     */
+#define GPGME_DELETE_FORCE        (1 << 1)  /* Do not ask user to confirm.  */
+
+gpgme_error_t gpgme_op_delete_ext_start (gpgme_ctx_t ctx, const gpgme_key_t key,
+                                        unsigned int flags);
+gpgme_error_t gpgme_op_delete_ext (gpgme_ctx_t ctx, const gpgme_key_t key,
+                                  unsigned int flags);
+
 \f
 /*
  * Key signing interface
@@ -1989,21 +1936,6 @@ gpgme_error_t gpgme_op_interact (gpgme_ctx_t ctx, gpgme_key_t key,
                                  void *fnc_value,
                                  gpgme_data_t out);
 
-gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
-                                  gpgme_edit_cb_t fnc, void *fnc_value,
-                                  gpgme_data_t out) _GPGME_DEPRECATED(1,7);
-gpgme_error_t gpgme_op_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
-                                  gpgme_edit_cb_t fnc, void *fnc_value,
-                                  gpgme_data_t out) _GPGME_DEPRECATED(1,7);
-gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
-                                       gpgme_edit_cb_t fnc, void *fnc_value,
-                                       gpgme_data_t out)
-                                        _GPGME_DEPRECATED(1,7);
-gpgme_error_t gpgme_op_card_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
-                                       gpgme_edit_cb_t fnc, void *fnc_value,
-                                       gpgme_data_t out)
-                                        _GPGME_DEPRECATED(1,7);
-
 
 /* Set the Tofu policy of KEY to POLCIY.  */
 gpgme_error_t gpgme_op_tofu_policy_start (gpgme_ctx_t ctx,
@@ -2020,6 +1952,9 @@ gpgme_error_t gpgme_op_tofu_policy       (gpgme_ctx_t ctx,
  * Key listing
  */
 
+/* An object to return results from a key listing operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_keylist_result
 {
   unsigned int truncated : 1;
@@ -2033,22 +1968,33 @@ typedef struct _gpgme_op_keylist_result *gpgme_keylist_result_t;
 gpgme_keylist_result_t gpgme_op_keylist_result (gpgme_ctx_t ctx);
 
 /* Start a keylist operation within CTX, searching for keys which
  match PATTERN.  If SECRET_ONLY is true, only secret keys are
  returned.  */
* match PATTERN.  If SECRET_ONLY is true, only secret keys are
* returned.  */
 gpgme_error_t gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern,
                                      int secret_only);
 gpgme_error_t gpgme_op_keylist_ext_start (gpgme_ctx_t ctx,
                                          const char *pattern[],
                                          int secret_only, int reserved);
 
+/* List the keys contained in DATA.  */
+gpgme_error_t gpgme_op_keylist_from_data_start (gpgme_ctx_t ctx,
+                                                gpgme_data_t data,
+                                                int reserved);
+
 /* Return the next key from the keylist in R_KEY.  */
 gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key);
 
 /* Terminate a pending keylist operation within CTX.  */
 gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx);
 
+
+\f
+/*
+ * Protecting keys
+ */
+
 /* Change the passphrase for KEY.  FLAGS is reserved for future use
  and must be passed as 0.  */
* and must be passed as 0.  */
 gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t ctx, gpgme_key_t key,
                                      unsigned int flags);
 gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key,
@@ -2057,82 +2003,34 @@ gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key,
 
 \f
 /*
- * Trust items and operations.
+ * Trust items and operations.  DO NOT USE.
+ * Note: This does not work because the experimental support in the
+ * GnuPG engine has been removed a very long time; for API and ABI
+ * compatibilty we keep the functions but let them return an error.
+ * See https://dev.gnupg.org/T4834
  */
-
 struct _gpgme_trust_item
 {
-  /* Internal to GPGME, do not use.  */
   unsigned int _refs;
-
-  /* The key ID to which the trust item belongs.  */
   char *keyid;
-
-  /* Internal to GPGME, do not use.  */
   char _keyid[16 + 1];
-
-  /* The type of the trust item, 1 refers to a key, 2 to a user ID.  */
   int type;
-
-  /* The trust level.  */
   int level;
-
-  /* The owner trust if TYPE is 1.  */
   char *owner_trust;
-
-  /* Internal to GPGME, do not use.  */
   char _owner_trust[2];
-
-  /* The calculated validity.  */
   char *validity;
-
-  /* Internal to GPGME, do not use.  */
   char _validity[2];
-
-  /* The user name if TYPE is 2.  */
   char *name;
 };
 typedef struct _gpgme_trust_item *gpgme_trust_item_t;
-
-/* Start a trustlist operation within CTX, searching for trust items
-   which match PATTERN.  */
 gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx,
                                        const char *pattern, int max_level);
-
-/* Return the next trust item from the trustlist in R_ITEM.  */
 gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx,
                                       gpgme_trust_item_t *r_item);
-
-/* Terminate a pending trustlist operation within CTX.  */
 gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx);
-
-/* Acquire a reference to ITEM.  */
 void gpgme_trust_item_ref (gpgme_trust_item_t item);
-
-/* Release a reference to ITEM.  If this was the last one the trust
-   item is destroyed.  */
 void gpgme_trust_item_unref (gpgme_trust_item_t item);
 
-/* Release the trust item ITEM.  Deprecated, use
-   gpgme_trust_item_unref.  */
-void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED(0,4);
-
-/* Return the value of the attribute WHAT of ITEM, which has to be
-   representable by a string.  Deprecated, use trust item structure
-   directly.  */
-const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
-                                             _gpgme_attr_t what,
-                                             const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
-/* Return the value of the attribute WHAT of KEY, which has to be
-   representable by an integer.  IDX specifies a running index if the
-   attribute appears more than once in the key.  Deprecated, use trust
-   item structure directly.  */
-int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
-                                  const void *reserved, int idx)
-     _GPGME_DEPRECATED(0,4);
-
 
 \f
 /*
@@ -2156,11 +2054,12 @@ gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
 /* Flags for the spawn operations.  */
 #define GPGME_SPAWN_DETACHED      1
 #define GPGME_SPAWN_ALLOW_SET_FG  2
+#define GPGME_SPAWN_SHOW_WINDOW   4
 
 
 /* Run the command FILE with the arguments in ARGV.  Connect stdin to
  DATAIN, stdout to DATAOUT, and STDERR to DATAERR.  If one the data
  streams is NULL, connect to /dev/null instead.  */
* DATAIN, stdout to DATAOUT, and STDERR to DATAERR.  If one the data
* streams is NULL, connect to /dev/null instead.  */
 gpgme_error_t gpgme_op_spawn_start (gpgme_ctx_t ctx,
                                     const char *file, const char *argv[],
                                     gpgme_data_t datain,
@@ -2176,6 +2075,7 @@ gpgme_error_t gpgme_op_spawn (gpgme_ctx_t ctx,
 /*
  * Low-level Assuan protocol access.
  */
+
 typedef gpgme_error_t (*gpgme_assuan_data_cb_t)
      (void *opaque, const void *data, size_t datalen);
 
@@ -2187,7 +2087,7 @@ typedef gpgme_error_t (*gpgme_assuan_status_cb_t)
      (void *opaque, const char *status, const char *args);
 
 /* Send the Assuan COMMAND and return results via the callbacks.
  Asynchronous variant. */
* Asynchronous variant. */
 gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
                                               const char *command,
                                               gpgme_assuan_data_cb_t data_cb,
@@ -2198,7 +2098,7 @@ gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
                                               void *stat_cb_value);
 
 /* Send the Assuan COMMAND and return results via the callbacks.
  Synchronous variant. */
* Synchronous variant. */
 gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
                                            const char *command,
                                            gpgme_assuan_data_cb_t data_cb,
@@ -2209,35 +2109,14 @@ gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
                                            void *stat_cb_value,
                                            gpgme_error_t *op_err);
 
-/* Compat.  */
-struct _gpgme_op_assuan_result
-{
-  /* Deprecated.  Use the second value in a DONE event or the
-     synchronous variant gpgme_op_assuan_transact_ext.  */
-  gpgme_error_t err _GPGME_DEPRECATED_OUTSIDE_GPGME(1,2);
-};
-typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
-
-
-/* Return the result of the last Assuan command. */
-gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx)
-  _GPGME_DEPRECATED(1,2);
-
-gpgme_error_t
-gpgme_op_assuan_transact (gpgme_ctx_t ctx,
-                             const char *command,
-                             gpgme_assuan_data_cb_t data_cb,
-                             void *data_cb_value,
-                             gpgme_assuan_inquire_cb_t inq_cb,
-                             void *inq_cb_value,
-                             gpgme_assuan_status_cb_t status_cb,
-                          void *status_cb_value) _GPGME_DEPRECATED(1,2);
-
 \f
 /*
  * Crypto container support.
  */
 
+/* An object to return results from a VFS mount operation.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 struct _gpgme_op_vfs_mount_result
 {
   char *mount_dir;
@@ -2247,8 +2126,8 @@ typedef struct _gpgme_op_vfs_mount_result *gpgme_vfs_mount_result_t;
 gpgme_vfs_mount_result_t gpgme_op_vfs_mount_result (gpgme_ctx_t ctx);
 
 /* The container is automatically unmounted when the context is reset
  or destroyed.  Transmission errors are returned directly,
  operational errors are returned in OP_ERR.  */
* or destroyed.  Transmission errors are returned directly,
* operational errors are returned in OP_ERR.  */
 gpgme_error_t gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
                                  const char *mount_dir, unsigned int flags,
                                  gpgme_error_t *op_err);
@@ -2263,8 +2142,8 @@ gpgme_error_t gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
  */
 
 /* The expert level at which a configuration option or group of
  options should be displayed.  See the gpgconf(1) documentation for
  more details.  */
* options should be displayed.  See the gpgconf(1) documentation for
* more details.  */
 typedef enum
   {
     GPGME_CONF_BASIC = 0,
@@ -2277,7 +2156,7 @@ gpgme_conf_level_t;
 
 
 /* The data type of a configuration option argument.  See the gpgconf(1)
  documentation for more details.  */
* documentation for more details.  */
 typedef enum
   {
     /* Basic types.  */
@@ -2301,7 +2180,7 @@ gpgme_conf_type_t;
 
 
 /* This represents a single argument for a configuration option.
  Which of the members of value is used depends on the ALT_TYPE.  */
* Which of the members of value is used depends on the ALT_TYPE.  */
 typedef struct gpgme_conf_arg
 {
   struct gpgme_conf_arg *next;
@@ -2318,7 +2197,7 @@ typedef struct gpgme_conf_arg
 
 
 /* The flags of a configuration option.  See the gpgconf
  documentation for details.  */
* documentation for details.  */
 #define GPGME_CONF_GROUP       (1 << 0)
 #define GPGME_CONF_OPTIONAL    (1 << 1)
 #define GPGME_CONF_LIST                (1 << 2)
@@ -2330,7 +2209,7 @@ typedef struct gpgme_conf_arg
 
 
 /* The representation of a single configuration option.  See the
  gpg-conf documentation for details.  */
* gpg-conf documentation for details.  */
 typedef struct gpgme_conf_opt
 {
   struct gpgme_conf_opt *next;
@@ -2375,7 +2254,7 @@ typedef struct gpgme_conf_opt
 
 
 /* The representation of a component that can be configured.  See the
  gpg-conf documentation for details.  */
* gpg-conf documentation for details.  */
 typedef struct gpgme_conf_comp
 {
   struct gpgme_conf_comp *next;
@@ -2398,9 +2277,9 @@ typedef struct gpgme_conf_comp
 
 
 /* Allocate a new gpgme_conf_arg_t.  If VALUE is NULL, a "no arg
  default" is prepared.  If type is a string type, VALUE should point
  to the string.  Else, it should point to an unsigned or signed
  integer respectively.  */
* default" is prepared.  If type is a string type, VALUE should point
* to the string.  Else, it should point to an unsigned or signed
* integer respectively.  */
 gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
                                  gpgme_conf_type_t type, const void *value);
 
@@ -2408,9 +2287,10 @@ gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
 void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
 
 /* Register a change for the value of OPT to ARG.  If RESET is 1 (do
-   not use any values but 0 or 1), ARG is ignored and the option is
-   not changed (reverting a previous change).  Otherwise, if ARG is
-   NULL, the option is cleared or reset to its default.  */
+ * not use any values but 0 or 1), ARG is ignored and the option is
+ * not changed (reverting a previous change).  Otherwise, if ARG is
+ * NULL, the option is cleared or reset to its default. The change
+ * is done with gpgconf's --runtime option to immediately take effect. */
 gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
                                     gpgme_conf_arg_t arg);
 
@@ -2424,8 +2304,14 @@ gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
    follow chained components!  */
 gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
 
+/* Retrieve the configured directory.  */
+gpgme_error_t gpgme_op_conf_dir(gpgme_ctx_t ctx, const char *what,
+                               char **result);
+
 
-/* Information about software versions.  */
+/* Information about software versions.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
 typedef struct _gpgme_op_query_swdb_result
 {
   /* RFU */
@@ -2495,16 +2381,17 @@ gpgme_query_swdb_result_t gpgme_op_query_swdb_result (gpgme_ctx_t ctx);
 int gpgme_set_global_flag (const char *name, const char *value);
 
 /* Check that the library fulfills the version requirement.  Note:
  This is here only for the case where a user takes a pointer from
  the old version of this function.  The new version and macro for
  run-time checks are below.  */
* This is here only for the case where a user takes a pointer from
* the old version of this function.  The new version and macro for
* run-time checks are below.  */
 const char *gpgme_check_version (const char *req_version);
 
-/* Check that the library fulfills the version requirement and check
-   for struct layout mismatch involving bitfields.  */
+/* Do not call this directly; use the macro below.  */
 const char *gpgme_check_version_internal (const char *req_version,
                                          size_t offset_sig_validity);
 
+/* Check that the library fulfills the version requirement and check
+ * for struct layout mismatch involving bitfields.  */
 #define gpgme_check_version(req_version)                               \
   gpgme_check_version_internal (req_version,                           \
                                offsetof (struct _gpgme_signature, validity))
@@ -2513,19 +2400,19 @@ const char *gpgme_check_version_internal (const char *req_version,
 const char *gpgme_get_dirinfo (const char *what);
 
 /* Get the information about the configured and installed engines.  A
  pointer to the first engine in the statically allocated linked list
  is returned in *INFO.  If an error occurs, it is returned.  The
  returned data is valid until the next gpgme_set_engine_info.  */
* pointer to the first engine in the statically allocated linked list
* is returned in *INFO.  If an error occurs, it is returned.  The
* returned data is valid until the next gpgme_set_engine_info.  */
 gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *engine_info);
 
 /* Set the default engine info for the protocol PROTO to the file name
  FILE_NAME and the home directory HOME_DIR.  */
* FILE_NAME and the home directory HOME_DIR.  */
 gpgme_error_t gpgme_set_engine_info (gpgme_protocol_t proto,
                                     const char *file_name,
                                     const char *home_dir);
 
 /* Verify that the engine implementing PROTO is installed and
  available.  */
* available.  */
 gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto);
 
 
@@ -2534,15 +2421,15 @@ void gpgme_result_ref (void *result);
 void gpgme_result_unref (void *result);
 
 /* Return a public key algorithm string (e.g. "rsa2048").  Caller must
  free using gpgme_free.  */
* free using gpgme_free.  */
 char *gpgme_pubkey_algo_string (gpgme_subkey_t subkey);
 
 /* Return a statically allocated string with the name of the public
  key algorithm ALGO, or NULL if that name is not known.  */
* key algorithm ALGO, or NULL if that name is not known.  */
 const char *gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo);
 
 /* Return a statically allocated string with the name of the hash
  algorithm ALGO, or NULL if that name is not known.  */
* algorithm ALGO, or NULL if that name is not known.  */
 const char *gpgme_hash_algo_name (gpgme_hash_algo_t algo);
 
 /* Return the addr-spec from a user id.  Caller must free the result
@@ -2552,8 +2439,319 @@ char *gpgme_addrspec_from_uid (const char *uid);
 
 \f
 /*
- * Deprecated types.
+ * Deprecated types, constants and functions.
  */
+
+/* The possible stati for gpgme_op_edit.  The use of that function and
+ * these status codes are deprecated in favor of gpgme_op_interact. */
+typedef enum
+  {
+    GPGME_STATUS_EOF = 0,
+    /* mkstatus processing starts here */
+    GPGME_STATUS_ENTER = 1,
+    GPGME_STATUS_LEAVE = 2,
+    GPGME_STATUS_ABORT = 3,
+
+    GPGME_STATUS_GOODSIG = 4,
+    GPGME_STATUS_BADSIG = 5,
+    GPGME_STATUS_ERRSIG = 6,
+
+    GPGME_STATUS_BADARMOR = 7,
+
+    GPGME_STATUS_RSA_OR_IDEA = 8,      /* (legacy) */
+    GPGME_STATUS_KEYEXPIRED = 9,
+    GPGME_STATUS_KEYREVOKED = 10,
+
+    GPGME_STATUS_TRUST_UNDEFINED = 11,
+    GPGME_STATUS_TRUST_NEVER = 12,
+    GPGME_STATUS_TRUST_MARGINAL = 13,
+    GPGME_STATUS_TRUST_FULLY = 14,
+    GPGME_STATUS_TRUST_ULTIMATE = 15,
+
+    GPGME_STATUS_SHM_INFO = 16,        /* (legacy) */
+    GPGME_STATUS_SHM_GET = 17,         /* (legacy) */
+    GPGME_STATUS_SHM_GET_BOOL = 18,    /* (legacy) */
+    GPGME_STATUS_SHM_GET_HIDDEN = 19,  /* (legacy) */
+
+    GPGME_STATUS_NEED_PASSPHRASE = 20,
+    GPGME_STATUS_VALIDSIG = 21,
+    GPGME_STATUS_SIG_ID = 22,
+    GPGME_STATUS_ENC_TO = 23,
+    GPGME_STATUS_NODATA = 24,
+    GPGME_STATUS_BAD_PASSPHRASE = 25,
+    GPGME_STATUS_NO_PUBKEY = 26,
+    GPGME_STATUS_NO_SECKEY = 27,
+    GPGME_STATUS_NEED_PASSPHRASE_SYM = 28,
+    GPGME_STATUS_DECRYPTION_FAILED = 29,
+    GPGME_STATUS_DECRYPTION_OKAY = 30,
+    GPGME_STATUS_MISSING_PASSPHRASE = 31,
+    GPGME_STATUS_GOOD_PASSPHRASE = 32,
+    GPGME_STATUS_GOODMDC = 33,
+    GPGME_STATUS_BADMDC = 34,
+    GPGME_STATUS_ERRMDC = 35,
+    GPGME_STATUS_IMPORTED = 36,
+    GPGME_STATUS_IMPORT_OK = 37,
+    GPGME_STATUS_IMPORT_PROBLEM = 38,
+    GPGME_STATUS_IMPORT_RES = 39,
+    GPGME_STATUS_FILE_START = 40,
+    GPGME_STATUS_FILE_DONE = 41,
+    GPGME_STATUS_FILE_ERROR = 42,
+
+    GPGME_STATUS_BEGIN_DECRYPTION = 43,
+    GPGME_STATUS_END_DECRYPTION = 44,
+    GPGME_STATUS_BEGIN_ENCRYPTION = 45,
+    GPGME_STATUS_END_ENCRYPTION = 46,
+
+    GPGME_STATUS_DELETE_PROBLEM = 47,
+    GPGME_STATUS_GET_BOOL = 48,
+    GPGME_STATUS_GET_LINE = 49,
+    GPGME_STATUS_GET_HIDDEN = 50,
+    GPGME_STATUS_GOT_IT = 51,
+    GPGME_STATUS_PROGRESS = 52,
+    GPGME_STATUS_SIG_CREATED = 53,
+    GPGME_STATUS_SESSION_KEY = 54,
+    GPGME_STATUS_NOTATION_NAME = 55,
+    GPGME_STATUS_NOTATION_DATA = 56,
+    GPGME_STATUS_POLICY_URL = 57,
+    GPGME_STATUS_BEGIN_STREAM = 58,    /* (legacy) */
+    GPGME_STATUS_END_STREAM = 59,      /* (legacy) */
+    GPGME_STATUS_KEY_CREATED = 60,
+    GPGME_STATUS_USERID_HINT = 61,
+    GPGME_STATUS_UNEXPECTED = 62,
+    GPGME_STATUS_INV_RECP = 63,
+    GPGME_STATUS_NO_RECP = 64,
+    GPGME_STATUS_ALREADY_SIGNED = 65,
+    GPGME_STATUS_SIGEXPIRED = 66,      /* (legacy) */
+    GPGME_STATUS_EXPSIG = 67,
+    GPGME_STATUS_EXPKEYSIG = 68,
+    GPGME_STATUS_TRUNCATED = 69,
+    GPGME_STATUS_ERROR = 70,
+    GPGME_STATUS_NEWSIG = 71,
+    GPGME_STATUS_REVKEYSIG = 72,
+    GPGME_STATUS_SIG_SUBPACKET = 73,
+    GPGME_STATUS_NEED_PASSPHRASE_PIN = 74,
+    GPGME_STATUS_SC_OP_FAILURE = 75,
+    GPGME_STATUS_SC_OP_SUCCESS = 76,
+    GPGME_STATUS_CARDCTRL = 77,
+    GPGME_STATUS_BACKUP_KEY_CREATED = 78,
+    GPGME_STATUS_PKA_TRUST_BAD = 79,
+    GPGME_STATUS_PKA_TRUST_GOOD = 80,
+    GPGME_STATUS_PLAINTEXT = 81,
+    GPGME_STATUS_INV_SGNR = 82,
+    GPGME_STATUS_NO_SGNR = 83,
+    GPGME_STATUS_SUCCESS = 84,
+    GPGME_STATUS_DECRYPTION_INFO = 85,
+    GPGME_STATUS_PLAINTEXT_LENGTH = 86,
+    GPGME_STATUS_MOUNTPOINT = 87,
+    GPGME_STATUS_PINENTRY_LAUNCHED = 88,
+    GPGME_STATUS_ATTRIBUTE = 89,
+    GPGME_STATUS_BEGIN_SIGNING = 90,
+    GPGME_STATUS_KEY_NOT_CREATED = 91,
+    GPGME_STATUS_INQUIRE_MAXLEN = 92,
+    GPGME_STATUS_FAILURE = 93,
+    GPGME_STATUS_KEY_CONSIDERED = 94,
+    GPGME_STATUS_TOFU_USER = 95,
+    GPGME_STATUS_TOFU_STATS = 96,
+    GPGME_STATUS_TOFU_STATS_LONG = 97,
+    GPGME_STATUS_NOTATION_FLAGS = 98,
+    GPGME_STATUS_DECRYPTION_COMPLIANCE_MODE = 99,
+    GPGME_STATUS_VERIFICATION_COMPLIANCE_MODE = 100
+  }
+gpgme_status_code_t;
+
+/* The callback type used by the deprecated functions gpgme_op_edit
+ * and gpgme_op_card_edit.  */
+typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque,
+                                         gpgme_status_code_t status,
+                                         const char *args, int fd);
+
+gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
+                                  gpgme_edit_cb_t fnc, void *fnc_value,
+                                  gpgme_data_t out) _GPGME_DEPRECATED(1,7);
+gpgme_error_t gpgme_op_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
+                                  gpgme_edit_cb_t fnc, void *fnc_value,
+                                  gpgme_data_t out) _GPGME_DEPRECATED(1,7);
+gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
+                                       gpgme_edit_cb_t fnc, void *fnc_value,
+                                       gpgme_data_t out)
+                                        _GPGME_DEPRECATED(1,7);
+gpgme_error_t gpgme_op_card_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
+                                       gpgme_edit_cb_t fnc, void *fnc_value,
+                                       gpgme_data_t out)
+                                        _GPGME_DEPRECATED(1,7);
+
+/* The possible signature stati.  Deprecated, use error value in sig
+ * status.  */
+typedef enum
+  {
+    GPGME_SIG_STAT_NONE  = 0,
+    GPGME_SIG_STAT_GOOD  = 1,
+    GPGME_SIG_STAT_BAD   = 2,
+    GPGME_SIG_STAT_NOKEY = 3,
+    GPGME_SIG_STAT_NOSIG = 4,
+    GPGME_SIG_STAT_ERROR = 5,
+    GPGME_SIG_STAT_DIFF  = 6,
+    GPGME_SIG_STAT_GOOD_EXP = 7,
+    GPGME_SIG_STAT_GOOD_EXPKEY = 8
+  }
+_gpgme_sig_stat_t;
+typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED(0,4);
+
+/* The available key and signature attributes.  Deprecated, use the
+ * individual result structures instead.  */
+typedef enum
+  {
+    GPGME_ATTR_KEYID        = 1,
+    GPGME_ATTR_FPR          = 2,
+    GPGME_ATTR_ALGO         = 3,
+    GPGME_ATTR_LEN          = 4,
+    GPGME_ATTR_CREATED      = 5,
+    GPGME_ATTR_EXPIRE       = 6,
+    GPGME_ATTR_OTRUST       = 7,
+    GPGME_ATTR_USERID       = 8,
+    GPGME_ATTR_NAME         = 9,
+    GPGME_ATTR_EMAIL        = 10,
+    GPGME_ATTR_COMMENT      = 11,
+    GPGME_ATTR_VALIDITY     = 12,
+    GPGME_ATTR_LEVEL        = 13,
+    GPGME_ATTR_TYPE         = 14,
+    GPGME_ATTR_IS_SECRET    = 15,
+    GPGME_ATTR_KEY_REVOKED  = 16,
+    GPGME_ATTR_KEY_INVALID  = 17,
+    GPGME_ATTR_UID_REVOKED  = 18,
+    GPGME_ATTR_UID_INVALID  = 19,
+    GPGME_ATTR_KEY_CAPS     = 20,
+    GPGME_ATTR_CAN_ENCRYPT  = 21,
+    GPGME_ATTR_CAN_SIGN     = 22,
+    GPGME_ATTR_CAN_CERTIFY  = 23,
+    GPGME_ATTR_KEY_EXPIRED  = 24,
+    GPGME_ATTR_KEY_DISABLED = 25,
+    GPGME_ATTR_SERIAL       = 26,
+    GPGME_ATTR_ISSUER       = 27,
+    GPGME_ATTR_CHAINID      = 28,
+    GPGME_ATTR_SIG_STATUS   = 29,
+    GPGME_ATTR_ERRTOK       = 30,
+    GPGME_ATTR_SIG_SUMMARY  = 31,
+    GPGME_ATTR_SIG_CLASS    = 32
+  }
+_gpgme_attr_t;
+typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED(0,4);
+
+/* Retrieve the signature status of signature IDX in CTX after a
+ * successful verify operation in R_STAT (if non-null).  The creation
+ * time stamp of the signature is returned in R_CREATED (if non-null).
+ * The function returns a string containing the fingerprint.
+ * Deprecated, use verify result directly.  */
+const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
+                                  _gpgme_sig_stat_t *r_stat,
+                                 time_t *r_created) _GPGME_DEPRECATED(0,4);
+
+/* Retrieve certain attributes of a signature.  IDX is the index
+ * number of the signature after a successful verify operation.  WHAT
+ * is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
+ * one.  WHATIDX is to be passed as 0 for most attributes . */
+unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx,
+                                        _gpgme_attr_t what, int whatidx)
+     _GPGME_DEPRECATED(0,4);
+const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx,
+                                      _gpgme_attr_t what, int whatidx)
+     _GPGME_DEPRECATED(0,4);
+
+
+/* Get the key used to create signature IDX in CTX and return it in
+ * R_KEY.  */
+gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key)
+     _GPGME_DEPRECATED(0,4);
+
+/* Create a new data buffer which retrieves the data from the callback
+ * function READ_CB.  Deprecated, please use gpgme_data_new_from_cbs
+ * instead.  */
+gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
+                                          int (*read_cb) (void*,char *,
+                                                          size_t,size_t*),
+                                          void *read_cb_value)
+     _GPGME_DEPRECATED(0,4);
+
+/* Return the value of the attribute WHAT of KEY, which has to be
+ * representable by a string.  IDX specifies the sub key or user ID
+ * for attributes related to sub keys or user IDs.  Deprecated, use
+ * key structure directly instead. */
+const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
+                                      const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+/* Return the value of the attribute WHAT of KEY, which has to be
+ * representable by an unsigned integer.  IDX specifies the sub key or
+ * user ID for attributes related to sub keys or user IDs.
+ * Deprecated, use key structure directly instead.  */
+unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
+                                       const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+/* Return the value of the attribute WHAT of a signature on user ID
+ * UID_IDX in KEY, which has to be representable by a string.  IDX
+ * specifies the signature.  Deprecated, use key structure directly
+ * instead.  */
+const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
+                                          _gpgme_attr_t what,
+                                          const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+/* Return the value of the attribute WHAT of a signature on user ID
+ * UID_IDX in KEY, which has to be representable by an unsigned
+ * integer string.  IDX specifies the signature.  Deprecated, use key
+ * structure directly instead.  */
+unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx,
+                                           _gpgme_attr_t what,
+                                           const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+
+gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata,
+                                  int *nr) _GPGME_DEPRECATED(0,4);
+
+/* DO NOT USE.  */
+void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED(0,4);
+
+/* DO NOT USE.  */
+const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
+                                             _gpgme_attr_t what,
+                                             const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+/* DO NOT USE.  */
+int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
+                                  const void *reserved, int idx)
+     _GPGME_DEPRECATED(0,4);
+
+/* Compat.
+ * This structure shall be considered read-only and an application
+ * must not allocate such a structure on its own.  */
+struct _gpgme_op_assuan_result
+{
+  /* Deprecated.  Use the second value in a DONE event or the
+     synchronous variant gpgme_op_assuan_transact_ext.  */
+  gpgme_error_t err _GPGME_DEPRECATED_OUTSIDE_GPGME(1,2);
+};
+typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
+
+
+/* Return the result of the last Assuan command. */
+gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx)
+  _GPGME_DEPRECATED(1,2);
+
+gpgme_error_t
+gpgme_op_assuan_transact (gpgme_ctx_t ctx,
+                             const char *command,
+                             gpgme_assuan_data_cb_t data_cb,
+                             void *data_cb_value,
+                             gpgme_assuan_inquire_cb_t inq_cb,
+                             void *inq_cb_value,
+                             gpgme_assuan_status_cb_t status_cb,
+                          void *status_cb_value) _GPGME_DEPRECATED(1,2);
+
+
+
 typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED(0,4);
 typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED(0,4);
 typedef gpgme_error_t GpgmeError _GPGME_DEPRECATED(0,4);