1gnutls_certificate_set_x509_key_mem(3g)nutlgsnutls_certificate_set_x509_key_mem(3)
2
3
4
6 gnutls_certificate_set_x509_key_mem - API function
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_certificate_set_x509_key_mem(gnutls_certificate_creden‐
12 tials_t res, const gnutls_datum_t * cert, const gnutls_datum_t * key,
13 gnutls_x509_crt_fmt_t type);
14
16 gnutls_certificate_credentials_t res
17 is a gnutls_certificate_credentials_t type.
18
19 const gnutls_datum_t * cert
20 contains a certificate list (path) for the specified pri‐
21 vate key
22
23 const gnutls_datum_t * key
24 is the private key, or NULL
25
26 gnutls_x509_crt_fmt_t type
27 is PEM or DER
28
30 This function sets a certificate/private key pair in the gnutls_cer‐
31 tificate_credentials_t type. This function may be called more than
32 once, in case multiple keys/certificates exist for the server.
33
34 Note that the keyUsage (2.5.29.15) PKIX extension in X.509 certificates
35 is supported. This means that certificates intended for signing cannot
36 be used for ciphersuites that require encryption.
37
38 If the certificate and the private key are given in PEM encoding then
39 the strings that hold their values must be null terminated.
40
41 The key may be NULL if you are using a sign callback, see
42 gnutls_sign_callback_set().
43
44 Note that, this function by default returns zero on success and a nega‐
45 tive value on error. Since 3.5.6, when the flag GNUTLS_CERTIFI‐
46 CATE_API_V2 is set using gnutls_certificate_set_flags() it returns an
47 index (greater or equal to zero). That index can be used to other func‐
48 tions to refer to the added key-pair.
49
51 On success this functions returns zero, and otherwise a negative value
52 on error (see above for modifying that behavior).
53
55 Report bugs to <bugs@gnutls.org>.
56 Home page: https://www.gnutls.org
57
58
60 Copyright © 2001-2019 Free Software Foundation, Inc., and others.
61 Copying and distribution of this file, with or without modification,
62 are permitted in any medium without royalty provided the copyright
63 notice and this notice are preserved.
64
66 The full documentation for gnutls is maintained as a Texinfo manual.
67 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
68 visit
69
70 https://www.gnutls.org/manual/
71
72gnutls 3.6.g8nutls_certificate_set_x509_key_mem(3)