Tizen 2.0 Release
[external/libgnutls26.git] / doc / manpages / gnutls_x509_crt_get_subject_alt_name.3
1 .\" DO NOT MODIFY THIS FILE!  It was generated by gdoc.
2 .TH "gnutls_x509_crt_get_subject_alt_name" 3 "2.12.6.1" "gnutls" "gnutls"
3 .SH NAME
4 gnutls_x509_crt_get_subject_alt_name \- API function
5 .SH SYNOPSIS
6 .B #include <gnutls/x509.h>
7 .sp
8 .BI "int gnutls_x509_crt_get_subject_alt_name(gnutls_x509_crt_t " cert ", unsigned int " seq ", void * " ret ", size_t * " ret_size ", unsigned int * " critical ");"
9 .SH ARGUMENTS
10 .IP "gnutls_x509_crt_t cert" 12
11 should contain a \fBgnutls_x509_crt_t\fP structure
12 .IP "unsigned int seq" 12
13 specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
14 .IP "void * ret" 12
15 is the place where the alternative name will be copied to
16 .IP "size_t * ret_size" 12
17 holds the size of ret.
18 .IP "unsigned int * critical" 12
19 will be non zero if the extension is marked as critical (may be null)
20 .SH "DESCRIPTION"
21 This function retrieves the Alternative Name (2.5.29.17), contained
22 in the given certificate in the X509v3 Certificate Extensions.
23
24 When the SAN type is otherName, it will extract the data in the
25 otherName's value field, and \fBGNUTLS_SAN_OTHERNAME\fP is returned.
26 You may use \fBgnutls_x509_crt_get_subject_alt_othername_oid()\fP to get
27 the corresponding OID and the "virtual" SAN types (e.g.,
28 \fBGNUTLS_SAN_OTHERNAME_XMPP\fP).
29
30 If an otherName OID is known, the data will be decoded.  Otherwise
31 the returned data will be DER encoded, and you will have to decode
32 it yourself.  Currently, only the RFC 3920 id\-on\-xmppAddr SAN is
33 recognized.
34 .SH "RETURNS"
35 the alternative subject name type on success, one of the
36 enumerated \fBgnutls_x509_subject_alt_name_t\fP.  It will return
37 \fBGNUTLS_E_SHORT_MEMORY_BUFFER\fP if \fIret_size\fP is not large enough to
38 hold the value.  In that case \fIret_size\fP will be updated with the
39 required size.  If the certificate does not have an Alternative
40 name with the specified sequence number then
41 \fBGNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE\fP is returned.
42 .SH "REPORTING BUGS"
43 Report bugs to <bug-gnutls@gnu.org>.
44 GnuTLS home page: http://www.gnu.org/software/gnutls/
45 General help using GNU software: http://www.gnu.org/gethelp/
46 .SH COPYRIGHT
47 Copyright \(co 2008 Free Software Foundation.
48 .br
49 Copying and distribution of this file, with or without modification,
50 are permitted in any medium without royalty provided the copyright
51 notice and this notice are preserved.
52 .SH "SEE ALSO"
53 The full documentation for
54 .B gnutls
55 is maintained as a Texinfo manual.  If the
56 .B info
57 and
58 .B gnutls
59 programs are properly installed at your site, the command
60 .IP
61 .B info gnutls
62 .PP
63 should give you access to the complete manual.