LCOV - code coverage report
Current view: top level - build/src - gpgme.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 10 40.0 %
Date: 2017-03-02 17:11:10 Functions: 2 5 40.0 %

          Line data    Source code
       1             : /* gpgme.h - Public interface to GnuPG Made Easy.                   -*- c -*-
       2             :  * Copyright (C) 2000 Werner Koch (dd9jn)
       3             :  * Copyright (C) 2001-2017 g10 Code GmbH
       4             :  *
       5             :  * This file is part of GPGME.
       6             :  *
       7             :  * GPGME is free software; you can redistribute it and/or modify it
       8             :  * under the terms of the GNU Lesser General Public License as
       9             :  * published by the Free Software Foundation; either version 2.1 of
      10             :  * the License, or (at your option) any later version.
      11             :  *
      12             :  * GPGME is distributed in the hope that it will be useful, but
      13             :  * WITHOUT ANY WARRANTY; without even the implied warranty of
      14             :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15             :  * Lesser General Public License for more details.
      16             :  *
      17             :  * You should have received a copy of the GNU Lesser General Public
      18             :  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
      19             :  *
      20             :  * Generated from gpgme.h.in for x86_64-pc-linux-gnu.
      21             :  */
      22             : 
      23             : #ifndef GPGME_H
      24             : #define GPGME_H
      25             : 
      26             : /* Include stdio.h for the FILE type definition.  */
      27             : #include <stdio.h>
      28             : #include <time.h>
      29             : #include <gpg-error.h>
      30             : 
      31             : #ifdef __cplusplus
      32             : extern "C" {
      33             : #if 0 /*(Make Emacsen's auto-indent happy.)*/
      34             : }
      35             : #endif
      36             : #endif /* __cplusplus */
      37             : 
      38             : 
      39             : /* The version of this header should match the one of the library.  Do
      40             :    not use this symbol in your application, use gpgme_check_version
      41             :    instead.  The purpose of this macro is to let autoconf (using the
      42             :    AM_PATH_GPGME macro) check that this header matches the installed
      43             :    library.  */
      44             : #define GPGME_VERSION "1.8.1"
      45             : 
      46             : /* The version number of this header.  It may be used to handle minor
      47             :    API incompatibilities.  */
      48             : #define GPGME_VERSION_NUMBER 0x010801
      49             : 
      50             : 
      51             : /* System specific typedefs.  */
      52             : 
      53             : #include <sys/types.h>
      54             : typedef off_t   gpgme_off_t;
      55             : typedef ssize_t gpgme_ssize_t;
      56             : 
      57             : 
      58             : 
      59             : /*
      60             :  * Check for compiler features.
      61             :  */
      62             : #ifdef GPGRT_INLINE
      63             : # define _GPGME_INLINE GPGRT_INLINE
      64             : #elif defined(__GNUC__)
      65             : # define _GPGME_INLINE __inline__
      66             : #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
      67             : # define _GPGME_INLINE inline
      68             : #else
      69             : # define _GPGME_INLINE
      70             : #endif
      71             : 
      72             : 
      73             : /* The deprecated macro takes the version number of GPGME which
      74             :  * introduced the deprecation as parameter for documentation.  */
      75             : #ifdef GPGRT_ATTR_DEPRECATED
      76             : # define _GPGME_DEPRECATED(a,b) GPGRT_ATTR_DEPRECATED
      77             : #elif defined(__GNUC__)
      78             : # define _GPGME_GCC_VERSION (__GNUC__ * 10000 \
      79             :                              + __GNUC_MINOR__ * 100 \
      80             :                              + __GNUC_PATCHLEVEL__)
      81             : 
      82             : # if _GPGME_GCC_VERSION > 30100
      83             : #  define _GPGME_DEPRECATED(a,b)  __attribute__ ((__deprecated__))
      84             : # else
      85             : #  define _GPGME_DEPRECATED(a,b)
      86             : # endif
      87             : #else
      88             : # define _GPGME_DEPRECATED(a,b)
      89             : #endif
      90             : 
      91             : 
      92             : /* The macro _GPGME_DEPRECATED_OUTSIDE_GPGME suppresses warnings for
      93             :    fields we must access in GPGME for ABI compatibility.  */
      94             : #ifdef _GPGME_IN_GPGME
      95             : #define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b)
      96             : #else
      97             : #define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b) _GPGME_DEPRECATED(a,b)
      98             : #endif
      99             : 
     100             : 
     101             : /* Check for a matching _FILE_OFFSET_BITS definition.  */
     102             : #if 0
     103             : #ifndef _FILE_OFFSET_BITS
     104             : #error GPGME was compiled with _FILE_OFFSET_BITS = 0, please see the section "Largefile support (LFS)" in the GPGME manual.
     105             : #else
     106             : #if (_FILE_OFFSET_BITS) != (0)
     107             : #error GPGME was compiled with a different value for _FILE_OFFSET_BITS, namely 0, please see the section "Largefile support (LFS)" in the GPGME manual.
     108             : #endif
     109             : #endif
     110             : #endif
     111             : 
     112             : 
     113             : 
     114             : /*
     115             :  * Some opaque data types used by GPGME.
     116             :  */
     117             : 
     118             : /* The context holds some global state and configuration options, as
     119             :    well as the results of a crypto operation.  */
     120             : struct gpgme_context;
     121             : typedef struct gpgme_context *gpgme_ctx_t;
     122             : 
     123             : /* The data object is used by GPGME to exchange arbitrary data.  */
     124             : struct gpgme_data;
     125             : typedef struct gpgme_data *gpgme_data_t;
     126             : 
     127             : 
     128             : 
     129             : /*
     130             :  * Wrappers for the libgpg-error library.
     131             :  */
     132             : 
     133             : typedef gpg_error_t gpgme_error_t;
     134             : typedef gpg_err_code_t gpgme_err_code_t;
     135             : typedef gpg_err_source_t gpgme_err_source_t;
     136             : 
     137             : 
     138             : static _GPGME_INLINE gpgme_error_t
     139           1 : gpgme_err_make (gpgme_err_source_t source, gpgme_err_code_t code)
     140             : {
     141           1 :   return gpg_err_make (source, code);
     142             : }
     143             : 
     144             : 
     145             : /* The user can define GPGME_ERR_SOURCE_DEFAULT before including this
     146             :    file to specify a default source for gpgme_error.  */
     147             : #ifndef GPGME_ERR_SOURCE_DEFAULT
     148             : #define GPGME_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_USER_1
     149             : #endif
     150             : 
     151             : static _GPGME_INLINE gpgme_error_t
     152           0 : gpgme_error (gpgme_err_code_t code)
     153             : {
     154           0 :   return gpgme_err_make (GPGME_ERR_SOURCE_DEFAULT, code);
     155             : }
     156             : 
     157             : 
     158             : static _GPGME_INLINE gpgme_err_code_t
     159         265 : gpgme_err_code (gpgme_error_t err)
     160             : {
     161         265 :   return gpg_err_code (err);
     162             : }
     163             : 
     164             : 
     165             : static _GPGME_INLINE gpgme_err_source_t
     166           0 : gpgme_err_source (gpgme_error_t err)
     167             : {
     168           0 :   return gpg_err_source (err);
     169             : }
     170             : 
     171             : 
     172             : /* Return a pointer to a string containing a description of the error
     173             :    code in the error value ERR.  This function is not thread safe.  */
     174             : const char *gpgme_strerror (gpgme_error_t err);
     175             : 
     176             : /* Return the error string for ERR in the user-supplied buffer BUF of
     177             :    size BUFLEN.  This function is, in contrast to gpg_strerror,
     178             :    thread-safe if a thread-safe strerror_r() function is provided by
     179             :    the system.  If the function succeeds, 0 is returned and BUF
     180             :    contains the string describing the error.  If the buffer was not
     181             :    large enough, ERANGE is returned and BUF contains as much of the
     182             :    beginning of the error string as fits into the buffer.  */
     183             : int gpgme_strerror_r (gpg_error_t err, char *buf, size_t buflen);
     184             : 
     185             : /* Return a pointer to a string containing a description of the error
     186             :    source in the error value ERR.  */
     187             : const char *gpgme_strsource (gpgme_error_t err);
     188             : 
     189             : /* Retrieve the error code for the system error ERR.  This returns
     190             :    GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
     191             :    this).  */
     192             : gpgme_err_code_t gpgme_err_code_from_errno (int err);
     193             : 
     194             : /* Retrieve the system error for the error code CODE.  This returns 0
     195             :    if CODE is not a system error code.  */
     196             : int gpgme_err_code_to_errno (gpgme_err_code_t code);
     197             : 
     198             : /* Retrieve the error code directly from the ERRNO variable.  This
     199             :    returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
     200             :    (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
     201             : gpgme_err_code_t gpgme_err_code_from_syserror (void);
     202             : 
     203             : /* Set the ERRNO variable.  This function is the preferred way to set
     204             :    ERRNO due to peculiarities on WindowsCE.  */
     205             : void gpgme_err_set_errno (int err);
     206             : 
     207             : /* Return an error value with the error source SOURCE and the system
     208             :    error ERR.  FIXME: Should be inline.  */
     209             : gpgme_error_t gpgme_err_make_from_errno (gpgme_err_source_t source, int err);
     210             : 
     211             : /* Return an error value with the system error ERR.  FIXME: Should be inline.  */
     212             : gpgme_error_t gpgme_error_from_errno (int err);
     213             : 
     214             : 
     215             : static _GPGME_INLINE gpgme_error_t
     216           0 : gpgme_error_from_syserror (void)
     217             : {
     218           0 :   return gpgme_error (gpgme_err_code_from_syserror ());
     219             : }
     220             : 
     221             : 
     222             : 
     223             : /*
     224             :  * Various constants and types
     225             :  */
     226             : 
     227             : /* The possible encoding mode of gpgme_data_t objects.  */
     228             : typedef enum
     229             :   {
     230             :     GPGME_DATA_ENCODING_NONE   = 0,     /* Not specified.  */
     231             :     GPGME_DATA_ENCODING_BINARY = 1,
     232             :     GPGME_DATA_ENCODING_BASE64 = 2,
     233             :     GPGME_DATA_ENCODING_ARMOR  = 3,     /* Either PEM or OpenPGP Armor.  */
     234             :     GPGME_DATA_ENCODING_URL    = 4,     /* LF delimited URL list.        */
     235             :     GPGME_DATA_ENCODING_URLESC = 5,     /* Ditto, but percent escaped.   */
     236             :     GPGME_DATA_ENCODING_URL0   = 6,     /* Nul delimited URL list.       */
     237             :     GPGME_DATA_ENCODING_MIME   = 7      /* Data is a MIME part.          */
     238             :   }
     239             : gpgme_data_encoding_t;
     240             : 
     241             : 
     242             : /* Known data types.  */
     243             : typedef enum
     244             :   {
     245             :     GPGME_DATA_TYPE_INVALID      = 0,   /* Not detected.  */
     246             :     GPGME_DATA_TYPE_UNKNOWN      = 1,
     247             :     GPGME_DATA_TYPE_PGP_SIGNED   = 0x10,
     248             :     GPGME_DATA_TYPE_PGP_ENCRYPTED= 0x11,
     249             :     GPGME_DATA_TYPE_PGP_OTHER    = 0x12,
     250             :     GPGME_DATA_TYPE_PGP_KEY      = 0x13,
     251             :     GPGME_DATA_TYPE_PGP_SIGNATURE= 0x18, /* Detached signature */
     252             :     GPGME_DATA_TYPE_CMS_SIGNED   = 0x20,
     253             :     GPGME_DATA_TYPE_CMS_ENCRYPTED= 0x21,
     254             :     GPGME_DATA_TYPE_CMS_OTHER    = 0x22,
     255             :     GPGME_DATA_TYPE_X509_CERT    = 0x23,
     256             :     GPGME_DATA_TYPE_PKCS12       = 0x24,
     257             :   }
     258             : gpgme_data_type_t;
     259             : 
     260             : 
     261             : /* Public key algorithms.  */
     262             : typedef enum
     263             :   {
     264             :     GPGME_PK_RSA   = 1,
     265             :     GPGME_PK_RSA_E = 2,
     266             :     GPGME_PK_RSA_S = 3,
     267             :     GPGME_PK_ELG_E = 16,
     268             :     GPGME_PK_DSA   = 17,
     269             :     GPGME_PK_ECC   = 18,
     270             :     GPGME_PK_ELG   = 20,
     271             :     GPGME_PK_ECDSA = 301,
     272             :     GPGME_PK_ECDH  = 302,
     273             :     GPGME_PK_EDDSA = 303
     274             :   }
     275             : gpgme_pubkey_algo_t;
     276             : 
     277             : 
     278             : /* Hash algorithms (the values match those from libgcrypt).  */
     279             : typedef enum
     280             :   {
     281             :     GPGME_MD_NONE          = 0,
     282             :     GPGME_MD_MD5           = 1,
     283             :     GPGME_MD_SHA1          = 2,
     284             :     GPGME_MD_RMD160        = 3,
     285             :     GPGME_MD_MD2           = 5,
     286             :     GPGME_MD_TIGER         = 6,   /* TIGER/192. */
     287             :     GPGME_MD_HAVAL         = 7,   /* HAVAL, 5 pass, 160 bit. */
     288             :     GPGME_MD_SHA256        = 8,
     289             :     GPGME_MD_SHA384        = 9,
     290             :     GPGME_MD_SHA512        = 10,
     291             :     GPGME_MD_SHA224        = 11,
     292             :     GPGME_MD_MD4           = 301,
     293             :     GPGME_MD_CRC32         = 302,
     294             :     GPGME_MD_CRC32_RFC1510 = 303,
     295             :     GPGME_MD_CRC24_RFC2440 = 304
     296             :   }
     297             : gpgme_hash_algo_t;
     298             : 
     299             : 
     300             : /* The available signature modes.  */
     301             : typedef enum
     302             :   {
     303             :     GPGME_SIG_MODE_NORMAL = 0,
     304             :     GPGME_SIG_MODE_DETACH = 1,
     305             :     GPGME_SIG_MODE_CLEAR  = 2
     306             :   }
     307             : gpgme_sig_mode_t;
     308             : 
     309             : 
     310             : /* The available validities for a trust item or key.  */
     311             : typedef enum
     312             :   {
     313             :     GPGME_VALIDITY_UNKNOWN   = 0,
     314             :     GPGME_VALIDITY_UNDEFINED = 1,
     315             :     GPGME_VALIDITY_NEVER     = 2,
     316             :     GPGME_VALIDITY_MARGINAL  = 3,
     317             :     GPGME_VALIDITY_FULL      = 4,
     318             :     GPGME_VALIDITY_ULTIMATE  = 5
     319             :   }
     320             : gpgme_validity_t;
     321             : 
     322             : 
     323             : /* The TOFU policies. */
     324             : typedef enum
     325             :   {
     326             :     GPGME_TOFU_POLICY_NONE    = 0,
     327             :     GPGME_TOFU_POLICY_AUTO    = 1,
     328             :     GPGME_TOFU_POLICY_GOOD    = 2,
     329             :     GPGME_TOFU_POLICY_UNKNOWN = 3,
     330             :     GPGME_TOFU_POLICY_BAD     = 4,
     331             :     GPGME_TOFU_POLICY_ASK     = 5
     332             :   }
     333             : gpgme_tofu_policy_t;
     334             : 
     335             : 
     336             : /* The available protocols.  */
     337             : typedef enum
     338             :   {
     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_SPAWN   = 6,  /* Direct access to any program.  */
     346             :     GPGME_PROTOCOL_DEFAULT = 254,
     347             :     GPGME_PROTOCOL_UNKNOWN = 255
     348             :   }
     349             : gpgme_protocol_t;
     350             : /* Convenience macro for the surprisingly mixed spelling.  */
     351             : #define GPGME_PROTOCOL_OPENPGP GPGME_PROTOCOL_OpenPGP
     352             : 
     353             : 
     354             : /* The available keylist mode flags.  */
     355             : #define GPGME_KEYLIST_MODE_LOCAL                1
     356             : #define GPGME_KEYLIST_MODE_EXTERN               2
     357             : #define GPGME_KEYLIST_MODE_SIGS                 4
     358             : #define GPGME_KEYLIST_MODE_SIG_NOTATIONS        8
     359             : #define GPGME_KEYLIST_MODE_WITH_SECRET          16
     360             : #define GPGME_KEYLIST_MODE_WITH_TOFU            32
     361             : #define GPGME_KEYLIST_MODE_EPHEMERAL            128
     362             : #define GPGME_KEYLIST_MODE_VALIDATE             256
     363             : 
     364             : typedef unsigned int gpgme_keylist_mode_t;
     365             : 
     366             : 
     367             : /* The pinentry modes. */
     368             : typedef enum
     369             :   {
     370             :     GPGME_PINENTRY_MODE_DEFAULT  = 0,
     371             :     GPGME_PINENTRY_MODE_ASK      = 1,
     372             :     GPGME_PINENTRY_MODE_CANCEL   = 2,
     373             :     GPGME_PINENTRY_MODE_ERROR    = 3,
     374             :     GPGME_PINENTRY_MODE_LOOPBACK = 4
     375             :   }
     376             : gpgme_pinentry_mode_t;
     377             : 
     378             : 
     379             : /* The available export mode flags.  */
     380             : #define GPGME_EXPORT_MODE_EXTERN                2
     381             : #define GPGME_EXPORT_MODE_MINIMAL               4
     382             : #define GPGME_EXPORT_MODE_SECRET               16
     383             : #define GPGME_EXPORT_MODE_RAW                  32
     384             : #define GPGME_EXPORT_MODE_PKCS12               64
     385             : 
     386             : typedef unsigned int gpgme_export_mode_t;
     387             : 
     388             : 
     389             : /* Flags for the audit log functions.  */
     390             : #define GPGME_AUDITLOG_HTML      1
     391             : #define GPGME_AUDITLOG_WITH_HELP 128
     392             : 
     393             : 
     394             : /* The available signature notation flags.  */
     395             : #define GPGME_SIG_NOTATION_HUMAN_READABLE       1
     396             : #define GPGME_SIG_NOTATION_CRITICAL             2
     397             : 
     398             : typedef unsigned int gpgme_sig_notation_flags_t;
     399             : 
     400             : /* An object to hold information about notation data.  This structure
     401             :  * shall be considered read-only and an application must not allocate
     402             :  * such a structure on its own.  */
     403             : struct _gpgme_sig_notation
     404             : {
     405             :   struct _gpgme_sig_notation *next;
     406             : 
     407             :   /* If NAME is a null pointer, then VALUE contains a policy URL
     408             :      rather than a notation.  */
     409             :   char *name;
     410             : 
     411             :   /* The value of the notation data.  */
     412             :   char *value;
     413             : 
     414             :   /* The length of the name of the notation data.  */
     415             :   int name_len;
     416             : 
     417             :   /* The length of the value of the notation data.  */
     418             :   int value_len;
     419             : 
     420             :   /* The accumulated flags.  */
     421             :   gpgme_sig_notation_flags_t flags;
     422             : 
     423             :   /* Notation data is human-readable.  */
     424             :   unsigned int human_readable : 1;
     425             : 
     426             :   /* Notation data is critical.  */
     427             :   unsigned int critical : 1;
     428             : 
     429             :   /* Internal to GPGME, do not use.  */
     430             :   int _unused : 30;
     431             : };
     432             : typedef struct _gpgme_sig_notation *gpgme_sig_notation_t;
     433             : 
     434             : 
     435             : 
     436             : /*
     437             :  * Public structures.
     438             :  */
     439             : 
     440             : /* The engine information structure.
     441             :  * This structure shall be considered read-only and an application
     442             :  * must not allocate such a structure on its own.  */
     443             : struct _gpgme_engine_info
     444             : {
     445             :   struct _gpgme_engine_info *next;
     446             : 
     447             :   /* The protocol ID.  */
     448             :   gpgme_protocol_t protocol;
     449             : 
     450             :   /* The file name of the engine binary.  */
     451             :   char *file_name;
     452             : 
     453             :   /* The version string of the installed engine.  */
     454             :   char *version;
     455             : 
     456             :   /* The minimum version required for GPGME.  */
     457             :   const char *req_version;
     458             : 
     459             :   /* The home directory used, or NULL if default.  */
     460             :   char *home_dir;
     461             : };
     462             : typedef struct _gpgme_engine_info *gpgme_engine_info_t;
     463             : 
     464             : 
     465             : /* An object with TOFU information.
     466             :  * This structure shall be considered read-only and an application
     467             :  * must not allocate such a structure on its own.  */
     468             : struct _gpgme_tofu_info
     469             : {
     470             :   struct _gpgme_tofu_info *next;
     471             : 
     472             :   /* The TOFU validity:
     473             :    *  0 := conflict
     474             :    *  1 := key without history
     475             :    *  2 := key with too little history
     476             :    *  3 := key with enough history for basic trust
     477             :    *  4 := key with a lot of history
     478             :    */
     479             :   unsigned int validity : 3;
     480             : 
     481             :   /* The TOFU policy (gpgme_tofu_policy_t).  */
     482             :   unsigned int policy : 4;
     483             : 
     484             :   unsigned int _rfu : 25;
     485             : 
     486             :   /* Number of signatures seen for this binding.  Capped at USHRT_MAX.  */
     487             :   unsigned short signcount;
     488             :   /* Number of encryptions done with this binding.  Capped at USHRT_MAX.  */
     489             :   unsigned short encrcount;
     490             : 
     491             :   /* Number of seconds since Epoch when the first and the most
     492             :    * recently seen message were verified/decrypted.  0 means unknown. */
     493             :   unsigned long signfirst;
     494             :   unsigned long signlast;
     495             :   unsigned long encrfirst;
     496             :   unsigned long encrlast;
     497             : 
     498             :   /* If non-NULL a human readable string summarizing the TOFU data. */
     499             :   char *description;
     500             : };
     501             : typedef struct _gpgme_tofu_info *gpgme_tofu_info_t;
     502             : 
     503             : 
     504             : /* A subkey from a key.
     505             :  * This structure shall be considered read-only and an application
     506             :  * must not allocate such a structure on its own.  */
     507             : struct _gpgme_subkey
     508             : {
     509             :   struct _gpgme_subkey *next;
     510             : 
     511             :   /* True if subkey is revoked.  */
     512             :   unsigned int revoked : 1;
     513             : 
     514             :   /* True if subkey is expired.  */
     515             :   unsigned int expired : 1;
     516             : 
     517             :   /* True if subkey is disabled.  */
     518             :   unsigned int disabled : 1;
     519             : 
     520             :   /* True if subkey is invalid.  */
     521             :   unsigned int invalid : 1;
     522             : 
     523             :   /* True if subkey can be used for encryption.  */
     524             :   unsigned int can_encrypt : 1;
     525             : 
     526             :   /* True if subkey can be used for signing.  */
     527             :   unsigned int can_sign : 1;
     528             : 
     529             :   /* True if subkey can be used for certification.  */
     530             :   unsigned int can_certify : 1;
     531             : 
     532             :   /* True if subkey is secret.  */
     533             :   unsigned int secret : 1;
     534             : 
     535             :   /* True if subkey can be used for authentication.  */
     536             :   unsigned int can_authenticate : 1;
     537             : 
     538             :   /* True if subkey is qualified for signatures according to German law.  */
     539             :   unsigned int is_qualified : 1;
     540             : 
     541             :   /* True if the secret key is stored on a smart card.  */
     542             :   unsigned int is_cardkey : 1;
     543             : 
     544             :   /* Internal to GPGME, do not use.  */
     545             :   unsigned int _unused : 21;
     546             : 
     547             :   /* Public key algorithm supported by this subkey.  */
     548             :   gpgme_pubkey_algo_t pubkey_algo;
     549             : 
     550             :   /* Length of the subkey.  */
     551             :   unsigned int length;
     552             : 
     553             :   /* The key ID of the subkey.  */
     554             :   char *keyid;
     555             : 
     556             :   /* Internal to GPGME, do not use.  */
     557             :   char _keyid[16 + 1];
     558             : 
     559             :   /* The fingerprint of the subkey in hex digit form.  */
     560             :   char *fpr;
     561             : 
     562             :   /* The creation timestamp, -1 if invalid, 0 if not available.  */
     563             :   long int timestamp;
     564             : 
     565             :   /* The expiration timestamp, 0 if the subkey does not expire.  */
     566             :   long int expires;
     567             : 
     568             :   /* The serial number of a smart card holding this key or NULL.  */
     569             :   char *card_number;
     570             : 
     571             :   /* The name of the curve for ECC algorithms or NULL.  */
     572             :   char *curve;
     573             : 
     574             :   /* The keygrip of the subkey in hex digit form or NULL if not availabale.  */
     575             :   char *keygrip;
     576             : };
     577             : typedef struct _gpgme_subkey *gpgme_subkey_t;
     578             : 
     579             : 
     580             : /* A signature on a user ID.
     581             :  * This structure shall be considered read-only and an application
     582             :  * must not allocate such a structure on its own.  */
     583             : struct _gpgme_key_sig
     584             : {
     585             :   struct _gpgme_key_sig *next;
     586             : 
     587             :   /* True if the signature is a revocation signature.  */
     588             :   unsigned int revoked : 1;
     589             : 
     590             :   /* True if the signature is expired.  */
     591             :   unsigned int expired : 1;
     592             : 
     593             :   /* True if the signature is invalid.  */
     594             :   unsigned int invalid : 1;
     595             : 
     596             :   /* True if the signature should be exported.  */
     597             :   unsigned int exportable : 1;
     598             : 
     599             :   /* Internal to GPGME, do not use.  */
     600             :   unsigned int _unused : 28;
     601             : 
     602             :   /* The public key algorithm used to create the signature.  */
     603             :   gpgme_pubkey_algo_t pubkey_algo;
     604             : 
     605             :   /* The key ID of key used to create the signature.  */
     606             :   char *keyid;
     607             : 
     608             :   /* Internal to GPGME, do not use.  */
     609             :   char _keyid[16 + 1];
     610             : 
     611             :   /* The creation timestamp, -1 if invalid, 0 if not available.  */
     612             :   long int timestamp;
     613             : 
     614             :   /* The expiration timestamp, 0 if the subkey does not expire.  */
     615             :   long int expires;
     616             : 
     617             :   /* Same as in gpgme_signature_t.  */
     618             :   gpgme_error_t status;
     619             : 
     620             : #ifdef __cplusplus
     621             :   unsigned int _obsolete_class _GPGME_DEPRECATED(0,4);
     622             : #else
     623             :   /* Must be set to SIG_CLASS below.  */
     624             :   unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
     625             : #endif
     626             : 
     627             :   /* The user ID string.  */
     628             :   char *uid;
     629             : 
     630             :   /* The name part of the user ID.  */
     631             :   char *name;
     632             : 
     633             :   /* The email part of the user ID.  */
     634             :   char *email;
     635             : 
     636             :   /* The comment part of the user ID.  */
     637             :   char *comment;
     638             : 
     639             :   /* Crypto backend specific signature class.  */
     640             :   unsigned int sig_class;
     641             : 
     642             :   /* Notation data and policy URLs.  */
     643             :   gpgme_sig_notation_t notations;
     644             : 
     645             :   /* Internal to GPGME, do not use.  */
     646             :   gpgme_sig_notation_t _last_notation;
     647             : };
     648             : typedef struct _gpgme_key_sig *gpgme_key_sig_t;
     649             : 
     650             : 
     651             : /* An user ID from a key.
     652             :  * This structure shall be considered read-only and an application
     653             :  * must not allocate such a structure on its own.  */
     654             : struct _gpgme_user_id
     655             : {
     656             :   struct _gpgme_user_id *next;
     657             : 
     658             :   /* True if the user ID is revoked.  */
     659             :   unsigned int revoked : 1;
     660             : 
     661             :   /* True if the user ID is invalid.  */
     662             :   unsigned int invalid : 1;
     663             : 
     664             :   /* Internal to GPGME, do not use.  */
     665             :   unsigned int _unused : 30;
     666             : 
     667             :   /* The validity of the user ID.  */
     668             :   gpgme_validity_t validity;
     669             : 
     670             :   /* The user ID string.  */
     671             :   char *uid;
     672             : 
     673             :   /* The name part of the user ID.  */
     674             :   char *name;
     675             : 
     676             :   /* The email part of the user ID.  */
     677             :   char *email;
     678             : 
     679             :   /* The comment part of the user ID.  */
     680             :   char *comment;
     681             : 
     682             :   /* The signatures of the user ID.  */
     683             :   gpgme_key_sig_t signatures;
     684             : 
     685             :   /* Internal to GPGME, do not use.  */
     686             :   gpgme_key_sig_t _last_keysig;
     687             : 
     688             :   /* The mail address (addr-spec from RFC5322) of the UID string.
     689             :    * This is general the same as the EMAIL part of this struct but
     690             :    * might be slightly different.  If no mail address is available
     691             :    * NULL is stored.  */
     692             :   char *address;
     693             : 
     694             :   /* The malloced TOFU information or NULL.  */
     695             :   gpgme_tofu_info_t tofu;
     696             : };
     697             : typedef struct _gpgme_user_id *gpgme_user_id_t;
     698             : 
     699             : 
     700             : /* A key from the keyring.
     701             :  * This structure shall be considered read-only and an application
     702             :  * must not allocate such a structure on its own.  */
     703             : struct _gpgme_key
     704             : {
     705             :   /* Internal to GPGME, do not use.  */
     706             :   unsigned int _refs;
     707             : 
     708             :   /* True if key is revoked.  */
     709             :   unsigned int revoked : 1;
     710             : 
     711             :   /* True if key is expired.  */
     712             :   unsigned int expired : 1;
     713             : 
     714             :   /* True if key is disabled.  */
     715             :   unsigned int disabled : 1;
     716             : 
     717             :   /* True if key is invalid.  */
     718             :   unsigned int invalid : 1;
     719             : 
     720             :   /* True if key can be used for encryption.  */
     721             :   unsigned int can_encrypt : 1;
     722             : 
     723             :   /* True if key can be used for signing.  */
     724             :   unsigned int can_sign : 1;
     725             : 
     726             :   /* True if key can be used for certification.  */
     727             :   unsigned int can_certify : 1;
     728             : 
     729             :   /* True if key is secret.  */
     730             :   unsigned int secret : 1;
     731             : 
     732             :   /* True if key can be used for authentication.  */
     733             :   unsigned int can_authenticate : 1;
     734             : 
     735             :   /* True if subkey is qualified for signatures according to German law.  */
     736             :   unsigned int is_qualified : 1;
     737             : 
     738             :   /* Internal to GPGME, do not use.  */
     739             :   unsigned int _unused : 22;
     740             : 
     741             :   /* This is the protocol supported by this key.  */
     742             :   gpgme_protocol_t protocol;
     743             : 
     744             :   /* If protocol is GPGME_PROTOCOL_CMS, this string contains the
     745             :      issuer serial.  */
     746             :   char *issuer_serial;
     747             : 
     748             :   /* If protocol is GPGME_PROTOCOL_CMS, this string contains the
     749             :      issuer name.  */
     750             :   char *issuer_name;
     751             : 
     752             :   /* If protocol is GPGME_PROTOCOL_CMS, this string contains the chain
     753             :      ID.  */
     754             :   char *chain_id;
     755             : 
     756             :   /* If protocol is GPGME_PROTOCOL_OpenPGP, this field contains the
     757             :      owner trust.  */
     758             :   gpgme_validity_t owner_trust;
     759             : 
     760             :   /* The subkeys of the key.  */
     761             :   gpgme_subkey_t subkeys;
     762             : 
     763             :   /* The user IDs of the key.  */
     764             :   gpgme_user_id_t uids;
     765             : 
     766             :   /* Internal to GPGME, do not use.  */
     767             :   gpgme_subkey_t _last_subkey;
     768             : 
     769             :   /* Internal to GPGME, do not use.  */
     770             :   gpgme_user_id_t _last_uid;
     771             : 
     772             :   /* The keylist mode that was active when listing the key.  */
     773             :   gpgme_keylist_mode_t keylist_mode;
     774             : 
     775             :   /* This field gives the fingerprint of the primary key.  Note that
     776             :    * this is a copy of the FPR of the first subkey.  We need it here
     777             :    * to allow for an incomplete key object.  */
     778             :   char *fpr;
     779             : };
     780             : typedef struct _gpgme_key *gpgme_key_t;
     781             : 
     782             : 
     783             : /* An invalid key object.
     784             :  * This structure shall be considered read-only and an application
     785             :  * must not allocate such a structure on its own.  */
     786             : struct _gpgme_invalid_key
     787             : {
     788             :   struct _gpgme_invalid_key *next;
     789             : 
     790             :   /* The string used to request the key.  Despite the name this may
     791             :    * not be a fingerprint.  */
     792             :   char *fpr;
     793             : 
     794             :   /* The error code.  */
     795             :   gpgme_error_t reason;
     796             : };
     797             : typedef struct _gpgme_invalid_key *gpgme_invalid_key_t;
     798             : 
     799             : 
     800             : 
     801             : /*
     802             :  * Types for callback functions.
     803             :  */
     804             : 
     805             : /* Request a passphrase from the user.  */
     806             : typedef gpgme_error_t (*gpgme_passphrase_cb_t) (void *hook,
     807             :                                                 const char *uid_hint,
     808             :                                                 const char *passphrase_info,
     809             :                                                 int prev_was_bad, int fd);
     810             : 
     811             : /* Inform the user about progress made.  */
     812             : typedef void (*gpgme_progress_cb_t) (void *opaque, const char *what,
     813             :                                      int type, int current, int total);
     814             : 
     815             : /* Status messages from gpg. */
     816             : typedef gpgme_error_t (*gpgme_status_cb_t) (void *opaque, const char *keyword,
     817             :                                             const char *args);
     818             : 
     819             : /* Interact with the user about an edit operation.  */
     820             : typedef gpgme_error_t (*gpgme_interact_cb_t) (void *opaque,
     821             :                                               const char *keyword,
     822             :                                               const char *args, int fd);
     823             : 
     824             : 
     825             : 
     826             : /*
     827             :  * Context management functions.
     828             :  */
     829             : 
     830             : /* Create a new context and return it in CTX.  */
     831             : gpgme_error_t gpgme_new (gpgme_ctx_t *ctx);
     832             : 
     833             : /* Release the context CTX.  */
     834             : void gpgme_release (gpgme_ctx_t ctx);
     835             : 
     836             : /* Set the flag NAME for CTX to VALUE.  */
     837             : gpgme_error_t gpgme_set_ctx_flag (gpgme_ctx_t ctx,
     838             :                                   const char *name, const char *value);
     839             : 
     840             : /* Get the value of the flag NAME from CTX.  */
     841             : const char *gpgme_get_ctx_flag (gpgme_ctx_t ctx, const char *name);
     842             : 
     843             : /* Set the protocol to be used by CTX to PROTO.  */
     844             : gpgme_error_t gpgme_set_protocol (gpgme_ctx_t ctx, gpgme_protocol_t proto);
     845             : 
     846             : /* Get the protocol used with CTX */
     847             : gpgme_protocol_t gpgme_get_protocol (gpgme_ctx_t ctx);
     848             : 
     849             : /* Set the crypto protocol to be used by CTX to PROTO.
     850             :    gpgme_set_protocol actually sets the backend engine.  This sets the
     851             :    crypto protocol used in engines that support more than one crypto
     852             :    prococol (for example, an UISERVER can support OpenPGP and CMS).
     853             :    This is reset to the default with gpgme_set_protocol.  */
     854             : gpgme_error_t gpgme_set_sub_protocol (gpgme_ctx_t ctx,
     855             :                                       gpgme_protocol_t proto);
     856             : 
     857             : /* Get the sub protocol.  */
     858             : gpgme_protocol_t gpgme_get_sub_protocol (gpgme_ctx_t ctx);
     859             : 
     860             : /* Get the string describing protocol PROTO, or NULL if invalid.  */
     861             : const char *gpgme_get_protocol_name (gpgme_protocol_t proto);
     862             : 
     863             : /* If YES is non-zero, enable armor mode in CTX, disable it otherwise.  */
     864             : void gpgme_set_armor (gpgme_ctx_t ctx, int yes);
     865             : 
     866             : /* Return non-zero if armor mode is set in CTX.  */
     867             : int gpgme_get_armor (gpgme_ctx_t ctx);
     868             : 
     869             : /* If YES is non-zero, enable text mode in CTX, disable it otherwise.  */
     870             : void gpgme_set_textmode (gpgme_ctx_t ctx, int yes);
     871             : 
     872             : /* Return non-zero if text mode is set in CTX.  */
     873             : int gpgme_get_textmode (gpgme_ctx_t ctx);
     874             : 
     875             : /* If YES is non-zero, enable offline mode in CTX, disable it otherwise.  */
     876             : void gpgme_set_offline (gpgme_ctx_t ctx, int yes);
     877             : 
     878             : /* Return non-zero if offline mode is set in CTX.  */
     879             : int gpgme_get_offline (gpgme_ctx_t ctx);
     880             : 
     881             : /* Use whatever the default of the backend crypto engine is.  */
     882             : #define GPGME_INCLUDE_CERTS_DEFAULT     -256
     883             : 
     884             : /* Include up to NR_OF_CERTS certificates in an S/MIME message.  */
     885             : void gpgme_set_include_certs (gpgme_ctx_t ctx, int nr_of_certs);
     886             : 
     887             : /* Return the number of certs to include in an S/MIME message.  */
     888             : int gpgme_get_include_certs (gpgme_ctx_t ctx);
     889             : 
     890             : /* Set keylist mode in CTX to MODE.  */
     891             : gpgme_error_t gpgme_set_keylist_mode (gpgme_ctx_t ctx,
     892             :                                       gpgme_keylist_mode_t mode);
     893             : 
     894             : /* Get keylist mode in CTX.  */
     895             : gpgme_keylist_mode_t gpgme_get_keylist_mode (gpgme_ctx_t ctx);
     896             : 
     897             : /* Set the pinentry mode for CTX to MODE. */
     898             : gpgme_error_t gpgme_set_pinentry_mode (gpgme_ctx_t ctx,
     899             :                                        gpgme_pinentry_mode_t mode);
     900             : 
     901             : /* Get the pinentry mode of CTX.  */
     902             : gpgme_pinentry_mode_t gpgme_get_pinentry_mode (gpgme_ctx_t ctx);
     903             : 
     904             : /* Set the passphrase callback function in CTX to CB.  HOOK_VALUE is
     905             :    passed as first argument to the passphrase callback function.  */
     906             : void gpgme_set_passphrase_cb (gpgme_ctx_t ctx,
     907             :                               gpgme_passphrase_cb_t cb, void *hook_value);
     908             : 
     909             : /* Get the current passphrase callback function in *CB and the current
     910             :    hook value in *HOOK_VALUE.  */
     911             : void gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *cb,
     912             :                               void **hook_value);
     913             : 
     914             : /* Set the progress callback function in CTX to CB.  HOOK_VALUE is
     915             :    passed as first argument to the progress callback function.  */
     916             : void gpgme_set_progress_cb (gpgme_ctx_t c, gpgme_progress_cb_t cb,
     917             :                             void *hook_value);
     918             : 
     919             : /* Get the current progress callback function in *CB and the current
     920             :    hook value in *HOOK_VALUE.  */
     921             : void gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *cb,
     922             :                             void **hook_value);
     923             : 
     924             : /* Set the status callback function in CTX to CB.  HOOK_VALUE is
     925             :    passed as first argument to the status callback function.  */
     926             : void gpgme_set_status_cb (gpgme_ctx_t c, gpgme_status_cb_t cb,
     927             :                           void *hook_value);
     928             : 
     929             : /* Get the current status callback function in *CB and the current
     930             :    hook value in *HOOK_VALUE.  */
     931             : void gpgme_get_status_cb (gpgme_ctx_t ctx, gpgme_status_cb_t *cb,
     932             :                           void **hook_value);
     933             : 
     934             : /* This function sets the locale for the context CTX, or the default
     935             :    locale if CTX is a null pointer.  */
     936             : gpgme_error_t gpgme_set_locale (gpgme_ctx_t ctx, int category,
     937             :                                 const char *value);
     938             : 
     939             : /* Get the information about the configured engines.  A pointer to the
     940             :    first engine in the statically allocated linked list is returned.
     941             :    The returned data is valid until the next gpgme_ctx_set_engine_info.  */
     942             : gpgme_engine_info_t gpgme_ctx_get_engine_info (gpgme_ctx_t ctx);
     943             : 
     944             : /* Set the engine info for the context CTX, protocol PROTO, to the
     945             :    file name FILE_NAME and the home directory HOME_DIR.  */
     946             : gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx,
     947             :                                          gpgme_protocol_t proto,
     948             :                                          const char *file_name,
     949             :                                          const char *home_dir);
     950             : 
     951             : /* Delete all signers from CTX.  */
     952             : void gpgme_signers_clear (gpgme_ctx_t ctx);
     953             : 
     954             : /* Add KEY to list of signers in CTX.  */
     955             : gpgme_error_t gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key);
     956             : 
     957             : /* Return the number of signers in CTX.  */
     958             : unsigned int gpgme_signers_count (const gpgme_ctx_t ctx);
     959             : 
     960             : /* Return the SEQth signer's key in CTX.  */
     961             : gpgme_key_t gpgme_signers_enum (const gpgme_ctx_t ctx, int seq);
     962             : 
     963             : /* Clear all notation data from the context.  */
     964             : void gpgme_sig_notation_clear (gpgme_ctx_t ctx);
     965             : 
     966             : /* Add the human-readable notation data with name NAME and value VALUE
     967             :    to the context CTX, using the flags FLAGS.  If NAME is NULL, then
     968             :    VALUE should be a policy URL.  The flag
     969             :    GPGME_SIG_NOTATION_HUMAN_READABLE is forced to be true for notation
     970             :    data, and false for policy URLs.  */
     971             : gpgme_error_t gpgme_sig_notation_add (gpgme_ctx_t ctx, const char *name,
     972             :                                       const char *value,
     973             :                                       gpgme_sig_notation_flags_t flags);
     974             : 
     975             : /* Get the sig notations for this context.  */
     976             : gpgme_sig_notation_t gpgme_sig_notation_get (gpgme_ctx_t ctx);
     977             : 
     978             : /* Store a sender address in the context.  */
     979             : gpgme_error_t gpgme_set_sender (gpgme_ctx_t ctx, const char *address);
     980             : 
     981             : /* Get the sender address from the context.  */
     982             : const char *gpgme_get_sender (gpgme_ctx_t ctx);
     983             : 
     984             : 
     985             : 
     986             : /*
     987             :  * Run control.
     988             :  */
     989             : 
     990             : /* The type of an I/O callback function.  */
     991             : typedef gpgme_error_t (*gpgme_io_cb_t) (void *data, int fd);
     992             : 
     993             : /* The type of a function that can register FNC as the I/O callback
     994             :    function for the file descriptor FD with direction dir (0: for writing,
     995             :    1: for reading).  FNC_DATA should be passed as DATA to FNC.  The
     996             :    function should return a TAG suitable for the corresponding
     997             :    gpgme_remove_io_cb_t, and an error value.  */
     998             : typedef gpgme_error_t (*gpgme_register_io_cb_t) (void *data, int fd, int dir,
     999             :                                                  gpgme_io_cb_t fnc,
    1000             :                                                  void *fnc_data, void **tag);
    1001             : 
    1002             : /* The type of a function that can remove a previously registered I/O
    1003             :    callback function given TAG as returned by the register
    1004             :    function.  */
    1005             : typedef void (*gpgme_remove_io_cb_t) (void *tag);
    1006             : 
    1007             : typedef enum
    1008             :   {
    1009             :     GPGME_EVENT_START,
    1010             :     GPGME_EVENT_DONE,
    1011             :     GPGME_EVENT_NEXT_KEY,
    1012             :     GPGME_EVENT_NEXT_TRUSTITEM
    1013             :   }
    1014             : gpgme_event_io_t;
    1015             : 
    1016             : struct gpgme_io_event_done_data
    1017             : {
    1018             :   /* A fatal IPC error or an operational error in state-less
    1019             :      protocols.  */
    1020             :   gpgme_error_t err;
    1021             : 
    1022             :   /* An operational errors in session-based protocols.  */
    1023             :   gpgme_error_t op_err;
    1024             : };
    1025             : typedef struct gpgme_io_event_done_data *gpgme_io_event_done_data_t;
    1026             : 
    1027             : /* The type of a function that is called when a context finished an
    1028             :    operation.  */
    1029             : typedef void (*gpgme_event_io_cb_t) (void *data, gpgme_event_io_t type,
    1030             :                                      void *type_data);
    1031             : 
    1032             : struct gpgme_io_cbs
    1033             : {
    1034             :   gpgme_register_io_cb_t add;
    1035             :   void *add_priv;
    1036             :   gpgme_remove_io_cb_t remove;
    1037             :   gpgme_event_io_cb_t event;
    1038             :   void *event_priv;
    1039             : };
    1040             : typedef struct gpgme_io_cbs *gpgme_io_cbs_t;
    1041             : 
    1042             : /* Set the I/O callback functions in CTX to IO_CBS.  */
    1043             : void gpgme_set_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
    1044             : 
    1045             : /* Get the current I/O callback functions.  */
    1046             : void gpgme_get_io_cbs (gpgme_ctx_t ctx, gpgme_io_cbs_t io_cbs);
    1047             : 
    1048             : /* Wrappers around the internal I/O functions for use with
    1049             :    gpgme_passphrase_cb_t and gpgme_interact_cb_t.  */
    1050             : ssize_t gpgme_io_read (int fd, void *buffer, size_t count);
    1051             : ssize_t gpgme_io_write (int fd, const void *buffer, size_t count);
    1052             : int     gpgme_io_writen (int fd, const void *buffer, size_t count);
    1053             : 
    1054             : /* Process the pending operation and, if HANG is non-zero, wait for
    1055             :    the pending operation to finish.  */
    1056             : gpgme_ctx_t gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang);
    1057             : 
    1058             : gpgme_ctx_t gpgme_wait_ext (gpgme_ctx_t ctx, gpgme_error_t *status,
    1059             :                             gpgme_error_t *op_err, int hang);
    1060             : 
    1061             : /* Cancel a pending asynchronous operation.  */
    1062             : gpgme_error_t gpgme_cancel (gpgme_ctx_t ctx);
    1063             : 
    1064             : /* Cancel a pending operation asynchronously.  */
    1065             : gpgme_error_t gpgme_cancel_async (gpgme_ctx_t ctx);
    1066             : 
    1067             : 
    1068             : 
    1069             : /*
    1070             :  * Functions to handle data objects.
    1071             :  */
    1072             : 
    1073             : /* Read up to SIZE bytes into buffer BUFFER from the data object with
    1074             :    the handle HANDLE.  Return the number of characters read, 0 on EOF
    1075             :    and -1 on error.  If an error occurs, errno is set.  */
    1076             : typedef ssize_t (*gpgme_data_read_cb_t) (void *handle, void *buffer,
    1077             :                                          size_t size);
    1078             : 
    1079             : /* Write up to SIZE bytes from buffer BUFFER to the data object with
    1080             :    the handle HANDLE.  Return the number of characters written, or -1
    1081             :    on error.  If an error occurs, errno is set.  */
    1082             : typedef ssize_t (*gpgme_data_write_cb_t) (void *handle, const void *buffer,
    1083             :                                           size_t size);
    1084             : 
    1085             : /* Set the current position from where the next read or write starts
    1086             :    in the data object with the handle HANDLE to OFFSET, relativ to
    1087             :    WHENCE.  Returns the new offset in bytes from the beginning of the
    1088             :    data object.  */
    1089             : typedef off_t (*gpgme_data_seek_cb_t) (void *handle,
    1090             :                                        off_t offset, int whence);
    1091             : 
    1092             : /* Close the data object with the handle HANDLE.  */
    1093             : typedef void (*gpgme_data_release_cb_t) (void *handle);
    1094             : 
    1095             : struct gpgme_data_cbs
    1096             : {
    1097             :   gpgme_data_read_cb_t read;
    1098             :   gpgme_data_write_cb_t write;
    1099             :   gpgme_data_seek_cb_t seek;
    1100             :   gpgme_data_release_cb_t release;
    1101             : };
    1102             : typedef struct gpgme_data_cbs *gpgme_data_cbs_t;
    1103             : 
    1104             : /* Read up to SIZE bytes into buffer BUFFER from the data object with
    1105             :    the handle DH.  Return the number of characters read, 0 on EOF and
    1106             :    -1 on error.  If an error occurs, errno is set.  */
    1107             : ssize_t gpgme_data_read (gpgme_data_t dh, void *buffer, size_t size);
    1108             : 
    1109             : /* Write up to SIZE bytes from buffer BUFFER to the data object with
    1110             :    the handle DH.  Return the number of characters written, or -1 on
    1111             :    error.  If an error occurs, errno is set.  */
    1112             : ssize_t gpgme_data_write (gpgme_data_t dh, const void *buffer, size_t size);
    1113             : 
    1114             : /* Set the current position from where the next read or write starts
    1115             :    in the data object with the handle DH to OFFSET, relativ to WHENCE.
    1116             :    Returns the new offset in bytes from the beginning of the data
    1117             :    object.  */
    1118             : off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence);
    1119             : 
    1120             : /* Create a new data buffer and return it in R_DH.  */
    1121             : gpgme_error_t gpgme_data_new (gpgme_data_t *r_dh);
    1122             : 
    1123             : /* Destroy the data buffer DH.  */
    1124             : void gpgme_data_release (gpgme_data_t dh);
    1125             : 
    1126             : /* Create a new data buffer filled with SIZE bytes starting from
    1127             :    BUFFER.  If COPY is zero, copying is delayed until necessary, and
    1128             :    the data is taken from the original location when needed.  */
    1129             : gpgme_error_t gpgme_data_new_from_mem (gpgme_data_t *r_dh,
    1130             :                                        const char *buffer, size_t size,
    1131             :                                        int copy);
    1132             : 
    1133             : /* Destroy the data buffer DH and return a pointer to its content.
    1134             :    The memory has be to released with gpgme_free() by the user.  It's
    1135             :    size is returned in R_LEN.  */
    1136             : char *gpgme_data_release_and_get_mem (gpgme_data_t dh, size_t *r_len);
    1137             : 
    1138             : /* Release the memory returned by gpgme_data_release_and_get_mem() and
    1139             :    some other functions.  */
    1140             : void gpgme_free (void *buffer);
    1141             : 
    1142             : gpgme_error_t gpgme_data_new_from_cbs (gpgme_data_t *dh,
    1143             :                                        gpgme_data_cbs_t cbs,
    1144             :                                        void *handle);
    1145             : 
    1146             : gpgme_error_t gpgme_data_new_from_fd (gpgme_data_t *dh, int fd);
    1147             : 
    1148             : gpgme_error_t gpgme_data_new_from_stream (gpgme_data_t *dh, FILE *stream);
    1149             : 
    1150             : /* Return the encoding attribute of the data buffer DH */
    1151             : gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh);
    1152             : 
    1153             : /* Set the encoding attribute of data buffer DH to ENC */
    1154             : gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh,
    1155             :                                        gpgme_data_encoding_t enc);
    1156             : 
    1157             : /* Get the file name associated with the data object with handle DH, or
    1158             :    NULL if there is none.  */
    1159             : char *gpgme_data_get_file_name (gpgme_data_t dh);
    1160             : 
    1161             : /* Set the file name associated with the data object with handle DH to
    1162             :    FILE_NAME.  */
    1163             : gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh,
    1164             :                                         const char *file_name);
    1165             : 
    1166             : /* Set a flag for the data object DH.  See the manual for details.  */
    1167             : gpg_error_t gpgme_data_set_flag (gpgme_data_t dh,
    1168             :                                  const char *name, const char *value);
    1169             : 
    1170             : /* Try to identify the type of the data in DH.  */
    1171             : gpgme_data_type_t gpgme_data_identify (gpgme_data_t dh, int reserved);
    1172             : 
    1173             : 
    1174             : /* Create a new data buffer filled with the content of file FNAME.
    1175             :    COPY must be non-zero.  For delayed read, please use
    1176             :    gpgme_data_new_from_fd or gpgme_data_new_from_stream instead.  */
    1177             : gpgme_error_t gpgme_data_new_from_file (gpgme_data_t *r_dh,
    1178             :                                         const char *fname,
    1179             :                                         int copy);
    1180             : 
    1181             : /* Create a new data buffer filled with LENGTH bytes starting from
    1182             :    OFFSET within the file FNAME or stream FP (exactly one must be
    1183             :    non-zero).  */
    1184             : gpgme_error_t gpgme_data_new_from_filepart (gpgme_data_t *r_dh,
    1185             :                                             const char *fname, FILE *fp,
    1186             :                                             off_t offset, size_t length);
    1187             : 
    1188             : /* Convenience function to do a gpgme_data_seek (dh, 0, SEEK_SET).  */
    1189             : gpgme_error_t gpgme_data_rewind (gpgme_data_t dh);
    1190             : 
    1191             : 
    1192             : 
    1193             : /*
    1194             :  * Key and trust functions.
    1195             :  */
    1196             : 
    1197             : /* Get the key with the fingerprint FPR from the crypto backend.  If
    1198             :    SECRET is true, get the secret key.  */
    1199             : gpgme_error_t gpgme_get_key (gpgme_ctx_t ctx, const char *fpr,
    1200             :                              gpgme_key_t *r_key, int secret);
    1201             : 
    1202             : /* Create a dummy key to specify an email address.  */
    1203             : gpgme_error_t gpgme_key_from_uid (gpgme_key_t *key, const char *name);
    1204             : 
    1205             : /* Acquire a reference to KEY.  */
    1206             : void gpgme_key_ref (gpgme_key_t key);
    1207             : 
    1208             : /* Release a reference to KEY.  If this was the last one the key is
    1209             :    destroyed.  */
    1210             : void gpgme_key_unref (gpgme_key_t key);
    1211             : void gpgme_key_release (gpgme_key_t key);
    1212             : 
    1213             : 
    1214             : 
    1215             : /*
    1216             :  * Encryption.
    1217             :  */
    1218             : 
    1219             : /* An object to return results from an encryption operation.
    1220             :  * This structure shall be considered read-only and an application
    1221             :  * must not allocate such a structure on its own.  */
    1222             : struct _gpgme_op_encrypt_result
    1223             : {
    1224             :   /* The list of invalid recipients.  */
    1225             :   gpgme_invalid_key_t invalid_recipients;
    1226             : };
    1227             : typedef struct _gpgme_op_encrypt_result *gpgme_encrypt_result_t;
    1228             : 
    1229             : /* Retrieve a pointer to the result of the encrypt operation.  */
    1230             : gpgme_encrypt_result_t gpgme_op_encrypt_result (gpgme_ctx_t ctx);
    1231             : 
    1232             : /* The valid encryption flags.  */
    1233             : typedef enum
    1234             :   {
    1235             :     GPGME_ENCRYPT_ALWAYS_TRUST = 1,
    1236             :     GPGME_ENCRYPT_NO_ENCRYPT_TO = 2,
    1237             :     GPGME_ENCRYPT_PREPARE = 4,
    1238             :     GPGME_ENCRYPT_EXPECT_SIGN = 8,
    1239             :     GPGME_ENCRYPT_NO_COMPRESS = 16,
    1240             :     GPGME_ENCRYPT_SYMMETRIC = 32
    1241             :   }
    1242             : gpgme_encrypt_flags_t;
    1243             : 
    1244             : /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
    1245             :    store the resulting ciphertext in CIPHER.  */
    1246             : gpgme_error_t gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_key_t recp[],
    1247             :                                       gpgme_encrypt_flags_t flags,
    1248             :                                       gpgme_data_t plain, gpgme_data_t cipher);
    1249             : gpgme_error_t gpgme_op_encrypt (gpgme_ctx_t ctx, gpgme_key_t recp[],
    1250             :                                 gpgme_encrypt_flags_t flags,
    1251             :                                 gpgme_data_t plain, gpgme_data_t cipher);
    1252             : 
    1253             : /* Encrypt plaintext PLAIN within CTX for the recipients RECP and
    1254             :    store the resulting ciphertext in CIPHER.  Also sign the ciphertext
    1255             :    with the signers in CTX.  */
    1256             : gpgme_error_t gpgme_op_encrypt_sign_start (gpgme_ctx_t ctx,
    1257             :                                            gpgme_key_t recp[],
    1258             :                                            gpgme_encrypt_flags_t flags,
    1259             :                                            gpgme_data_t plain,
    1260             :                                            gpgme_data_t cipher);
    1261             : gpgme_error_t gpgme_op_encrypt_sign (gpgme_ctx_t ctx, gpgme_key_t recp[],
    1262             :                                      gpgme_encrypt_flags_t flags,
    1263             :                                      gpgme_data_t plain, gpgme_data_t cipher);
    1264             : 
    1265             : 
    1266             : /*
    1267             :  * Decryption.
    1268             :  */
    1269             : 
    1270             : /* An object to hold information about a recipient.
    1271             :  * This structure shall be considered read-only and an application
    1272             :  * must not allocate such a structure on its own.  */
    1273             : struct _gpgme_recipient
    1274             : {
    1275             :   struct _gpgme_recipient *next;
    1276             : 
    1277             :   /* The key ID of key for which the text was encrypted.  */
    1278             :   char *keyid;
    1279             : 
    1280             :   /* Internal to GPGME, do not use.  */
    1281             :   char _keyid[16 + 1];
    1282             : 
    1283             :   /* The public key algorithm of the recipient key.  */
    1284             :   gpgme_pubkey_algo_t pubkey_algo;
    1285             : 
    1286             :   /* The status of the recipient.  */
    1287             :   gpgme_error_t status;
    1288             : };
    1289             : typedef struct _gpgme_recipient *gpgme_recipient_t;
    1290             : 
    1291             : /* An object to return results from a decryption operation.
    1292             :  * This structure shall be considered read-only and an application
    1293             :  * must not allocate such a structure on its own.  */
    1294             : struct _gpgme_op_decrypt_result
    1295             : {
    1296             :   char *unsupported_algorithm;
    1297             : 
    1298             :   /* Key should not have been used for encryption.  */
    1299             :   unsigned int wrong_key_usage : 1;
    1300             : 
    1301             :   /* Internal to GPGME, do not use.  */
    1302             :   int _unused : 31;
    1303             : 
    1304             :   gpgme_recipient_t recipients;
    1305             : 
    1306             :   /* The original file name of the plaintext message, if
    1307             :      available.  */
    1308             :   char *file_name;
    1309             : 
    1310             :   /* A textual representation of the session key used to decrypt the
    1311             :    * message, if available */
    1312             :   char *session_key;
    1313             : };
    1314             : typedef struct _gpgme_op_decrypt_result *gpgme_decrypt_result_t;
    1315             : 
    1316             : /* Retrieve a pointer to the result of the decrypt operation.  */
    1317             : gpgme_decrypt_result_t gpgme_op_decrypt_result (gpgme_ctx_t ctx);
    1318             : 
    1319             : /* Decrypt ciphertext CIPHER within CTX and store the resulting
    1320             :    plaintext in PLAIN.  */
    1321             : gpgme_error_t gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
    1322             :                                       gpgme_data_t plain);
    1323             : gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t ctx,
    1324             :                                 gpgme_data_t cipher, gpgme_data_t plain);
    1325             : 
    1326             : /* Decrypt ciphertext CIPHER and make a signature verification within
    1327             :    CTX and store the resulting plaintext in PLAIN.  */
    1328             : gpgme_error_t gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx,
    1329             :                                              gpgme_data_t cipher,
    1330             :                                              gpgme_data_t plain);
    1331             : gpgme_error_t gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher,
    1332             :                                        gpgme_data_t plain);
    1333             : 
    1334             : 
    1335             : /*
    1336             :  * Signing.
    1337             :  */
    1338             : 
    1339             : /* An object with signatures data.
    1340             :  * This structure shall be considered read-only and an application
    1341             :  * must not allocate such a structure on its own.  */
    1342             : struct _gpgme_new_signature
    1343             : {
    1344             :   struct _gpgme_new_signature *next;
    1345             : 
    1346             :   /* The type of the signature.  */
    1347             :   gpgme_sig_mode_t type;
    1348             : 
    1349             :   /* The public key algorithm used to create the signature.  */
    1350             :   gpgme_pubkey_algo_t pubkey_algo;
    1351             : 
    1352             :   /* The hash algorithm used to create the signature.  */
    1353             :   gpgme_hash_algo_t hash_algo;
    1354             : 
    1355             :   /* Internal to GPGME, do not use.  Must be set to the same value as
    1356             :      CLASS below.  */
    1357             :   unsigned long _obsolete_class;
    1358             : 
    1359             :   /* Signature creation time.  */
    1360             :   long int timestamp;
    1361             : 
    1362             :   /* The fingerprint of the signature.  */
    1363             :   char *fpr;
    1364             : 
    1365             : #ifdef __cplusplus
    1366             :   unsigned int _obsolete_class_2;
    1367             : #else
    1368             :   /* Must be set to SIG_CLASS below.  */
    1369             :   unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
    1370             : #endif
    1371             : 
    1372             :   /* Crypto backend specific signature class.  */
    1373             :   unsigned int sig_class;
    1374             : };
    1375             : typedef struct _gpgme_new_signature *gpgme_new_signature_t;
    1376             : 
    1377             : 
    1378             : /* An object to return results from a signing operation.
    1379             :  * This structure shall be considered read-only and an application
    1380             :  * must not allocate such a structure on its own.  */
    1381             : struct _gpgme_op_sign_result
    1382             : {
    1383             :   /* The list of invalid signers.  */
    1384             :   gpgme_invalid_key_t invalid_signers;
    1385             :   gpgme_new_signature_t signatures;
    1386             : };
    1387             : typedef struct _gpgme_op_sign_result *gpgme_sign_result_t;
    1388             : 
    1389             : /* Retrieve a pointer to the result of the signing operation.  */
    1390             : gpgme_sign_result_t gpgme_op_sign_result (gpgme_ctx_t ctx);
    1391             : 
    1392             : /* Sign the plaintext PLAIN and store the signature in SIG.  */
    1393             : gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx,
    1394             :                                    gpgme_data_t plain, gpgme_data_t sig,
    1395             :                                    gpgme_sig_mode_t mode);
    1396             : gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx,
    1397             :                              gpgme_data_t plain, gpgme_data_t sig,
    1398             :                              gpgme_sig_mode_t mode);
    1399             : 
    1400             : 
    1401             : /*
    1402             :  * Verify.
    1403             :  */
    1404             : 
    1405             : /* Flags used for the SUMMARY field in a gpgme_signature_t.  */
    1406             : typedef enum
    1407             :   {
    1408             :     GPGME_SIGSUM_VALID       = 0x0001,  /* The signature is fully valid.  */
    1409             :     GPGME_SIGSUM_GREEN       = 0x0002,  /* The signature is good.  */
    1410             :     GPGME_SIGSUM_RED         = 0x0004,  /* The signature is bad.  */
    1411             :     GPGME_SIGSUM_KEY_REVOKED = 0x0010,  /* One key has been revoked.  */
    1412             :     GPGME_SIGSUM_KEY_EXPIRED = 0x0020,  /* One key has expired.  */
    1413             :     GPGME_SIGSUM_SIG_EXPIRED = 0x0040,  /* The signature has expired.  */
    1414             :     GPGME_SIGSUM_KEY_MISSING = 0x0080,  /* Can't verify: key missing.  */
    1415             :     GPGME_SIGSUM_CRL_MISSING = 0x0100,  /* CRL not available.  */
    1416             :     GPGME_SIGSUM_CRL_TOO_OLD = 0x0200,  /* Available CRL is too old.  */
    1417             :     GPGME_SIGSUM_BAD_POLICY  = 0x0400,  /* A policy was not met.  */
    1418             :     GPGME_SIGSUM_SYS_ERROR   = 0x0800,  /* A system error occurred.  */
    1419             :     GPGME_SIGSUM_TOFU_CONFLICT=0x1000   /* Tofu conflict detected.  */
    1420             :   }
    1421             : gpgme_sigsum_t;
    1422             : 
    1423             : 
    1424             : /* An object to hold the verification status of a signature.
    1425             :  * This structure shall be considered read-only and an application
    1426             :  * must not allocate such a structure on its own.  */
    1427             : struct _gpgme_signature
    1428             : {
    1429             :   struct _gpgme_signature *next;
    1430             : 
    1431             :   /* A summary of the signature status.  */
    1432             :   gpgme_sigsum_t summary;
    1433             : 
    1434             :   /* The fingerprint of the signature.  This can be a subkey.  */
    1435             :   char *fpr;
    1436             : 
    1437             :   /* The status of the signature.  */
    1438             :   gpgme_error_t status;
    1439             : 
    1440             :   /* Notation data and policy URLs.  */
    1441             :   gpgme_sig_notation_t notations;
    1442             : 
    1443             :   /* Signature creation time.  */
    1444             :   unsigned long timestamp;
    1445             : 
    1446             :   /* Signature expiration time or 0.  */
    1447             :   unsigned long exp_timestamp;
    1448             : 
    1449             :   /* Key should not have been used for signing.  */
    1450             :   unsigned int wrong_key_usage : 1;
    1451             : 
    1452             :   /* PKA status: 0 = not available, 1 = bad, 2 = okay, 3 = RFU. */
    1453             :   unsigned int pka_trust : 2;
    1454             : 
    1455             :   /* Validity has been verified using the chain model. */
    1456             :   unsigned int chain_model : 1;
    1457             : 
    1458             :   /* Internal to GPGME, do not use.  */
    1459             :   int _unused : 28;
    1460             : 
    1461             :   gpgme_validity_t validity;
    1462             :   gpgme_error_t validity_reason;
    1463             : 
    1464             :   /* The public key algorithm used to create the signature.  */
    1465             :   gpgme_pubkey_algo_t pubkey_algo;
    1466             : 
    1467             :   /* The hash algorithm used to create the signature.  */
    1468             :   gpgme_hash_algo_t hash_algo;
    1469             : 
    1470             :   /* The mailbox from the PKA information or NULL. */
    1471             :   char *pka_address;
    1472             : 
    1473             :   /* If non-NULL, a possible incomplete key object with the data
    1474             :    * available for the signature.  */
    1475             :   gpgme_key_t key;
    1476             : };
    1477             : typedef struct _gpgme_signature *gpgme_signature_t;
    1478             : 
    1479             : /* An object to return the results of a verify operation.
    1480             :  * This structure shall be considered read-only and an application
    1481             :  * must not allocate such a structure on its own.  */
    1482             : struct _gpgme_op_verify_result
    1483             : {
    1484             :   gpgme_signature_t signatures;
    1485             : 
    1486             :   /* The original file name of the plaintext message, if
    1487             :      available.  */
    1488             :   char *file_name;
    1489             : };
    1490             : typedef struct _gpgme_op_verify_result *gpgme_verify_result_t;
    1491             : 
    1492             : /* Retrieve a pointer to the result of the verify operation.  */
    1493             : gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx);
    1494             : 
    1495             : /* Verify within CTX that SIG is a valid signature for TEXT.  */
    1496             : gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig,
    1497             :                                      gpgme_data_t signed_text,
    1498             :                                      gpgme_data_t plaintext);
    1499             : gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig,
    1500             :                                gpgme_data_t signed_text,
    1501             :                                gpgme_data_t plaintext);
    1502             : 
    1503             : 
    1504             : /*
    1505             :  * Import/Export
    1506             :  */
    1507             : 
    1508             : #define GPGME_IMPORT_NEW        1  /* The key was new.  */
    1509             : #define GPGME_IMPORT_UID        2  /* The key contained new user IDs.  */
    1510             : #define GPGME_IMPORT_SIG        4  /* The key contained new signatures.  */
    1511             : #define GPGME_IMPORT_SUBKEY     8  /* The key contained new sub keys.  */
    1512             : #define GPGME_IMPORT_SECRET    16  /* The key contained a secret key.  */
    1513             : 
    1514             : 
    1515             : /* An object to hold results for one imported key.
    1516             :  * This structure shall be considered read-only and an application
    1517             :  * must not allocate such a structure on its own.  */
    1518             : struct _gpgme_import_status
    1519             : {
    1520             :   struct _gpgme_import_status *next;
    1521             : 
    1522             :   /* Fingerprint.  */
    1523             :   char *fpr;
    1524             : 
    1525             :   /* If a problem occurred, the reason why the key could not be
    1526             :      imported.  Otherwise GPGME_No_Error.  */
    1527             :   gpgme_error_t result;
    1528             : 
    1529             :   /* The result of the import, the GPGME_IMPORT_* values bit-wise
    1530             :      ORed.  0 means the key was already known and no new components
    1531             :      have been added.  */
    1532             :   unsigned int status;
    1533             : };
    1534             : typedef struct _gpgme_import_status *gpgme_import_status_t;
    1535             : 
    1536             : /* Import result object.
    1537             :  * This structure shall be considered read-only and an application
    1538             :  * must not allocate such a structure on its own.  */
    1539             : struct _gpgme_op_import_result
    1540             : {
    1541             :   /* Number of considered keys.  */
    1542             :   int considered;
    1543             : 
    1544             :   /* Keys without user ID.  */
    1545             :   int no_user_id;
    1546             : 
    1547             :   /* Imported keys.  */
    1548             :   int imported;
    1549             : 
    1550             :   /* Imported RSA keys.  */
    1551             :   int imported_rsa;
    1552             : 
    1553             :   /* Unchanged keys.  */
    1554             :   int unchanged;
    1555             : 
    1556             :   /* Number of new user ids.  */
    1557             :   int new_user_ids;
    1558             : 
    1559             :   /* Number of new sub keys.  */
    1560             :   int new_sub_keys;
    1561             : 
    1562             :   /* Number of new signatures.  */
    1563             :   int new_signatures;
    1564             : 
    1565             :   /* Number of new revocations.  */
    1566             :   int new_revocations;
    1567             : 
    1568             :   /* Number of secret keys read.  */
    1569             :   int secret_read;
    1570             : 
    1571             :   /* Number of secret keys imported.  */
    1572             :   int secret_imported;
    1573             : 
    1574             :   /* Number of secret keys unchanged.  */
    1575             :   int secret_unchanged;
    1576             : 
    1577             :   /* Number of new keys skipped.  */
    1578             :   int skipped_new_keys;
    1579             : 
    1580             :   /* Number of keys not imported.  */
    1581             :   int not_imported;
    1582             : 
    1583             :   /* List of keys for which an import was attempted.  */
    1584             :   gpgme_import_status_t imports;
    1585             : };
    1586             : typedef struct _gpgme_op_import_result *gpgme_import_result_t;
    1587             : 
    1588             : /* Retrieve a pointer to the result of the import operation.  */
    1589             : gpgme_import_result_t gpgme_op_import_result (gpgme_ctx_t ctx);
    1590             : 
    1591             : /* Import the key in KEYDATA into the keyring.  */
    1592             : gpgme_error_t gpgme_op_import_start (gpgme_ctx_t ctx, gpgme_data_t keydata);
    1593             : gpgme_error_t gpgme_op_import (gpgme_ctx_t ctx, gpgme_data_t keydata);
    1594             : 
    1595             : /* Import the keys from the array KEYS into the keyring.  */
    1596             : gpgme_error_t gpgme_op_import_keys_start (gpgme_ctx_t ctx, gpgme_key_t keys[]);
    1597             : gpgme_error_t gpgme_op_import_keys (gpgme_ctx_t ctx, gpgme_key_t keys[]);
    1598             : 
    1599             : 
    1600             : /* Export the keys found by PATTERN into KEYDATA.  */
    1601             : gpgme_error_t gpgme_op_export_start (gpgme_ctx_t ctx, const char *pattern,
    1602             :                                      gpgme_export_mode_t mode,
    1603             :                                      gpgme_data_t keydata);
    1604             : gpgme_error_t gpgme_op_export (gpgme_ctx_t ctx, const char *pattern,
    1605             :                                gpgme_export_mode_t mode,
    1606             :                                gpgme_data_t keydata);
    1607             : 
    1608             : gpgme_error_t gpgme_op_export_ext_start (gpgme_ctx_t ctx,
    1609             :                                          const char *pattern[],
    1610             :                                          gpgme_export_mode_t mode,
    1611             :                                          gpgme_data_t keydata);
    1612             : gpgme_error_t gpgme_op_export_ext (gpgme_ctx_t ctx, const char *pattern[],
    1613             :                                    gpgme_export_mode_t mode,
    1614             :                                    gpgme_data_t keydata);
    1615             : 
    1616             : /* Export the keys from the array KEYS into KEYDATA.  */
    1617             : gpgme_error_t gpgme_op_export_keys_start (gpgme_ctx_t ctx,
    1618             :                                           gpgme_key_t keys[],
    1619             :                                           gpgme_export_mode_t mode,
    1620             :                                           gpgme_data_t keydata);
    1621             : gpgme_error_t gpgme_op_export_keys (gpgme_ctx_t ctx,
    1622             :                                     gpgme_key_t keys[],
    1623             :                                     gpgme_export_mode_t mode,
    1624             :                                     gpgme_data_t keydata);
    1625             : 
    1626             : 
    1627             : 
    1628             : /*
    1629             :  * Key generation.
    1630             :  */
    1631             : 
    1632             : /* Flags for the key creation functions.  */
    1633             : #define GPGME_CREATE_SIGN       (1 << 0)  /* Allow usage: signing.     */
    1634             : #define GPGME_CREATE_ENCR       (1 << 1)  /* Allow usage: encryption.  */
    1635             : #define GPGME_CREATE_CERT       (1 << 2)  /* Allow usage: certification.  */
    1636             : #define GPGME_CREATE_AUTH       (1 << 3)  /* Allow usage: authentication.  */
    1637             : #define GPGME_CREATE_NOPASSWD   (1 << 7)  /* Create w/o passphrase.    */
    1638             : #define GPGME_CREATE_SELFSIGNED (1 << 8)  /* Create self-signed cert.  */
    1639             : #define GPGME_CREATE_NOSTORE    (1 << 9)  /* Do not store the key.     */
    1640             : #define GPGME_CREATE_WANTPUB    (1 << 10) /* Return the public key.    */
    1641             : #define GPGME_CREATE_WANTSEC    (1 << 11) /* Return the secret key.    */
    1642             : #define GPGME_CREATE_FORCE      (1 << 12) /* Force creation.           */
    1643             : #define GPGME_CREATE_NOEXPIRE   (1 << 13) /* Create w/o expiration.    */
    1644             : 
    1645             : /* An object to return result from a key generation.
    1646             :  * This structure shall be considered read-only and an application
    1647             :  * must not allocate such a structure on its own.  */
    1648             : struct _gpgme_op_genkey_result
    1649             : {
    1650             :   /* A primary key was generated.  */
    1651             :   unsigned int primary : 1;
    1652             : 
    1653             :   /* A sub key was generated.  */
    1654             :   unsigned int sub : 1;
    1655             : 
    1656             :   /* A user id was generated.  */
    1657             :   unsigned int uid : 1;
    1658             : 
    1659             :   /* Internal to GPGME, do not use.  */
    1660             :   unsigned int _unused : 29;
    1661             : 
    1662             :   /* The fingerprint of the generated key.  */
    1663             :   char *fpr;
    1664             : 
    1665             :   /* A memory data object with the created public key.  Only set when
    1666             :    * GPGME_CREATE_WANTPUB has been used. */
    1667             :   gpgme_data_t pubkey;
    1668             : 
    1669             :   /* A memory data object with the created secret key.  Only set when
    1670             :    * GPGME_CREATE_WANTSEC has been used. */
    1671             :   gpgme_data_t seckey;
    1672             : };
    1673             : typedef struct _gpgme_op_genkey_result *gpgme_genkey_result_t;
    1674             : 
    1675             : /* Generate a new keypair and add it to the keyring.  PUBKEY and
    1676             :    SECKEY should be null for now.  PARMS specifies what keys should be
    1677             :    generated.  */
    1678             : gpgme_error_t gpgme_op_genkey_start (gpgme_ctx_t ctx, const char *parms,
    1679             :                                      gpgme_data_t pubkey, gpgme_data_t seckey);
    1680             : gpgme_error_t gpgme_op_genkey (gpgme_ctx_t ctx, const char *parms,
    1681             :                                gpgme_data_t pubkey, gpgme_data_t seckey);
    1682             : 
    1683             : /* Generate a key pair using the modern interface.  */
    1684             : gpgme_error_t gpgme_op_createkey_start (gpgme_ctx_t ctx,
    1685             :                                         const char *userid,
    1686             :                                         const char *algo,
    1687             :                                         unsigned long reserved,
    1688             :                                         unsigned long expires,
    1689             :                                         gpgme_key_t certkey,
    1690             :                                         unsigned int flags);
    1691             : gpgme_error_t gpgme_op_createkey       (gpgme_ctx_t ctx,
    1692             :                                         const char *userid,
    1693             :                                         const char *algo,
    1694             :                                         unsigned long reserved,
    1695             :                                         unsigned long expires,
    1696             :                                         gpgme_key_t certkey,
    1697             :                                         unsigned int flags);
    1698             : /* Add a new subkey to KEY.  */
    1699             : gpgme_error_t gpgme_op_createsubkey_start (gpgme_ctx_t ctx,
    1700             :                                            gpgme_key_t key,
    1701             :                                            const char *algo,
    1702             :                                            unsigned long reserved,
    1703             :                                            unsigned long expires,
    1704             :                                            unsigned int flags);
    1705             : gpgme_error_t gpgme_op_createsubkey       (gpgme_ctx_t ctx,
    1706             :                                            gpgme_key_t key,
    1707             :                                            const char *algo,
    1708             :                                            unsigned long reserved,
    1709             :                                            unsigned long expires,
    1710             :                                            unsigned int flags);
    1711             : 
    1712             : /* Add USERID to an existing KEY.  */
    1713             : gpgme_error_t gpgme_op_adduid_start (gpgme_ctx_t ctx,
    1714             :                                      gpgme_key_t key, const char *userid,
    1715             :                                      unsigned int reserved);
    1716             : gpgme_error_t gpgme_op_adduid       (gpgme_ctx_t ctx,
    1717             :                                      gpgme_key_t key, const char *userid,
    1718             :                                      unsigned int reserved);
    1719             : 
    1720             : /* Revoke a USERID from a KEY.  */
    1721             : gpgme_error_t gpgme_op_revuid_start (gpgme_ctx_t ctx,
    1722             :                                      gpgme_key_t key, const char *userid,
    1723             :                                      unsigned int reserved);
    1724             : gpgme_error_t gpgme_op_revuid       (gpgme_ctx_t ctx,
    1725             :                                      gpgme_key_t key, const char *userid,
    1726             :                                      unsigned int reserved);
    1727             : 
    1728             : 
    1729             : 
    1730             : /* Retrieve a pointer to the result of a genkey, createkey, or
    1731             :  * createsubkey operation.  */
    1732             : gpgme_genkey_result_t gpgme_op_genkey_result (gpgme_ctx_t ctx);
    1733             : 
    1734             : 
    1735             : /* Delete KEY from the keyring.  If ALLOW_SECRET is non-zero, secret
    1736             :    keys are also deleted.  */
    1737             : gpgme_error_t gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key,
    1738             :                                      int allow_secret);
    1739             : gpgme_error_t gpgme_op_delete (gpgme_ctx_t ctx, const gpgme_key_t key,
    1740             :                                int allow_secret);
    1741             : 
    1742             : 
    1743             : /*
    1744             :  * Key signing interface
    1745             :  */
    1746             : 
    1747             : /* Flags for the key signing functions.  */
    1748             : #define GPGME_KEYSIGN_LOCAL     (1 << 7)  /* Create a local signature.  */
    1749             : #define GPGME_KEYSIGN_LFSEP     (1 << 8)  /* Indicate LF separated user ids. */
    1750             : #define GPGME_KEYSIGN_NOEXPIRE  (1 << 9)  /* Force no expiration.  */
    1751             : 
    1752             : 
    1753             : /* Sign the USERID of KEY using the current set of signers.  */
    1754             : gpgme_error_t gpgme_op_keysign_start (gpgme_ctx_t ctx,
    1755             :                                       gpgme_key_t key, const char *userid,
    1756             :                                       unsigned long expires,
    1757             :                                       unsigned int flags);
    1758             : gpgme_error_t gpgme_op_keysign       (gpgme_ctx_t ctx,
    1759             :                                       gpgme_key_t key, const char *userid,
    1760             :                                       unsigned long expires,
    1761             :                                       unsigned int flags);
    1762             : 
    1763             : 
    1764             : 
    1765             : 
    1766             : /*
    1767             :  * Key edit interface
    1768             :  */
    1769             : 
    1770             : /* Flags to select the mode of the interact.  */
    1771             : #define GPGME_INTERACT_CARD   (1 << 0)  /* Use --card-edit mode. */
    1772             : 
    1773             : 
    1774             : /* Edit the KEY.  Send status and command requests to FNC and
    1775             :    output of edit commands to OUT.  */
    1776             : gpgme_error_t gpgme_op_interact_start (gpgme_ctx_t ctx,
    1777             :                                        gpgme_key_t key,
    1778             :                                        unsigned int flags,
    1779             :                                        gpgme_interact_cb_t fnc,
    1780             :                                        void *fnc_value,
    1781             :                                        gpgme_data_t out);
    1782             : gpgme_error_t gpgme_op_interact (gpgme_ctx_t ctx, gpgme_key_t key,
    1783             :                                  unsigned int flags,
    1784             :                                  gpgme_interact_cb_t fnc,
    1785             :                                  void *fnc_value,
    1786             :                                  gpgme_data_t out);
    1787             : 
    1788             : 
    1789             : /* Set the Tofu policy of KEY to POLCIY.  */
    1790             : gpgme_error_t gpgme_op_tofu_policy_start (gpgme_ctx_t ctx,
    1791             :                                           gpgme_key_t key,
    1792             :                                           gpgme_tofu_policy_t policy);
    1793             : gpgme_error_t gpgme_op_tofu_policy       (gpgme_ctx_t ctx,
    1794             :                                           gpgme_key_t key,
    1795             :                                           gpgme_tofu_policy_t policy);
    1796             : 
    1797             : 
    1798             : 
    1799             : 
    1800             : /*
    1801             :  * Key listing
    1802             :  */
    1803             : 
    1804             : /* An object to return results from a key listing operation.
    1805             :  * This structure shall be considered read-only and an application
    1806             :  * must not allocate such a structure on its own.  */
    1807             : struct _gpgme_op_keylist_result
    1808             : {
    1809             :   unsigned int truncated : 1;
    1810             : 
    1811             :   /* Internal to GPGME, do not use.  */
    1812             :   unsigned int _unused : 31;
    1813             : };
    1814             : typedef struct _gpgme_op_keylist_result *gpgme_keylist_result_t;
    1815             : 
    1816             : /* Retrieve a pointer to the result of the key listing operation.  */
    1817             : gpgme_keylist_result_t gpgme_op_keylist_result (gpgme_ctx_t ctx);
    1818             : 
    1819             : /* Start a keylist operation within CTX, searching for keys which
    1820             :    match PATTERN.  If SECRET_ONLY is true, only secret keys are
    1821             :    returned.  */
    1822             : gpgme_error_t gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern,
    1823             :                                       int secret_only);
    1824             : gpgme_error_t gpgme_op_keylist_ext_start (gpgme_ctx_t ctx,
    1825             :                                           const char *pattern[],
    1826             :                                           int secret_only, int reserved);
    1827             : 
    1828             : /* Return the next key from the keylist in R_KEY.  */
    1829             : gpgme_error_t gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key);
    1830             : 
    1831             : /* Terminate a pending keylist operation within CTX.  */
    1832             : gpgme_error_t gpgme_op_keylist_end (gpgme_ctx_t ctx);
    1833             : 
    1834             : /* Change the passphrase for KEY.  FLAGS is reserved for future use
    1835             :    and must be passed as 0.  */
    1836             : gpgme_error_t gpgme_op_passwd_start (gpgme_ctx_t ctx, gpgme_key_t key,
    1837             :                                      unsigned int flags);
    1838             : gpgme_error_t gpgme_op_passwd (gpgme_ctx_t ctx, gpgme_key_t key,
    1839             :                                unsigned int flags);
    1840             : 
    1841             : 
    1842             : 
    1843             : /*
    1844             :  * Trust items and operations.
    1845             :  */
    1846             : 
    1847             : /* An object to hold data of a trust item.
    1848             :  * This structure shall be considered read-only and an application
    1849             :  * must not allocate such a structure on its own.  */
    1850             : struct _gpgme_trust_item
    1851             : {
    1852             :   /* Internal to GPGME, do not use.  */
    1853             :   unsigned int _refs;
    1854             : 
    1855             :   /* The key ID to which the trust item belongs.  */
    1856             :   char *keyid;
    1857             : 
    1858             :   /* Internal to GPGME, do not use.  */
    1859             :   char _keyid[16 + 1];
    1860             : 
    1861             :   /* The type of the trust item, 1 refers to a key, 2 to a user ID.  */
    1862             :   int type;
    1863             : 
    1864             :   /* The trust level.  */
    1865             :   int level;
    1866             : 
    1867             :   /* The owner trust if TYPE is 1.  */
    1868             :   char *owner_trust;
    1869             : 
    1870             :   /* Internal to GPGME, do not use.  */
    1871             :   char _owner_trust[2];
    1872             : 
    1873             :   /* The calculated validity.  */
    1874             :   char *validity;
    1875             : 
    1876             :   /* Internal to GPGME, do not use.  */
    1877             :   char _validity[2];
    1878             : 
    1879             :   /* The user name if TYPE is 2.  */
    1880             :   char *name;
    1881             : };
    1882             : typedef struct _gpgme_trust_item *gpgme_trust_item_t;
    1883             : 
    1884             : /* Start a trustlist operation within CTX, searching for trust items
    1885             :    which match PATTERN.  */
    1886             : gpgme_error_t gpgme_op_trustlist_start (gpgme_ctx_t ctx,
    1887             :                                         const char *pattern, int max_level);
    1888             : 
    1889             : /* Return the next trust item from the trustlist in R_ITEM.  */
    1890             : gpgme_error_t gpgme_op_trustlist_next (gpgme_ctx_t ctx,
    1891             :                                        gpgme_trust_item_t *r_item);
    1892             : 
    1893             : /* Terminate a pending trustlist operation within CTX.  */
    1894             : gpgme_error_t gpgme_op_trustlist_end (gpgme_ctx_t ctx);
    1895             : 
    1896             : /* Acquire a reference to ITEM.  */
    1897             : void gpgme_trust_item_ref (gpgme_trust_item_t item);
    1898             : 
    1899             : /* Release a reference to ITEM.  If this was the last one the trust
    1900             :    item is destroyed.  */
    1901             : void gpgme_trust_item_unref (gpgme_trust_item_t item);
    1902             : 
    1903             : 
    1904             : 
    1905             : /*
    1906             :  * Audit log
    1907             :  */
    1908             : 
    1909             : /* Return the auditlog for the current session.  This may be called
    1910             :    after a successful or failed operation.  If no audit log is
    1911             :    available GPG_ERR_NO_DATA is returned.  */
    1912             : gpgme_error_t gpgme_op_getauditlog_start (gpgme_ctx_t ctx, gpgme_data_t output,
    1913             :                                           unsigned int flags);
    1914             : gpgme_error_t gpgme_op_getauditlog (gpgme_ctx_t ctx, gpgme_data_t output,
    1915             :                                     unsigned int flags);
    1916             : 
    1917             : 
    1918             : 
    1919             : /*
    1920             :  * Spawn interface
    1921             :  */
    1922             : 
    1923             : /* Flags for the spawn operations.  */
    1924             : #define GPGME_SPAWN_DETACHED      1
    1925             : #define GPGME_SPAWN_ALLOW_SET_FG  2
    1926             : 
    1927             : 
    1928             : /* Run the command FILE with the arguments in ARGV.  Connect stdin to
    1929             :    DATAIN, stdout to DATAOUT, and STDERR to DATAERR.  If one the data
    1930             :    streams is NULL, connect to /dev/null instead.  */
    1931             : gpgme_error_t gpgme_op_spawn_start (gpgme_ctx_t ctx,
    1932             :                                     const char *file, const char *argv[],
    1933             :                                     gpgme_data_t datain,
    1934             :                                     gpgme_data_t dataout, gpgme_data_t dataerr,
    1935             :                                     unsigned int flags);
    1936             : gpgme_error_t gpgme_op_spawn (gpgme_ctx_t ctx,
    1937             :                               const char *file, const char *argv[],
    1938             :                               gpgme_data_t datain,
    1939             :                               gpgme_data_t dataout, gpgme_data_t dataerr,
    1940             :                               unsigned int flags);
    1941             : 
    1942             : 
    1943             : /*
    1944             :  * Low-level Assuan protocol access.
    1945             :  */
    1946             : typedef gpgme_error_t (*gpgme_assuan_data_cb_t)
    1947             :      (void *opaque, const void *data, size_t datalen);
    1948             : 
    1949             : typedef gpgme_error_t (*gpgme_assuan_inquire_cb_t)
    1950             :      (void *opaque, const char *name, const char *args,
    1951             :       gpgme_data_t *r_data);
    1952             : 
    1953             : typedef gpgme_error_t (*gpgme_assuan_status_cb_t)
    1954             :      (void *opaque, const char *status, const char *args);
    1955             : 
    1956             : /* Send the Assuan COMMAND and return results via the callbacks.
    1957             :    Asynchronous variant. */
    1958             : gpgme_error_t gpgme_op_assuan_transact_start (gpgme_ctx_t ctx,
    1959             :                                               const char *command,
    1960             :                                               gpgme_assuan_data_cb_t data_cb,
    1961             :                                               void *data_cb_value,
    1962             :                                               gpgme_assuan_inquire_cb_t inq_cb,
    1963             :                                               void *inq_cb_value,
    1964             :                                               gpgme_assuan_status_cb_t stat_cb,
    1965             :                                               void *stat_cb_value);
    1966             : 
    1967             : /* Send the Assuan COMMAND and return results via the callbacks.
    1968             :    Synchronous variant. */
    1969             : gpgme_error_t gpgme_op_assuan_transact_ext (gpgme_ctx_t ctx,
    1970             :                                             const char *command,
    1971             :                                             gpgme_assuan_data_cb_t data_cb,
    1972             :                                             void *data_cb_value,
    1973             :                                             gpgme_assuan_inquire_cb_t inq_cb,
    1974             :                                             void *inq_cb_value,
    1975             :                                             gpgme_assuan_status_cb_t stat_cb,
    1976             :                                             void *stat_cb_value,
    1977             :                                             gpgme_error_t *op_err);
    1978             : 
    1979             : 
    1980             : /*
    1981             :  * Crypto container support.
    1982             :  */
    1983             : 
    1984             : /* An object to return results from a VFS mount operation.
    1985             :  * This structure shall be considered read-only and an application
    1986             :  * must not allocate such a structure on its own.  */
    1987             : struct _gpgme_op_vfs_mount_result
    1988             : {
    1989             :   char *mount_dir;
    1990             : };
    1991             : typedef struct _gpgme_op_vfs_mount_result *gpgme_vfs_mount_result_t;
    1992             : 
    1993             : gpgme_vfs_mount_result_t gpgme_op_vfs_mount_result (gpgme_ctx_t ctx);
    1994             : 
    1995             : /* The container is automatically unmounted when the context is reset
    1996             :    or destroyed.  Transmission errors are returned directly,
    1997             :    operational errors are returned in OP_ERR.  */
    1998             : gpgme_error_t gpgme_op_vfs_mount (gpgme_ctx_t ctx, const char *container_file,
    1999             :                                   const char *mount_dir, unsigned int flags,
    2000             :                                   gpgme_error_t *op_err);
    2001             : 
    2002             : gpgme_error_t gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
    2003             :                                    const char *container_file,
    2004             :                                    unsigned int flags, gpgme_error_t *op_err);
    2005             : 
    2006             : 
    2007             : /*
    2008             :  * Interface to gpgconf(1).
    2009             :  */
    2010             : 
    2011             : /* The expert level at which a configuration option or group of
    2012             :    options should be displayed.  See the gpgconf(1) documentation for
    2013             :    more details.  */
    2014             : typedef enum
    2015             :   {
    2016             :     GPGME_CONF_BASIC = 0,
    2017             :     GPGME_CONF_ADVANCED = 1,
    2018             :     GPGME_CONF_EXPERT = 2,
    2019             :     GPGME_CONF_INVISIBLE = 3,
    2020             :     GPGME_CONF_INTERNAL = 4
    2021             :   }
    2022             : gpgme_conf_level_t;
    2023             : 
    2024             : 
    2025             : /* The data type of a configuration option argument.  See the gpgconf(1)
    2026             :    documentation for more details.  */
    2027             : typedef enum
    2028             :   {
    2029             :     /* Basic types.  */
    2030             :     GPGME_CONF_NONE = 0,
    2031             :     GPGME_CONF_STRING = 1,
    2032             :     GPGME_CONF_INT32 = 2,
    2033             :     GPGME_CONF_UINT32 = 3,
    2034             : 
    2035             :     /* Complex types.  */
    2036             :     GPGME_CONF_FILENAME = 32,
    2037             :     GPGME_CONF_LDAP_SERVER = 33,
    2038             :     GPGME_CONF_KEY_FPR = 34,
    2039             :     GPGME_CONF_PUB_KEY = 35,
    2040             :     GPGME_CONF_SEC_KEY = 36,
    2041             :     GPGME_CONF_ALIAS_LIST = 37
    2042             :   }
    2043             : gpgme_conf_type_t;
    2044             : 
    2045             : /* For now, compatibility.  */
    2046             : #define GPGME_CONF_PATHNAME GPGME_CONF_FILENAME
    2047             : 
    2048             : 
    2049             : /* This represents a single argument for a configuration option.
    2050             :    Which of the members of value is used depends on the ALT_TYPE.  */
    2051             : typedef struct gpgme_conf_arg
    2052             : {
    2053             :   struct gpgme_conf_arg *next;
    2054             :   /* True if the option appears without an (optional) argument.  */
    2055             :   unsigned int no_arg;
    2056             :   union
    2057             :   {
    2058             :     unsigned int count;
    2059             :     unsigned int uint32;
    2060             :     int int32;
    2061             :     char *string;
    2062             :   } value;
    2063             : } *gpgme_conf_arg_t;
    2064             : 
    2065             : 
    2066             : /* The flags of a configuration option.  See the gpgconf
    2067             :    documentation for details.  */
    2068             : #define GPGME_CONF_GROUP        (1 << 0)
    2069             : #define GPGME_CONF_OPTIONAL     (1 << 1)
    2070             : #define GPGME_CONF_LIST         (1 << 2)
    2071             : #define GPGME_CONF_RUNTIME      (1 << 3)
    2072             : #define GPGME_CONF_DEFAULT      (1 << 4)
    2073             : #define GPGME_CONF_DEFAULT_DESC (1 << 5)
    2074             : #define GPGME_CONF_NO_ARG_DESC  (1 << 6)
    2075             : #define GPGME_CONF_NO_CHANGE    (1 << 7)
    2076             : 
    2077             : 
    2078             : /* The representation of a single configuration option.  See the
    2079             :    gpg-conf documentation for details.  */
    2080             : typedef struct gpgme_conf_opt
    2081             : {
    2082             :   struct gpgme_conf_opt *next;
    2083             : 
    2084             :   /* The option name.  */
    2085             :   char *name;
    2086             : 
    2087             :   /* The flags for this option.  */
    2088             :   unsigned int flags;
    2089             : 
    2090             :   /* The level of this option.  */
    2091             :   gpgme_conf_level_t level;
    2092             : 
    2093             :   /* The localized description of this option.  */
    2094             :   char *description;
    2095             : 
    2096             :   /* The type and alternate type of this option.  */
    2097             :   gpgme_conf_type_t type;
    2098             :   gpgme_conf_type_t alt_type;
    2099             : 
    2100             :   /* The localized (short) name of the argument, if any.  */
    2101             :   char *argname;
    2102             : 
    2103             :   /* The default value.  */
    2104             :   gpgme_conf_arg_t default_value;
    2105             :   char *default_description;
    2106             : 
    2107             :   /* The default value if the option is not set.  */
    2108             :   gpgme_conf_arg_t no_arg_value;
    2109             :   char *no_arg_description;
    2110             : 
    2111             :   /* The current value if the option is set.  */
    2112             :   gpgme_conf_arg_t value;
    2113             : 
    2114             :   /* The new value, if any.  NULL means reset to default.  */
    2115             :   int change_value;
    2116             :   gpgme_conf_arg_t new_value;
    2117             : 
    2118             :   /* Free for application use.  */
    2119             :   void *user_data;
    2120             : } *gpgme_conf_opt_t;
    2121             : 
    2122             : 
    2123             : /* The representation of a component that can be configured.  See the
    2124             :    gpg-conf documentation for details.  */
    2125             : typedef struct gpgme_conf_comp
    2126             : {
    2127             :   struct gpgme_conf_comp *next;
    2128             : 
    2129             :   /* Internal to GPGME, do not use!  */
    2130             :   gpgme_conf_opt_t *_last_opt_p;
    2131             : 
    2132             :   /* The component name.  */
    2133             :   char *name;
    2134             : 
    2135             :   /* A human-readable description for the component.  */
    2136             :   char *description;
    2137             : 
    2138             :   /* The program name (an absolute path to the program).  */
    2139             :   char *program_name;
    2140             : 
    2141             :   /* A linked list of options for this component.  */
    2142             :   struct gpgme_conf_opt *options;
    2143             : } *gpgme_conf_comp_t;
    2144             : 
    2145             : 
    2146             : /* Allocate a new gpgme_conf_arg_t.  If VALUE is NULL, a "no arg
    2147             :    default" is prepared.  If type is a string type, VALUE should point
    2148             :    to the string.  Else, it should point to an unsigned or signed
    2149             :    integer respectively.  */
    2150             : gpgme_error_t gpgme_conf_arg_new (gpgme_conf_arg_t *arg_p,
    2151             :                                   gpgme_conf_type_t type, const void *value);
    2152             : 
    2153             : /* This also releases all chained argument structures!  */
    2154             : void gpgme_conf_arg_release (gpgme_conf_arg_t arg, gpgme_conf_type_t type);
    2155             : 
    2156             : /* Register a change for the value of OPT to ARG.  If RESET is 1 (do
    2157             :    not use any values but 0 or 1), ARG is ignored and the option is
    2158             :    not changed (reverting a previous change).  Otherwise, if ARG is
    2159             :    NULL, the option is cleared or reset to its default. The change
    2160             :    is done with gpgconf's --runtime option to immediately take effect. */
    2161             : gpgme_error_t gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset,
    2162             :                                      gpgme_conf_arg_t arg);
    2163             : 
    2164             : /* Release a set of configurations.  */
    2165             : void gpgme_conf_release (gpgme_conf_comp_t conf);
    2166             : 
    2167             : /* Retrieve the current configurations.  */
    2168             : gpgme_error_t gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p);
    2169             : 
    2170             : /* Save the configuration of component comp.  This function does not
    2171             :    follow chained components!  */
    2172             : gpgme_error_t gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp);
    2173             : 
    2174             : 
    2175             : /* Information about software versions.
    2176             :  * This structure shall be considered read-only and an application
    2177             :  * must not allocate such a structure on its own.  */
    2178             : typedef struct _gpgme_op_query_swdb_result
    2179             : {
    2180             :   /* RFU */
    2181             :   struct _gpgme_op_query_swdb_result *next;
    2182             : 
    2183             :   /* The name of the package (e.g. "gpgme", "gnupg") */
    2184             :   char *name;
    2185             : 
    2186             :   /* The version number of the installed version.  */
    2187             :   char *iversion;
    2188             : 
    2189             :   /* The time the online info was created.  */
    2190             :   unsigned long created;
    2191             : 
    2192             :   /* The time the online info was retrieved.  */
    2193             :   unsigned long retrieved;
    2194             : 
    2195             :   /* This bit is set if an error occured or some of the information
    2196             :    * in this structure may not be set.  */
    2197             :   unsigned int warning : 1;
    2198             : 
    2199             :   /* An update is available.  */
    2200             :   unsigned int update : 1;
    2201             : 
    2202             :   /* The update is important.  */
    2203             :   unsigned int urgent : 1;
    2204             : 
    2205             :   /* No information at all available.  */
    2206             :   unsigned int noinfo : 1;
    2207             : 
    2208             :   /* The package name is not known. */
    2209             :   unsigned int unknown : 1;
    2210             : 
    2211             :   /* The information here is too old.  */
    2212             :   unsigned int tooold : 1;
    2213             : 
    2214             :   /* Other error.  */
    2215             :   unsigned int error : 1;
    2216             : 
    2217             :   unsigned int _reserved : 25;
    2218             : 
    2219             :   /* The version number of the latest released version.  */
    2220             :   char *version;
    2221             : 
    2222             :   /* The release date of that version.  */
    2223             :   unsigned long reldate;
    2224             : 
    2225             : } *gpgme_query_swdb_result_t;
    2226             : 
    2227             : 
    2228             : /* Run the gpgconf --query-swdb command.  */
    2229             : gpgme_error_t gpgme_op_query_swdb (gpgme_ctx_t ctx,
    2230             :                                    const char *name, const char *iversion,
    2231             :                                    unsigned int reserved);
    2232             : 
    2233             : /* Return the result from the last query_swdb operation.  */
    2234             : gpgme_query_swdb_result_t gpgme_op_query_swdb_result (gpgme_ctx_t ctx);
    2235             : 
    2236             : 
    2237             : 
    2238             : 
    2239             : /*
    2240             :  * Various functions.
    2241             :  */
    2242             : 
    2243             : /* Set special global flags; consult the manual before use.  */
    2244             : int gpgme_set_global_flag (const char *name, const char *value);
    2245             : 
    2246             : /* Check that the library fulfills the version requirement.  Note:
    2247             :    This is here only for the case where a user takes a pointer from
    2248             :    the old version of this function.  The new version and macro for
    2249             :    run-time checks are below.  */
    2250             : const char *gpgme_check_version (const char *req_version);
    2251             : 
    2252             : /* Check that the library fulfills the version requirement and check
    2253             :    for struct layout mismatch involving bitfields.  */
    2254             : const char *gpgme_check_version_internal (const char *req_version,
    2255             :                                           size_t offset_sig_validity);
    2256             : 
    2257             : #define gpgme_check_version(req_version)                                \
    2258             :   gpgme_check_version_internal (req_version,                            \
    2259             :                                 offsetof (struct _gpgme_signature, validity))
    2260             : 
    2261             : /* Return the default values for various directories.  */
    2262             : const char *gpgme_get_dirinfo (const char *what);
    2263             : 
    2264             : /* Get the information about the configured and installed engines.  A
    2265             :    pointer to the first engine in the statically allocated linked list
    2266             :    is returned in *INFO.  If an error occurs, it is returned.  The
    2267             :    returned data is valid until the next gpgme_set_engine_info.  */
    2268             : gpgme_error_t gpgme_get_engine_info (gpgme_engine_info_t *engine_info);
    2269             : 
    2270             : /* Set the default engine info for the protocol PROTO to the file name
    2271             :    FILE_NAME and the home directory HOME_DIR.  */
    2272             : gpgme_error_t gpgme_set_engine_info (gpgme_protocol_t proto,
    2273             :                                      const char *file_name,
    2274             :                                      const char *home_dir);
    2275             : 
    2276             : /* Verify that the engine implementing PROTO is installed and
    2277             :    available.  */
    2278             : gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t proto);
    2279             : 
    2280             : 
    2281             : /* Reference counting for result objects.  */
    2282             : void gpgme_result_ref (void *result);
    2283             : void gpgme_result_unref (void *result);
    2284             : 
    2285             : /* Return a public key algorithm string (e.g. "rsa2048").  Caller must
    2286             :    free using gpgme_free.  */
    2287             : char *gpgme_pubkey_algo_string (gpgme_subkey_t subkey);
    2288             : 
    2289             : /* Return a statically allocated string with the name of the public
    2290             :    key algorithm ALGO, or NULL if that name is not known.  */
    2291             : const char *gpgme_pubkey_algo_name (gpgme_pubkey_algo_t algo);
    2292             : 
    2293             : /* Return a statically allocated string with the name of the hash
    2294             :    algorithm ALGO, or NULL if that name is not known.  */
    2295             : const char *gpgme_hash_algo_name (gpgme_hash_algo_t algo);
    2296             : 
    2297             : /* Return the addr-spec from a user id.  Caller must free the result
    2298             :  * with gpgme_free. */
    2299             : char *gpgme_addrspec_from_uid (const char *uid);
    2300             : 
    2301             : 
    2302             : 
    2303             : /*
    2304             :  * Deprecated types, constants and functions.
    2305             :  */
    2306             : 
    2307             : /* The possible stati for gpgme_op_edit.  The use of that function and
    2308             :  * these status codes are deprecated in favor of gpgme_op_interact. */
    2309             : typedef enum
    2310             :   {
    2311             :     GPGME_STATUS_EOF = 0,
    2312             :     /* mkstatus processing starts here */
    2313             :     GPGME_STATUS_ENTER = 1,
    2314             :     GPGME_STATUS_LEAVE = 2,
    2315             :     GPGME_STATUS_ABORT = 3,
    2316             : 
    2317             :     GPGME_STATUS_GOODSIG = 4,
    2318             :     GPGME_STATUS_BADSIG = 5,
    2319             :     GPGME_STATUS_ERRSIG = 6,
    2320             : 
    2321             :     GPGME_STATUS_BADARMOR = 7,
    2322             : 
    2323             :     GPGME_STATUS_RSA_OR_IDEA = 8,      /* (legacy) */
    2324             :     GPGME_STATUS_KEYEXPIRED = 9,
    2325             :     GPGME_STATUS_KEYREVOKED = 10,
    2326             : 
    2327             :     GPGME_STATUS_TRUST_UNDEFINED = 11,
    2328             :     GPGME_STATUS_TRUST_NEVER = 12,
    2329             :     GPGME_STATUS_TRUST_MARGINAL = 13,
    2330             :     GPGME_STATUS_TRUST_FULLY = 14,
    2331             :     GPGME_STATUS_TRUST_ULTIMATE = 15,
    2332             : 
    2333             :     GPGME_STATUS_SHM_INFO = 16,        /* (legacy) */
    2334             :     GPGME_STATUS_SHM_GET = 17,         /* (legacy) */
    2335             :     GPGME_STATUS_SHM_GET_BOOL = 18,    /* (legacy) */
    2336             :     GPGME_STATUS_SHM_GET_HIDDEN = 19,  /* (legacy) */
    2337             : 
    2338             :     GPGME_STATUS_NEED_PASSPHRASE = 20,
    2339             :     GPGME_STATUS_VALIDSIG = 21,
    2340             :     GPGME_STATUS_SIG_ID = 22,
    2341             :     GPGME_STATUS_ENC_TO = 23,
    2342             :     GPGME_STATUS_NODATA = 24,
    2343             :     GPGME_STATUS_BAD_PASSPHRASE = 25,
    2344             :     GPGME_STATUS_NO_PUBKEY = 26,
    2345             :     GPGME_STATUS_NO_SECKEY = 27,
    2346             :     GPGME_STATUS_NEED_PASSPHRASE_SYM = 28,
    2347             :     GPGME_STATUS_DECRYPTION_FAILED = 29,
    2348             :     GPGME_STATUS_DECRYPTION_OKAY = 30,
    2349             :     GPGME_STATUS_MISSING_PASSPHRASE = 31,
    2350             :     GPGME_STATUS_GOOD_PASSPHRASE = 32,
    2351             :     GPGME_STATUS_GOODMDC = 33,
    2352             :     GPGME_STATUS_BADMDC = 34,
    2353             :     GPGME_STATUS_ERRMDC = 35,
    2354             :     GPGME_STATUS_IMPORTED = 36,
    2355             :     GPGME_STATUS_IMPORT_OK = 37,
    2356             :     GPGME_STATUS_IMPORT_PROBLEM = 38,
    2357             :     GPGME_STATUS_IMPORT_RES = 39,
    2358             :     GPGME_STATUS_FILE_START = 40,
    2359             :     GPGME_STATUS_FILE_DONE = 41,
    2360             :     GPGME_STATUS_FILE_ERROR = 42,
    2361             : 
    2362             :     GPGME_STATUS_BEGIN_DECRYPTION = 43,
    2363             :     GPGME_STATUS_END_DECRYPTION = 44,
    2364             :     GPGME_STATUS_BEGIN_ENCRYPTION = 45,
    2365             :     GPGME_STATUS_END_ENCRYPTION = 46,
    2366             : 
    2367             :     GPGME_STATUS_DELETE_PROBLEM = 47,
    2368             :     GPGME_STATUS_GET_BOOL = 48,
    2369             :     GPGME_STATUS_GET_LINE = 49,
    2370             :     GPGME_STATUS_GET_HIDDEN = 50,
    2371             :     GPGME_STATUS_GOT_IT = 51,
    2372             :     GPGME_STATUS_PROGRESS = 52,
    2373             :     GPGME_STATUS_SIG_CREATED = 53,
    2374             :     GPGME_STATUS_SESSION_KEY = 54,
    2375             :     GPGME_STATUS_NOTATION_NAME = 55,
    2376             :     GPGME_STATUS_NOTATION_DATA = 56,
    2377             :     GPGME_STATUS_POLICY_URL = 57,
    2378             :     GPGME_STATUS_BEGIN_STREAM = 58,    /* (legacy) */
    2379             :     GPGME_STATUS_END_STREAM = 59,      /* (legacy) */
    2380             :     GPGME_STATUS_KEY_CREATED = 60,
    2381             :     GPGME_STATUS_USERID_HINT = 61,
    2382             :     GPGME_STATUS_UNEXPECTED = 62,
    2383             :     GPGME_STATUS_INV_RECP = 63,
    2384             :     GPGME_STATUS_NO_RECP = 64,
    2385             :     GPGME_STATUS_ALREADY_SIGNED = 65,
    2386             :     GPGME_STATUS_SIGEXPIRED = 66,      /* (legacy) */
    2387             :     GPGME_STATUS_EXPSIG = 67,
    2388             :     GPGME_STATUS_EXPKEYSIG = 68,
    2389             :     GPGME_STATUS_TRUNCATED = 69,
    2390             :     GPGME_STATUS_ERROR = 70,
    2391             :     GPGME_STATUS_NEWSIG = 71,
    2392             :     GPGME_STATUS_REVKEYSIG = 72,
    2393             :     GPGME_STATUS_SIG_SUBPACKET = 73,
    2394             :     GPGME_STATUS_NEED_PASSPHRASE_PIN = 74,
    2395             :     GPGME_STATUS_SC_OP_FAILURE = 75,
    2396             :     GPGME_STATUS_SC_OP_SUCCESS = 76,
    2397             :     GPGME_STATUS_CARDCTRL = 77,
    2398             :     GPGME_STATUS_BACKUP_KEY_CREATED = 78,
    2399             :     GPGME_STATUS_PKA_TRUST_BAD = 79,
    2400             :     GPGME_STATUS_PKA_TRUST_GOOD = 80,
    2401             :     GPGME_STATUS_PLAINTEXT = 81,
    2402             :     GPGME_STATUS_INV_SGNR = 82,
    2403             :     GPGME_STATUS_NO_SGNR = 83,
    2404             :     GPGME_STATUS_SUCCESS = 84,
    2405             :     GPGME_STATUS_DECRYPTION_INFO = 85,
    2406             :     GPGME_STATUS_PLAINTEXT_LENGTH = 86,
    2407             :     GPGME_STATUS_MOUNTPOINT = 87,
    2408             :     GPGME_STATUS_PINENTRY_LAUNCHED = 88,
    2409             :     GPGME_STATUS_ATTRIBUTE = 89,
    2410             :     GPGME_STATUS_BEGIN_SIGNING = 90,
    2411             :     GPGME_STATUS_KEY_NOT_CREATED = 91,
    2412             :     GPGME_STATUS_INQUIRE_MAXLEN = 92,
    2413             :     GPGME_STATUS_FAILURE = 93,
    2414             :     GPGME_STATUS_KEY_CONSIDERED = 94,
    2415             :     GPGME_STATUS_TOFU_USER = 95,
    2416             :     GPGME_STATUS_TOFU_STATS = 96,
    2417             :     GPGME_STATUS_TOFU_STATS_LONG = 97,
    2418             :     GPGME_STATUS_NOTATION_FLAGS = 98
    2419             :   }
    2420             : gpgme_status_code_t;
    2421             : 
    2422             : /* The callback type used by the deprecated functions gpgme_op_edit
    2423             :  * and gpgme_op_card_edit.  */
    2424             : typedef gpgme_error_t (*gpgme_edit_cb_t) (void *opaque,
    2425             :                                           gpgme_status_code_t status,
    2426             :                                           const char *args, int fd);
    2427             : 
    2428             : gpgme_error_t gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
    2429             :                                    gpgme_edit_cb_t fnc, void *fnc_value,
    2430             :                                    gpgme_data_t out) _GPGME_DEPRECATED(1,7);
    2431             : gpgme_error_t gpgme_op_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
    2432             :                                    gpgme_edit_cb_t fnc, void *fnc_value,
    2433             :                                    gpgme_data_t out) _GPGME_DEPRECATED(1,7);
    2434             : gpgme_error_t gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
    2435             :                                         gpgme_edit_cb_t fnc, void *fnc_value,
    2436             :                                         gpgme_data_t out)
    2437             :                                         _GPGME_DEPRECATED(1,7);
    2438             : gpgme_error_t gpgme_op_card_edit       (gpgme_ctx_t ctx, gpgme_key_t key,
    2439             :                                         gpgme_edit_cb_t fnc, void *fnc_value,
    2440             :                                         gpgme_data_t out)
    2441             :                                         _GPGME_DEPRECATED(1,7);
    2442             : 
    2443             : /* The possible signature stati.  Deprecated, use error value in sig
    2444             :    status.  */
    2445             : typedef enum
    2446             :   {
    2447             :     GPGME_SIG_STAT_NONE  = 0,
    2448             :     GPGME_SIG_STAT_GOOD  = 1,
    2449             :     GPGME_SIG_STAT_BAD   = 2,
    2450             :     GPGME_SIG_STAT_NOKEY = 3,
    2451             :     GPGME_SIG_STAT_NOSIG = 4,
    2452             :     GPGME_SIG_STAT_ERROR = 5,
    2453             :     GPGME_SIG_STAT_DIFF  = 6,
    2454             :     GPGME_SIG_STAT_GOOD_EXP = 7,
    2455             :     GPGME_SIG_STAT_GOOD_EXPKEY = 8
    2456             :   }
    2457             : _gpgme_sig_stat_t;
    2458             : typedef _gpgme_sig_stat_t gpgme_sig_stat_t _GPGME_DEPRECATED(0,4);
    2459             : 
    2460             : /* The available key and signature attributes.  Deprecated, use the
    2461             :    individual result structures instead.  */
    2462             : typedef enum
    2463             :   {
    2464             :     GPGME_ATTR_KEYID        = 1,
    2465             :     GPGME_ATTR_FPR          = 2,
    2466             :     GPGME_ATTR_ALGO         = 3,
    2467             :     GPGME_ATTR_LEN          = 4,
    2468             :     GPGME_ATTR_CREATED      = 5,
    2469             :     GPGME_ATTR_EXPIRE       = 6,
    2470             :     GPGME_ATTR_OTRUST       = 7,
    2471             :     GPGME_ATTR_USERID       = 8,
    2472             :     GPGME_ATTR_NAME         = 9,
    2473             :     GPGME_ATTR_EMAIL        = 10,
    2474             :     GPGME_ATTR_COMMENT      = 11,
    2475             :     GPGME_ATTR_VALIDITY     = 12,
    2476             :     GPGME_ATTR_LEVEL        = 13,
    2477             :     GPGME_ATTR_TYPE         = 14,
    2478             :     GPGME_ATTR_IS_SECRET    = 15,
    2479             :     GPGME_ATTR_KEY_REVOKED  = 16,
    2480             :     GPGME_ATTR_KEY_INVALID  = 17,
    2481             :     GPGME_ATTR_UID_REVOKED  = 18,
    2482             :     GPGME_ATTR_UID_INVALID  = 19,
    2483             :     GPGME_ATTR_KEY_CAPS     = 20,
    2484             :     GPGME_ATTR_CAN_ENCRYPT  = 21,
    2485             :     GPGME_ATTR_CAN_SIGN     = 22,
    2486             :     GPGME_ATTR_CAN_CERTIFY  = 23,
    2487             :     GPGME_ATTR_KEY_EXPIRED  = 24,
    2488             :     GPGME_ATTR_KEY_DISABLED = 25,
    2489             :     GPGME_ATTR_SERIAL       = 26,
    2490             :     GPGME_ATTR_ISSUER       = 27,
    2491             :     GPGME_ATTR_CHAINID      = 28,
    2492             :     GPGME_ATTR_SIG_STATUS   = 29,
    2493             :     GPGME_ATTR_ERRTOK       = 30,
    2494             :     GPGME_ATTR_SIG_SUMMARY  = 31,
    2495             :     GPGME_ATTR_SIG_CLASS    = 32
    2496             :   }
    2497             : _gpgme_attr_t;
    2498             : typedef _gpgme_attr_t gpgme_attr_t _GPGME_DEPRECATED(0,4);
    2499             : 
    2500             : /* Retrieve the signature status of signature IDX in CTX after a
    2501             :    successful verify operation in R_STAT (if non-null).  The creation
    2502             :    time stamp of the signature is returned in R_CREATED (if non-null).
    2503             :    The function returns a string containing the fingerprint.
    2504             :    Deprecated, use verify result directly.  */
    2505             : const char *gpgme_get_sig_status (gpgme_ctx_t ctx, int idx,
    2506             :                                   _gpgme_sig_stat_t *r_stat,
    2507             :                                   time_t *r_created) _GPGME_DEPRECATED(0,4);
    2508             : 
    2509             : /* Retrieve certain attributes of a signature.  IDX is the index
    2510             :    number of the signature after a successful verify operation.  WHAT
    2511             :    is an attribute where GPGME_ATTR_EXPIRE is probably the most useful
    2512             :    one.  WHATIDX is to be passed as 0 for most attributes . */
    2513             : unsigned long gpgme_get_sig_ulong_attr (gpgme_ctx_t c, int idx,
    2514             :                                         _gpgme_attr_t what, int whatidx)
    2515             :      _GPGME_DEPRECATED(0,4);
    2516             : const char *gpgme_get_sig_string_attr (gpgme_ctx_t c, int idx,
    2517             :                                        _gpgme_attr_t what, int whatidx)
    2518             :      _GPGME_DEPRECATED(0,4);
    2519             : 
    2520             : 
    2521             : /* Get the key used to create signature IDX in CTX and return it in
    2522             :    R_KEY.  */
    2523             : gpgme_error_t gpgme_get_sig_key (gpgme_ctx_t ctx, int idx, gpgme_key_t *r_key)
    2524             :      _GPGME_DEPRECATED(0,4);
    2525             : 
    2526             : /* Create a new data buffer which retrieves the data from the callback
    2527             :    function READ_CB.  Deprecated, please use gpgme_data_new_from_cbs
    2528             :    instead.  */
    2529             : gpgme_error_t gpgme_data_new_with_read_cb (gpgme_data_t *r_dh,
    2530             :                                            int (*read_cb) (void*,char *,
    2531             :                                                            size_t,size_t*),
    2532             :                                            void *read_cb_value)
    2533             :      _GPGME_DEPRECATED(0,4);
    2534             : 
    2535             : /* Return the value of the attribute WHAT of KEY, which has to be
    2536             :    representable by a string.  IDX specifies the sub key or user ID
    2537             :    for attributes related to sub keys or user IDs.  Deprecated, use
    2538             :    key structure directly instead. */
    2539             : const char *gpgme_key_get_string_attr (gpgme_key_t key, _gpgme_attr_t what,
    2540             :                                        const void *reserved, int idx)
    2541             :      _GPGME_DEPRECATED(0,4);
    2542             : 
    2543             : /* Return the value of the attribute WHAT of KEY, which has to be
    2544             :    representable by an unsigned integer.  IDX specifies the sub key or
    2545             :    user ID for attributes related to sub keys or user IDs.
    2546             :    Deprecated, use key structure directly instead.  */
    2547             : unsigned long gpgme_key_get_ulong_attr (gpgme_key_t key, _gpgme_attr_t what,
    2548             :                                         const void *reserved, int idx)
    2549             :      _GPGME_DEPRECATED(0,4);
    2550             : 
    2551             : /* Return the value of the attribute WHAT of a signature on user ID
    2552             :    UID_IDX in KEY, which has to be representable by a string.  IDX
    2553             :    specifies the signature.  Deprecated, use key structure directly
    2554             :    instead.  */
    2555             : const char *gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
    2556             :                                            _gpgme_attr_t what,
    2557             :                                            const void *reserved, int idx)
    2558             :      _GPGME_DEPRECATED(0,4);
    2559             : 
    2560             : /* Return the value of the attribute WHAT of a signature on user ID
    2561             :    UID_IDX in KEY, which has to be representable by an unsigned
    2562             :    integer string.  IDX specifies the signature.  Deprecated, use key
    2563             :    structure directly instead.  */
    2564             : unsigned long gpgme_key_sig_get_ulong_attr (gpgme_key_t key, int uid_idx,
    2565             :                                             _gpgme_attr_t what,
    2566             :                                             const void *reserved, int idx)
    2567             :      _GPGME_DEPRECATED(0,4);
    2568             : 
    2569             : 
    2570             : gpgme_error_t gpgme_op_import_ext (gpgme_ctx_t ctx, gpgme_data_t keydata,
    2571             :                                    int *nr) _GPGME_DEPRECATED(0,4);
    2572             : 
    2573             : /* Release the trust item ITEM.  Deprecated, use
    2574             :    gpgme_trust_item_unref.  */
    2575             : void gpgme_trust_item_release (gpgme_trust_item_t item) _GPGME_DEPRECATED(0,4);
    2576             : 
    2577             : /* Return the value of the attribute WHAT of ITEM, which has to be
    2578             :    representable by a string.  Deprecated, use trust item structure
    2579             :    directly.  */
    2580             : const char *gpgme_trust_item_get_string_attr (gpgme_trust_item_t item,
    2581             :                                               _gpgme_attr_t what,
    2582             :                                               const void *reserved, int idx)
    2583             :      _GPGME_DEPRECATED(0,4);
    2584             : 
    2585             : /* Return the value of the attribute WHAT of KEY, which has to be
    2586             :    representable by an integer.  IDX specifies a running index if the
    2587             :    attribute appears more than once in the key.  Deprecated, use trust
    2588             :    item structure directly.  */
    2589             : int gpgme_trust_item_get_int_attr (gpgme_trust_item_t item, _gpgme_attr_t what,
    2590             :                                    const void *reserved, int idx)
    2591             :      _GPGME_DEPRECATED(0,4);
    2592             : 
    2593             : /* Compat.
    2594             :  * This structure shall be considered read-only and an application
    2595             :  * must not allocate such a structure on its own.  */
    2596             : struct _gpgme_op_assuan_result
    2597             : {
    2598             :   /* Deprecated.  Use the second value in a DONE event or the
    2599             :      synchronous variant gpgme_op_assuan_transact_ext.  */
    2600             :   gpgme_error_t err _GPGME_DEPRECATED_OUTSIDE_GPGME(1,2);
    2601             : };
    2602             : typedef struct _gpgme_op_assuan_result *gpgme_assuan_result_t;
    2603             : 
    2604             : 
    2605             : /* Return the result of the last Assuan command. */
    2606             : gpgme_assuan_result_t gpgme_op_assuan_result (gpgme_ctx_t ctx)
    2607             :   _GPGME_DEPRECATED(1,2);
    2608             : 
    2609             : gpgme_error_t
    2610             : gpgme_op_assuan_transact (gpgme_ctx_t ctx,
    2611             :                               const char *command,
    2612             :                               gpgme_assuan_data_cb_t data_cb,
    2613             :                               void *data_cb_value,
    2614             :                               gpgme_assuan_inquire_cb_t inq_cb,
    2615             :                               void *inq_cb_value,
    2616             :                               gpgme_assuan_status_cb_t status_cb,
    2617             :                           void *status_cb_value) _GPGME_DEPRECATED(1,2);
    2618             : 
    2619             : 
    2620             : 
    2621             : typedef gpgme_ctx_t GpgmeCtx _GPGME_DEPRECATED(0,4);
    2622             : typedef gpgme_data_t GpgmeData _GPGME_DEPRECATED(0,4);
    2623             : typedef gpgme_error_t GpgmeError _GPGME_DEPRECATED(0,4);
    2624             : typedef gpgme_data_encoding_t GpgmeDataEncoding _GPGME_DEPRECATED(0,4);
    2625             : typedef gpgme_pubkey_algo_t GpgmePubKeyAlgo _GPGME_DEPRECATED(0,4);
    2626             : typedef gpgme_hash_algo_t GpgmeHashAlgo _GPGME_DEPRECATED(0,4);
    2627             : typedef gpgme_sig_stat_t GpgmeSigStat _GPGME_DEPRECATED(0,4);
    2628             : typedef gpgme_sig_mode_t GpgmeSigMode _GPGME_DEPRECATED(0,4);
    2629             : typedef gpgme_attr_t GpgmeAttr _GPGME_DEPRECATED(0,4);
    2630             : typedef gpgme_validity_t GpgmeValidity _GPGME_DEPRECATED(0,4);
    2631             : typedef gpgme_protocol_t GpgmeProtocol _GPGME_DEPRECATED(0,4);
    2632             : typedef gpgme_engine_info_t GpgmeEngineInfo _GPGME_DEPRECATED(0,4);
    2633             : typedef gpgme_subkey_t GpgmeSubkey _GPGME_DEPRECATED(0,4);
    2634             : typedef gpgme_key_sig_t GpgmeKeySig _GPGME_DEPRECATED(0,4);
    2635             : typedef gpgme_user_id_t GpgmeUserID _GPGME_DEPRECATED(0,4);
    2636             : typedef gpgme_key_t GpgmeKey _GPGME_DEPRECATED(0,4);
    2637             : typedef gpgme_passphrase_cb_t GpgmePassphraseCb _GPGME_DEPRECATED(0,4);
    2638             : typedef gpgme_progress_cb_t GpgmeProgressCb _GPGME_DEPRECATED(0,4);
    2639             : typedef gpgme_io_cb_t GpgmeIOCb _GPGME_DEPRECATED(0,4);
    2640             : typedef gpgme_register_io_cb_t GpgmeRegisterIOCb _GPGME_DEPRECATED(0,4);
    2641             : typedef gpgme_remove_io_cb_t GpgmeRemoveIOCb _GPGME_DEPRECATED(0,4);
    2642             : typedef gpgme_event_io_t GpgmeEventIO _GPGME_DEPRECATED(0,4);
    2643             : typedef gpgme_event_io_cb_t GpgmeEventIOCb _GPGME_DEPRECATED(0,4);
    2644             : #define GpgmeIOCbs gpgme_io_cbs
    2645             : typedef gpgme_data_read_cb_t GpgmeDataReadCb _GPGME_DEPRECATED(0,4);
    2646             : typedef gpgme_data_write_cb_t GpgmeDataWriteCb _GPGME_DEPRECATED(0,4);
    2647             : typedef gpgme_data_seek_cb_t GpgmeDataSeekCb _GPGME_DEPRECATED(0,4);
    2648             : typedef gpgme_data_release_cb_t GpgmeDataReleaseCb _GPGME_DEPRECATED(0,4);
    2649             : #define GpgmeDataCbs gpgme_data_cbs
    2650             : typedef gpgme_encrypt_result_t GpgmeEncryptResult _GPGME_DEPRECATED(0,4);
    2651             : typedef gpgme_sig_notation_t GpgmeSigNotation _GPGME_DEPRECATED(0,4);
    2652             : typedef gpgme_signature_t GpgmeSignature _GPGME_DEPRECATED(0,4);
    2653             : typedef gpgme_verify_result_t GpgmeVerifyResult _GPGME_DEPRECATED(0,4);
    2654             : typedef gpgme_import_status_t GpgmeImportStatus _GPGME_DEPRECATED(0,4);
    2655             : typedef gpgme_import_result_t GpgmeImportResult _GPGME_DEPRECATED(0,4);
    2656             : typedef gpgme_genkey_result_t GpgmeGenKeyResult _GPGME_DEPRECATED(0,4);
    2657             : typedef gpgme_trust_item_t GpgmeTrustItem _GPGME_DEPRECATED(0,4);
    2658             : typedef gpgme_status_code_t GpgmeStatusCode _GPGME_DEPRECATED(0,4);
    2659             : 
    2660             : #ifdef __cplusplus
    2661             : }
    2662             : #endif
    2663             : #endif /* GPGME_H */
    2664             : /*
    2665             : Local Variables:
    2666             : buffer-read-only: t
    2667             : End:
    2668             : */

Generated by: LCOV version 1.13