1gnutls_x509_crt_get_subject_alt_name(g3n)utglnsutls_x509_crt_get_subject_alt_name(3)
2
3
4
6 gnutls_x509_crt_get_subject_alt_name - API function
7
9 #include <gnutls/x509.h>
10
11 int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t cert,
12 unsigned int seq, void * ret, size_t * ret_size, unsigned int * criti‐
13 cal);
14
16 gnutls_x509_crt_t cert
17 should contain a gnutls_x509_crt_t structure
18
19 unsigned int seq
20 specifies the sequence number of the alt name (0 for the
21 first one, 1 for the second etc.)
22
23 void * ret is the place where the alternative name will be copied to
24
25 size_t * ret_size
26 holds the size of ret.
27
28 unsigned int * critical
29 will be non zero if the extension is marked as critical
30 (may be null)
31
33 This function retrieves the Alternative Name (2.5.29.17), contained in
34 the given certificate in the X509v3 Certificate Extensions.
35
36 When the SAN type is otherName, it will extract the data in the other‐
37 Name's value field, and GNUTLS_SAN_OTHERNAME is returned. You may use
38 gnutls_x509_crt_get_subject_alt_othername_oid() to get the correspond‐
39 ing OID and the "virtual" SAN types (e.g., GNUTLS_SAN_OTHERNAME_XMPP).
40
41 If an otherName OID is known, the data will be decoded. Otherwise the
42 returned data will be DER encoded, and you will have to decode it your‐
43 self. Currently, only the RFC 3920 id-on-xmppAddr SAN is recognized.
44
46 the alternative subject name type on success, one of the enumerated
47 gnutls_x509_subject_alt_name_t. It will return GNUTLS_E_SHORT_MEM‐
48 ORY_BUFFER if ret_size is not large enough to hold the value. In that
49 case ret_size will be updated with the required size. If the certifi‐
50 cate does not have an Alternative name with the specified sequence num‐
51 ber then GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned.
52
54 Report bugs to <bug-gnutls@gnu.org>. GnuTLS home page:
55 http://www.gnu.org/software/gnutls/ General help using GNU software:
56 http://www.gnu.org/gethelp/
57
59 Copyright © 2008 Free Software Foundation.
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 info and gnutls programs are properly installed at your site,
67 the command
68
69 info gnutls
70
71 should give you access to the complete manual.
72
73
74
75gnutls 2.12.g6n.u1tls_x509_crt_get_subject_alt_name(3)