1gnutls_x509_crt_get_key_usage(3) gnutls gnutls_x509_crt_get_key_usage(3)
2
3
4
6 gnutls_x509_crt_get_key_usage - This function returns the certificate's
7 key usage
8
10 #include <gnutls/x509.h>
11
12 int gnutls_x509_crt_get_key_usage(gnutls_x509_crt_t cert, unsigned int
13 * key_usage, unsigned int * critical);
14
16 gnutls_x509_crt_t cert
17 should contain a gnutls_x509_crt_t structure
18
19 unsigned int * key_usage
20 where the key usage bits will be stored
21
22 unsigned int * critical
23 will be non zero if the extension is marked as critical
24
26 This function will return certificate's key usage, by reading the
27 keyUsage X.509 extension (2.5.29.15). The key usage value will ORed
28 values of the: GNUTLS_KEY_DIGITAL_SIGNATURE, GNUTLS_KEY_NON_REPUDIA‐
29 TION, GNUTLS_KEY_KEY_ENCIPHERMENT, GNUTLS_KEY_DATA_ENCIPHERMENT,
30 GNUTLS_KEY_KEY_AGREEMENT, GNUTLS_KEY_KEY_CERT_SIGN,
31 GNUTLS_KEY_CRL_SIGN, GNUTLS_KEY_ENCIPHER_ONLY, GNUTLS_KEY_DECI‐
32 PHER_ONLY.
33
34 A negative value may be returned in case of parsing error. If the cer‐
35 tificate does not contain the keyUsage extension
36 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
37
39 Report bugs to <bug-gnutls@gnu.org>.
40
42 Copyright © 2006 Free Software Foundation.
43 Permission is granted to make and distribute verbatim copies of this
44 manual provided the copyright notice and this permission notice are
45 preserved on all copies.
46
48 The full documentation for gnutls is maintained as a Texinfo manual.
49 If the info and gnutls programs are properly installed at your site,
50 the command
51
52 info gnutls
53
54 should give you access to the complete manual.
55
56
57
58gnutls 1.6.3 gnutls_x509_crt_get_key_usage(3)