File: gpgme.info, Node: Data Buffer Convenience, Prev: Data Buffer Meta-Data, Up: Manipulating Data Buffers 6.3.3 Data Buffer Convenience Functions --------------------------------------- -- Data type: enum gpgme_data_type_t SINCE: 1.4.3 The ‘gpgme_data_type_t’ type is used to return the detected type of the content of a data buffer. ‘GPGME_DATA_TYPE_INVALID’ This is returned by ‘gpgme_data_identify’ if it was not possible to identify the data. Reasons for this might be a non-seekable stream or a memory problem. The value is 0. ‘GPGME_DATA_TYPE_UNKNOWN’ The type of the data is not known. ‘GPGME_DATA_TYPE_PGP_SIGNED’ The data is an OpenPGP signed message. This may be a binary signature, a detached one or a cleartext signature. ‘GPGME_DATA_TYPE_PGP_ENCRYPTED’ SINCE: 1.7.0 The data is an OpenPGP encrypted message. ‘GPGME_DATA_TYPE_PGP_SIGNATURE’ SINCE: 1.7.0 The data is an OpenPGP detached signature. ‘GPGME_DATA_TYPE_PGP_OTHER’ This is a generic OpenPGP message. In most cases this will be encrypted data. ‘GPGME_DATA_TYPE_PGP_KEY’ This is an OpenPGP key (private or public). ‘GPGME_DATA_TYPE_CMS_SIGNED’ This is a CMS signed message. ‘GPGME_DATA_TYPE_CMS_ENCRYPTED’ This is a CMS encrypted (enveloped data) message. ‘GPGME_DATA_TYPE_CMS_OTHER’ This is used for other CMS message types. ‘GPGME_DATA_TYPE_X509_CERT’ The data is a X.509 certificate ‘GPGME_DATA_TYPE_PKCS12’ The data is a PKCS#12 message. This is commonly used to exchange private keys for X.509. -- Function: gpgme_data_type_t gpgme_data_identify (gpgme_data_t DH, int RESERVED) SINCE: 1.4.3 The function ‘gpgme_data_identify’ returns the type of the data with the handle DH. If it is not possible to perform the identification, the function returns zero (‘GPGME_DATA_TYPE_INVALID’). Note that depending on how the data object has been created the identification may not be possible or the data object may change its internal state (file pointer moved). For file or memory based data object, the state should not change. RESERVED should be zero.