![]() |
![]() |
![]() |
GNU TLS API Reference Manual | ![]() |
---|
extraextra — |
#define LIBGNUTLS_EXTRA_VERSION int (*gnutls_openpgp_recv_key_func) (gnutls_session_t session, unsigned char *keyfpr, unsigned int keyfpr_length, gnutls_datum_t *key); void gnutls_openpgp_set_recv_key_function (gnutls_session_t session, gnutls_openpgp_recv_key_func func); int gnutls_certificate_set_openpgp_key_file (gnutls_certificate_credentials_t res, const char *CERTFILE, const char *KEYFILE); int gnutls_certificate_set_openpgp_key_mem (gnutls_certificate_credentials_t res, const gnutls_datum_t *CERT, const gnutls_datum_t *KEY); int gnutls_certificate_set_openpgp_keyserver (gnutls_certificate_credentials_t res, const char *keyserver, int port); int gnutls_certificate_set_openpgp_trustdb (gnutls_certificate_credentials_t res, const char *trustdb); int gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t c, unsigned char *data, size_t dlen); int gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c, const char *file); int gnutls_global_init_extra (void); const char* gnutls_extra_check_version (const char *req_version);
int (*gnutls_openpgp_recv_key_func) (gnutls_session_t session, unsigned char *keyfpr, unsigned int keyfpr_length, gnutls_datum_t *key);
A callback of this type is used to retrieve OpenPGP keys. Only useful on the server, and will only be used if the peer send a key fingerprint instead of a full key. See also gnutls_openpgp_set_recv_key_function().
session : | a TLS session |
keyfpr : | key fingerprint |
keyfpr_length : | length of key fingerprint |
key : | output key. |
Returns : |
void gnutls_openpgp_set_recv_key_function (gnutls_session_t session, gnutls_openpgp_recv_key_func func);
This funtion will set a key retrieval function for OpenPGP keys. This callback is only useful in server side, and will be used if the peer sent a key fingerprint instead of a full key.
session : | a TLS session |
func : | the callback |
int gnutls_certificate_set_openpgp_key_file (gnutls_certificate_credentials_t res, const char *CERTFILE, const char *KEYFILE);
This funtion is used to load OpenPGP keys into the GnuTLS credentials structure. It doesn't matter whether the keys are armored or but, but the files should only contain one key which should not be encrypted.
res : | the destination context to save the data. |
CERTFILE : | the file that contains the public key. |
KEYFILE : | the file that contains the secret key. |
Returns : |
int gnutls_certificate_set_openpgp_key_mem (gnutls_certificate_credentials_t res, const gnutls_datum_t *CERT, const gnutls_datum_t *KEY);
This funtion is used to load OpenPGP keys into the GnuTLS credential structure. It doesn't matter whether the keys are armored or but, but the files should only contain one key which should not be encrypted.
res : | the destination context to save the data. |
CERT : | the datum that contains the public key. |
KEY : | the datum that contains the secret key. |
Returns : |
int gnutls_certificate_set_openpgp_keyserver (gnutls_certificate_credentials_t res, const char *keyserver, int port);
This funtion will set a key server for use with openpgp keys. This key server will only be used if the peer sends a key fingerprint instead of a key in the handshake. Using a key server may delay the handshake process.
res : | the destination context to save the data. |
keyserver : | is the key server address |
port : | is the key server port to connect to |
Returns : |
int gnutls_certificate_set_openpgp_trustdb (gnutls_certificate_credentials_t res, const char *trustdb);
This funtion will set a GnuPG trustdb which will be used in key verification functions. Only version 3 trustdb files are supported.
res : | the destination context to save the data. |
trustdb : | is the trustdb filename |
Returns : |
int gnutls_certificate_set_openpgp_keyring_mem (gnutls_certificate_credentials_t c, unsigned char *data, size_t dlen);
The function is used to set keyrings that will be used internally by various OpenPGP functions. For example to find a key when it is needed for an operations. The keyring will also be used at the verification functions.
c : | A certificate credentials structure |
data : | buffer with keyring data. |
dlen : | length of data buffer. |
Returns : |
int gnutls_certificate_set_openpgp_keyring_file (gnutls_certificate_credentials_t c, const char *file);
The function is used to set keyrings that will be used internally by various OpenPGP functions. For example to find a key when it is needed for an operations. The keyring will also be used at the verification functions.
c : | A certificate credentials structure |
file : | filename of the keyring. |
Returns : |
int gnutls_global_init_extra (void);
This function initializes the global state of gnutls-extra library to defaults.
Returns : | zero on success. Note that gnutls_global_init() has to be called before this function. If this function is not called then the gnutls-extra library will not be usable. |
const char* gnutls_extra_check_version (const char *req_version);
Check that the version of the gnutls-extra library is at minimum the requested one and return the version string; return NULL if the condition is not satisfied. If a NULL is passed to this function, no check is done, but the version string is simply returned.
req_version : | the version to check |
Returns : |
<< gnutls | x509 >> |