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 - return the certificate's key usage
7
9 #include <gnutls/x509.h>
10
11 int gnutls_x509_crt_get_key_usage(gnutls_x509_crt_t cert, unsigned int
12 * key_usage, unsigned int * critical);
13
15 gnutls_x509_crt_t cert
16 should contain a gnutls_x509_crt_t structure
17
18 unsigned int * key_usage
19 where the key usage bits will be stored
20
21 unsigned int * critical
22 will be non zero if the extension is marked as critical
23
25 This function will return certificate's key usage, by reading the
26 keyUsage X.509 extension (2.5.29.15). The key usage value will
27
29 GNUTLS_KEY_DIGITAL_SIGNATURE, GNUTLS_KEY_NON_REPUDIATION,
30 GNUTLS_KEY_KEY_ENCIPHERMENT, GNUTLS_KEY_DATA_ENCIPHERMENT,
31 GNUTLS_KEY_KEY_AGREEMENT, GNUTLS_KEY_KEY_CERT_SIGN,
32 GNUTLS_KEY_CRL_SIGN, GNUTLS_KEY_ENCIPHER_ONLY, GNUTLS_KEY_DECI‐
33 PHER_ONLY.
34
36 the certificate key usage, or a negative value in case of parsing
37 error. If the certificate does not contain the keyUsage extension
38 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
39
41 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
42 http://www.gnu.org/software/gnutls/ General help using GNU software:
43 http://www.gnu.org/gethelp/
44
46 Copyright © 2008 Free Software Foundation.
47 Copying and distribution of this file, with or without modification,
48 are permitted in any medium without royalty provided the copyright
49 notice and this notice are preserved.
50
52 The full documentation for gnutls is maintained as a Texinfo manual.
53 If the info and gnutls programs are properly installed at your site,
54 the command
55
56 info gnutls
57
58 should give you access to the complete manual.
59
60
61
62gnutls 2.8.6 gnutls_x509_crt_get_key_usage(3)