1gnutls_certificate_set_x509_key_mem2(g3n)utglnsutls_certificate_set_x509_key_mem2(3)
2
3
4
6 gnutls_certificate_set_x509_key_mem2 - API function
7
9 #include <gnutls/gnutls.h>
10
11 int gnutls_certificate_set_x509_key_mem2(gnutls_certificate_creden‐
12 tials_t res, const gnutls_datum_t * cert, const gnutls_datum_t * key,
13 gnutls_x509_crt_fmt_t type, const char * pass, unsigned int flags);
14
16 gnutls_certificate_credentials_t res
17 is a gnutls_certificate_credentials_t structure.
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
29 const char * pass
30 is the key's password
31
32 unsigned int flags
33 an ORed sequence of gnutls_pkcs_encrypt_flags_t
34
36 This function sets a certificate/private key pair in the gnutls_cer‐
37 tificate_credentials_t structure. This function may be called more than
38 once, in case multiple keys/certificates exist for the server.
39
40 Note that the keyUsage (2.5.29.15) PKIX extension in X.509 certificates
41 is supported. This means that certificates intended for signing cannot
42 be used for ciphersuites that require encryption.
43
44 If the certificate and the private key are given in PEM encoding then
45 the strings that hold their values must be null terminated.
46
47 The key may be NULL if you are using a sign callback, see
48 gnutls_sign_callback_set().
49
51 GNUTLS_E_SUCCESS (0) on success, or a negative error code.
52
54 Report bugs to <bugs@gnutls.org>.
55 Home page: http://www.gnutls.org
56
57
59 Copyright © 2001-2014 Free Software Foundation, Inc..
60 Copying and distribution of this file, with or without modification,
61 are permitted in any medium without royalty provided the copyright
62 notice and this notice are preserved.
63
65 The full documentation for gnutls is maintained as a Texinfo manual.
66 If the /usr/share/doc/gnutls/ directory does not contain the HTML form
67 visit
68
69 http://www.gnutls.org/manual/
70
71gnutls 3.3.g2n9utls_certificate_set_x509_key_mem2(3)