1gnutls_x509_crt_get_subject_alt_name(g3n)utglnsutls_x509_crt_get_subject_alt_name(3)
2
3
4

NAME

6       gnutls_x509_crt_get_subject_alt_name  -  Get  certificate's alternative
7       name, if any
8

SYNOPSIS

10       #include <gnutls/x509.h>
11
12       int    gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t     cert,
13       unsigned  int seq, void * ret, size_t * ret_size, unsigned int * criti‐
14       cal);
15

ARGUMENTS

17       gnutls_x509_crt_t cert
18                   should contain a gnutls_x509_crt_t structure
19
20       unsigned int seq
21                   specifies the sequence number of the alt name  (0  for  the
22                   first one, 1 for the second etc.)
23
24       void * ret  is the place where the alternative name will be copied to
25
26       size_t * ret_size
27                   holds the size of ret.
28
29       unsigned int * critical
30                   will  be  non  zero  if the extension is marked as critical
31                   (may be null)
32

DESCRIPTION

34       This function will return the alternative names, contained in the given
35       certificate.
36
37       This is specified in X509v3 Certificate Extensions.  GNUTLS will return
38       the Alternative name (2.5.29.17), or a negative error code.
39
40       When the SAN type is otherName, it will extract the data in the  other‐
41       Name's  value field, and GNUTLS_SAN_OTHERNAME is returned.  You may use
42       gnutls_x509_crt_get_subject_alt_othername_oid() to get the  correspond‐
43       ing OID and the "virtual" SAN types (e.g., GNUTLS_SAN_OTHERNAME_XMPP).
44
45       If  an otherName OID is known, the data will be decoded.  Otherwise the
46       returned data will be DER encoded, and you will have to decode it your‐
47       self.  Currently, only the RFC 3920 id-on-xmppAddr SAN is recognized.
48

RETURNS

50       the  alternative  subject  name  type on success, one of the enumerated
51       gnutls_x509_subject_alt_name_t.   It  will  return  GNUTLS_E_SHORT_MEM‐
52       ORY_BUFFER  if ret_size is not large enough to hold the value.  In that
53       case ret_size will be updated with the required size.  If the  certifi‐
54       cate does not have an Alternative name with the specified sequence num‐
55       ber then GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE is returned.
56

REPORTING BUGS

58       Report   bugs   to    <bug-gnutls@gnu.org>.     GnuTLS    home    page:
59       http://www.gnu.org/software/gnutls/  General  help  using GNU software:
60       http://www.gnu.org/gethelp/
61
63       Copyright © 2008 Free Software Foundation.
64       Copying and distribution of this file, with  or  without  modification,
65       are  permitted  in  any  medium  without royalty provided the copyright
66       notice and this notice are preserved.
67

SEE ALSO

69       The full documentation for gnutls is maintained as  a  Texinfo  manual.
70       If  the  info  and gnutls programs are properly installed at your site,
71       the command
72
73              info gnutls
74
75       should give you access to the complete manual.
76
77
78
79gnutls                               2.8g.n6utls_x509_crt_get_subject_alt_name(3)
Impressum