Previous: Data Buffer I/O Operations, Up: Manipulating Data Buffers


6.3.2 Data Buffer Meta-Data

— Function: char * gpgme_data_get_file_name (gpgme_data_t dh)

The function gpgme_data_get_file_name returns a pointer to a string containing the file name associated with the data object. The file name will be stored in the output when encrypting or signing the data and will be returned to the user when decrypting or verifying the output data.

If no error occurs, the string containing the file name is returned. Otherwise, NULL will be returned.

— Function: gpgme_error_t gpgme_data_set_file_name (gpgme_data_t dh, const char *file_name)

The function gpgme_data_set_file_name sets the file name associated with the data object. The file name will be stored in the output when encrypting or signing the data and will be returned to the user when decrypting or verifying the output data.

The function returns the error code GPG_ERR_INV_VALUE if dh is not a valid pointer and GPG_ERR_ENOMEM if not enough memory is available.

— Data type: enum gpgme_data_encoding_t

The gpgme_data_encoding_t type specifies the encoding of a gpgme_data_t object. This encoding is useful to give the backend a hint on the type of data. The following data types are available:

GPGME_DATA_ENCODING_NONE
This specifies that the encoding is not known. This is the default for a new data object. The backend will try its best to detect the encoding automatically.
GPGME_DATA_ENCODING_BINARY
This specifies that the data is encoding in binary form; i.e. there is no special encoding.
GPGME_DATA_ENCODING_BASE64
This specifies that the data is encoded using the Base-64 encoding scheme as used by MIME and other protocols.
GPGME_DATA_ENCODING_ARMOR
This specifies that the data is encoded in an armored form as used by OpenPGP and PEM.

— Function: gpgme_data_encoding_t gpgme_data_get_encoding (gpgme_data_t dh)

The function gpgme_data_get_encoding returns the encoding of the data object with the handle dh. If dh is not a valid pointer (e.g. NULL) GPGME_DATA_ENCODING_NONE is returned.

— Function: gpgme_error_t gpgme_data_set_encoding (gpgme_data_t dh, gpgme_data_encoding_t enc)

The function gpgme_data_set_encoding changes the encoding of the data object with the handle dh to enc.