Exporting keys means the same as running gpg with the command --export. However, a mode flag can be used to change the way the export works. The available mode flags are described below, they may be or-ed together.
GPGME_EXPORT_MODE_EXTERNNULL.
The function
gpgme_op_exportextracts public keys and returns them in the data buffer keydata. The output format of the key data returned is determined by the ASCII armor attribute set for the context ctx, or, if that is not set, by the encoding specified for keydata.If pattern is
NULL, all available keys are returned. Otherwise, pattern contains an engine specific expression that is used to limit the list to all keys matching the pattern.mode is usually 0; other values are described above.
The function returns the error code
GPG_ERR_NO_ERRORif the operation completed successfully,GPG_ERR_INV_VALUEif keydata is not a valid empty data buffer, and passes through any errors that are reported by the crypto engine support routines.
The function
gpgme_op_export_startinitiates agpgme_op_exportoperation. It can be completed by callinggpgme_waiton the context. See Waiting For Completion.The function returns the error code
GPG_ERR_NO_ERRORif the operation could be started successfully, andGPG_ERR_INV_VALUEif keydata is not a valid empty data buffer.
The function
gpgme_op_exportextracts public keys and returns them in the data buffer keydata. The output format of the key data returned is determined by the ASCII armor attribute set for the context ctx, or, if that is not set, by the encoding specified for keydata.If pattern or *pattern is
NULL, all available keys are returned. Otherwise, pattern is aNULLterminated array of strings that are used to limit the list to all keys matching at least one of the patterns verbatim.mode is usually 0; other values are described above.
The function returns the error code
GPG_ERR_NO_ERRORif the operation completed successfully,GPG_ERR_INV_VALUEif keydata is not a valid empty data buffer, and passes through any errors that are reported by the crypto engine support routines.
The function
gpgme_op_export_ext_startinitiates agpgme_op_export_extoperation. It can be completed by callinggpgme_waiton the context. See Waiting For Completion.The function returns the error code
GPG_ERR_NO_ERRORif the operation could be started successfully, andGPG_ERR_INV_VALUEif keydata is not a valid empty data buffer.
The function
gpgme_op_export_keysextracts public keys and returns them in the data buffer keydata. The output format of the key data returned is determined by the ASCII armor attribute set for the context ctx, or, if that is not set, by the encoding specified for keydata.The keys to export are taken form the
NULLterminated array keys. Only keys of the the currently selected protocol of ctx which do have a fingerprint set are considered for export. Other keys specified by the keys are ignored. In particular OpenPGP keys retrieved via an external key listing are not included.mode is usually 0; other values are described above.
The function returns the error code
GPG_ERR_NO_ERRORif the operation completed successfully,GPG_ERR_INV_VALUEif keydata is not a valid empty data buffer,GPG_ERR_NO_DATAif no useful keys are in keys and passes through any errors that are reported by the crypto engine support routines.
The function
gpgme_op_export_keys_startinitiates agpgme_op_export_extoperation. It can be completed by callinggpgme_waiton the context. See Waiting For Completion.The function returns the error code
GPG_ERR_NO_ERRORif the operation could be started successfully, andGPG_ERR_INV_VALUEif keydata is not a valid empty data buffer,GPG_ERR_NO_DATAif no useful keys are in keys and passes through any errors that are reported by the crypto engine support routines.