Tizen 2.0 Release
[external/libgnutls26.git] / doc / reference / html / gnutls-x509.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>x509</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GnuTLS API Reference Manual">
8 <link rel="up" href="intro.html" title="GnuTLS API Reference Manual">
9 <link rel="prev" href="gnutls-extra.html" title="extra">
10 <link rel="next" href="gnutls-pkcs11.html" title="pkcs11">
11 <meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 </head>
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="gnutls-extra.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="intro.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GnuTLS API Reference Manual</th>
21 <td><a accesskey="n" href="gnutls-pkcs11.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gnutls-x509.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#gnutls-x509.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="gnutls-x509"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="gnutls-x509.top_of_page"></a>x509</span></h2>
34 <p>x509</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="gnutls-x509.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">#define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-COUNTRY-NAME:CAPS" title="GNUTLS_OID_X520_COUNTRY_NAME">GNUTLS_OID_X520_COUNTRY_NAME</a>
41 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-ORGANIZATION-NAME:CAPS" title="GNUTLS_OID_X520_ORGANIZATION_NAME">GNUTLS_OID_X520_ORGANIZATION_NAME</a>
42 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-ORGANIZATIONAL-UNIT-NAME:CAPS" title="GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME">GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME</a>
43 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-COMMON-NAME:CAPS" title="GNUTLS_OID_X520_COMMON_NAME">GNUTLS_OID_X520_COMMON_NAME</a>
44 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-LOCALITY-NAME:CAPS" title="GNUTLS_OID_X520_LOCALITY_NAME">GNUTLS_OID_X520_LOCALITY_NAME</a>
45 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-STATE-OR-PROVINCE-NAME:CAPS" title="GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME">GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME</a>
46 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-INITIALS:CAPS" title="GNUTLS_OID_X520_INITIALS">GNUTLS_OID_X520_INITIALS</a>
47 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-GENERATION-QUALIFIER:CAPS" title="GNUTLS_OID_X520_GENERATION_QUALIFIER">GNUTLS_OID_X520_GENERATION_QUALIFIER</a>
48 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-SURNAME:CAPS" title="GNUTLS_OID_X520_SURNAME">GNUTLS_OID_X520_SURNAME</a>
49 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-GIVEN-NAME:CAPS" title="GNUTLS_OID_X520_GIVEN_NAME">GNUTLS_OID_X520_GIVEN_NAME</a>
50 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-TITLE:CAPS" title="GNUTLS_OID_X520_TITLE">GNUTLS_OID_X520_TITLE</a>
51 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-DN-QUALIFIER:CAPS" title="GNUTLS_OID_X520_DN_QUALIFIER">GNUTLS_OID_X520_DN_QUALIFIER</a>
52 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-PSEUDONYM:CAPS" title="GNUTLS_OID_X520_PSEUDONYM">GNUTLS_OID_X520_PSEUDONYM</a>
53 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-POSTALCODE:CAPS" title="GNUTLS_OID_X520_POSTALCODE">GNUTLS_OID_X520_POSTALCODE</a>
54 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-X520-NAME:CAPS" title="GNUTLS_OID_X520_NAME">GNUTLS_OID_X520_NAME</a>
55 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-LDAP-DC:CAPS" title="GNUTLS_OID_LDAP_DC">GNUTLS_OID_LDAP_DC</a>
56 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-LDAP-UID:CAPS" title="GNUTLS_OID_LDAP_UID">GNUTLS_OID_LDAP_UID</a>
57 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKCS9-EMAIL:CAPS" title="GNUTLS_OID_PKCS9_EMAIL">GNUTLS_OID_PKCS9_EMAIL</a>
58 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKIX-DATE-OF-BIRTH:CAPS" title="GNUTLS_OID_PKIX_DATE_OF_BIRTH">GNUTLS_OID_PKIX_DATE_OF_BIRTH</a>
59 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKIX-PLACE-OF-BIRTH:CAPS" title="GNUTLS_OID_PKIX_PLACE_OF_BIRTH">GNUTLS_OID_PKIX_PLACE_OF_BIRTH</a>
60 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKIX-GENDER:CAPS" title="GNUTLS_OID_PKIX_GENDER">GNUTLS_OID_PKIX_GENDER</a>
61 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKIX-COUNTRY-OF-CITIZENSHIP:CAPS" title="GNUTLS_OID_PKIX_COUNTRY_OF_CITIZENSHIP">GNUTLS_OID_PKIX_COUNTRY_OF_CITIZENSHIP</a>
62 #define             <a class="link" href="gnutls-x509.html#GNUTLS-OID-PKIX-COUNTRY-OF-RESIDENCE:CAPS" title="GNUTLS_OID_PKIX_COUNTRY_OF_RESIDENCE">GNUTLS_OID_PKIX_COUNTRY_OF_RESIDENCE</a>
63 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-TLS-WWW-SERVER:CAPS" title="GNUTLS_KP_TLS_WWW_SERVER">GNUTLS_KP_TLS_WWW_SERVER</a>
64 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-TLS-WWW-CLIENT:CAPS" title="GNUTLS_KP_TLS_WWW_CLIENT">GNUTLS_KP_TLS_WWW_CLIENT</a>
65 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-CODE-SIGNING:CAPS" title="GNUTLS_KP_CODE_SIGNING">GNUTLS_KP_CODE_SIGNING</a>
66 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-EMAIL-PROTECTION:CAPS" title="GNUTLS_KP_EMAIL_PROTECTION">GNUTLS_KP_EMAIL_PROTECTION</a>
67 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-TIME-STAMPING:CAPS" title="GNUTLS_KP_TIME_STAMPING">GNUTLS_KP_TIME_STAMPING</a>
68 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-OCSP-SIGNING:CAPS" title="GNUTLS_KP_OCSP_SIGNING">GNUTLS_KP_OCSP_SIGNING</a>
69 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-IPSEC-IKE:CAPS" title="GNUTLS_KP_IPSEC_IKE">GNUTLS_KP_IPSEC_IKE</a>
70 #define             <a class="link" href="gnutls-x509.html#GNUTLS-KP-ANY:CAPS" title="GNUTLS_KP_ANY">GNUTLS_KP_ANY</a>
71 #define             <a class="link" href="gnutls-x509.html#GNUTLS-FSAN-SET:CAPS" title="GNUTLS_FSAN_SET">GNUTLS_FSAN_SET</a>
72 #define             <a class="link" href="gnutls-x509.html#GNUTLS-FSAN-APPEND:CAPS" title="GNUTLS_FSAN_APPEND">GNUTLS_FSAN_APPEND</a>
73 enum                <a class="link" href="gnutls-x509.html#gnutls-certificate-import-flags" title="enum gnutls_certificate_import_flags">gnutls_certificate_import_flags</a>;
74 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-init" title="gnutls_x509_crt_init ()">gnutls_x509_crt_init</a>                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *cert</code></em>);
75 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-x509-crt-deinit" title="gnutls_x509_crt_deinit ()">gnutls_x509_crt_deinit</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);
76 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-import" title="gnutls_x509_crt_import ()">gnutls_x509_crt_import</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
77                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
78                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);
79 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-list-import" title="gnutls_x509_crt_list_import ()">gnutls_x509_crt_list_import</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *certs</code></em>,
80                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *cert_max</code></em>,
81                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
82                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
83                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
84 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-export" title="gnutls_x509_crt_export ()">gnutls_x509_crt_export</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
85                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
86                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
87                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
88 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-dn" title="gnutls_x509_crt_get_issuer_dn ()">gnutls_x509_crt_get_issuer_dn</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
89                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
90                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
91 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-dn-oid" title="gnutls_x509_crt_get_issuer_dn_oid ()">gnutls_x509_crt_get_issuer_dn_oid</a>   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
92                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
93                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
94                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
95 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-dn-by-oid" title="gnutls_x509_crt_get_issuer_dn_by_oid ()">gnutls_x509_crt_get_issuer_dn_by_oid</a>
96                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
97                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
98                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
99                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
100                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
101                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
102 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-dn" title="gnutls_x509_crt_get_dn ()">gnutls_x509_crt_get_dn</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
103                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
104                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
105 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-dn-oid" title="gnutls_x509_crt_get_dn_oid ()">gnutls_x509_crt_get_dn_oid</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
106                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
107                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
108                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
109 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-dn-by-oid" title="gnutls_x509_crt_get_dn_by_oid ()">gnutls_x509_crt_get_dn_by_oid</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
110                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
111                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
112                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
113                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
114                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
115 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-check-hostname" title="gnutls_x509_crt_check_hostname ()">gnutls_x509_crt_check_hostname</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
116                                                          <em class="parameter"><code>const <span class="type">char</span> *hostname</code></em>);
117 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-signature-algorithm" title="gnutls_x509_crt_get_signature_algorithm ()">gnutls_x509_crt_get_signature_algorithm</a>
118                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);
119 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-signature" title="gnutls_x509_crt_get_signature ()">gnutls_x509_crt_get_signature</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
120                                                          <em class="parameter"><code><span class="type">char</span> *sig</code></em>,
121                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_sig</code></em>);
122 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-version" title="gnutls_x509_crt_get_version ()">gnutls_x509_crt_get_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);
123 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-key-id" title="gnutls_x509_crt_get_key_id ()">gnutls_x509_crt_get_key_id</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
124                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
125                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
126                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
127 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-authority-key-id" title="gnutls_x509_crt_set_authority_key_id ()">gnutls_x509_crt_set_authority_key_id</a>
128                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
129                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
130                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);
131 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-authority-key-id" title="gnutls_x509_crt_get_authority_key_id ()">gnutls_x509_crt_get_authority_key_id</a>
132                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
133                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
134                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
135                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
136 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-key-id" title="gnutls_x509_crt_get_subject_key_id ()">gnutls_x509_crt_get_subject_key_id</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
137                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
138                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
139                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
140 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-unique-id" title="gnutls_x509_crt_get_subject_unique_id ()">gnutls_x509_crt_get_subject_unique_id</a>
141                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
142                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
143                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
144 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-unique-id" title="gnutls_x509_crt_get_issuer_unique_id ()">gnutls_x509_crt_get_issuer_unique_id</a>
145                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
146                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
147                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
148 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-UNUSED:CAPS" title="GNUTLS_CRL_REASON_UNUSED">GNUTLS_CRL_REASON_UNUSED</a>
149 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-KEY-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_KEY_COMPROMISE">GNUTLS_CRL_REASON_KEY_COMPROMISE</a>
150 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CA-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_CA_COMPROMISE">GNUTLS_CRL_REASON_CA_COMPROMISE</a>
151 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-AFFILIATION-CHANGED:CAPS" title="GNUTLS_CRL_REASON_AFFILIATION_CHANGED">GNUTLS_CRL_REASON_AFFILIATION_CHANGED</a>
152 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-SUPERSEDED:CAPS" title="GNUTLS_CRL_REASON_SUPERSEDED">GNUTLS_CRL_REASON_SUPERSEDED</a>
153 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-SUPERSEEDED:CAPS" title="GNUTLS_CRL_REASON_SUPERSEEDED">GNUTLS_CRL_REASON_SUPERSEEDED</a>
154 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CESSATION-OF-OPERATION:CAPS" title="GNUTLS_CRL_REASON_CESSATION_OF_OPERATION">GNUTLS_CRL_REASON_CESSATION_OF_OPERATION</a>
155 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CERTIFICATE-HOLD:CAPS" title="GNUTLS_CRL_REASON_CERTIFICATE_HOLD">GNUTLS_CRL_REASON_CERTIFICATE_HOLD</a>
156 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-PRIVILEGE-WITHDRAWN:CAPS" title="GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN">GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN</a>
157 #define             <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-AA-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_AA_COMPROMISE">GNUTLS_CRL_REASON_AA_COMPROMISE</a>
158 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-crl-dist-points" title="gnutls_x509_crt_get_crl_dist_points ()">gnutls_x509_crt_get_crl_dist_points</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
159                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
160                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
161                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
162                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *reason_flags</code></em>,
163                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
164 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-crl-dist-points2" title="gnutls_x509_crt_set_crl_dist_points2 ()">gnutls_x509_crt_set_crl_dist_points2</a>
165                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
166                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
167                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
168                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
169                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> reason_flags</code></em>);
170 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-crl-dist-points" title="gnutls_x509_crt_set_crl_dist_points ()">gnutls_x509_crt_set_crl_dist_points</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
171                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
172                                                          <em class="parameter"><code>const <span class="type">void</span> *data_string</code></em>,
173                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> reason_flags</code></em>);
174 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-cpy-crl-dist-points" title="gnutls_x509_crt_cpy_crl_dist_points ()">gnutls_x509_crt_cpy_crl_dist_points</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> dst</code></em>,
175                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> src</code></em>);
176 <span class="returnvalue">time_t</span>              <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-activation-time" title="gnutls_x509_crt_get_activation_time ()">gnutls_x509_crt_get_activation_time</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);
177 <span class="returnvalue">time_t</span>              <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-expiration-time" title="gnutls_x509_crt_get_expiration_time ()">gnutls_x509_crt_get_expiration_time</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);
178 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-serial" title="gnutls_x509_crt_get_serial ()">gnutls_x509_crt_get_serial</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
179                                                          <em class="parameter"><code><span class="type">void</span> *result</code></em>,
180                                                          <em class="parameter"><code><span class="type">size_t</span> *result_size</code></em>);
181 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-pk-algorithm" title="gnutls_x509_crt_get_pk_algorithm ()">gnutls_x509_crt_get_pk_algorithm</a>    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
182                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *bits</code></em>);
183 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-pk-rsa-raw" title="gnutls_x509_crt_get_pk_rsa_raw ()">gnutls_x509_crt_get_pk_rsa_raw</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
184                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
185                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>);
186 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-pk-dsa-raw" title="gnutls_x509_crt_get_pk_dsa_raw ()">gnutls_x509_crt_get_pk_dsa_raw</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
187                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
188                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
189                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *g</code></em>,
190                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *y</code></em>);
191 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-name" title="gnutls_x509_crt_get_subject_alt_name ()">gnutls_x509_crt_get_subject_alt_name</a>
192                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
193                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
194                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
195                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
196                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
197 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-name2" title="gnutls_x509_crt_get_subject_alt_name2 ()">gnutls_x509_crt_get_subject_alt_name2</a>
198                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
199                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
200                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
201                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
202                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
203                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
204 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-othername-oid" title="gnutls_x509_crt_get_subject_alt_othername_oid ()">gnutls_x509_crt_get_subject_alt_othername_oid</a>
205                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
206                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
207                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
208                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);
209 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-alt-name" title="gnutls_x509_crt_get_issuer_alt_name ()">gnutls_x509_crt_get_issuer_alt_name</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
210                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
211                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
212                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
213                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
214 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-alt-name2" title="gnutls_x509_crt_get_issuer_alt_name2 ()">gnutls_x509_crt_get_issuer_alt_name2</a>
215                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
216                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
217                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
218                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
219                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
220                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
221 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-alt-othername-oid" title="gnutls_x509_crt_get_issuer_alt_othername_oid ()">gnutls_x509_crt_get_issuer_alt_othername_oid</a>
222                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
223                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
224                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
225                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);
226 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-ca-status" title="gnutls_x509_crt_get_ca_status ()">gnutls_x509_crt_get_ca_status</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
227                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
228 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-basic-constraints" title="gnutls_x509_crt_get_basic_constraints ()">gnutls_x509_crt_get_basic_constraints</a>
229                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
230                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
231                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ca</code></em>,
232                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>);
233 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-key-usage" title="gnutls_x509_crt_get_key_usage ()">gnutls_x509_crt_get_key_usage</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
234                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *key_usage</code></em>,
235                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
236 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-key-usage" title="gnutls_x509_crt_set_key_usage ()">gnutls_x509_crt_set_key_usage</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
237                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> usage</code></em>);
238 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-proxy" title="gnutls_x509_crt_get_proxy ()">gnutls_x509_crt_get_proxy</a>           (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
239                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
240                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>,
241                                                          <em class="parameter"><code><span class="type">char</span> **policyLanguage</code></em>,
242                                                          <em class="parameter"><code><span class="type">char</span> **policy</code></em>,
243                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_policy</code></em>);
244 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()">gnutls_x509_dn_oid_known</a>            (<em class="parameter"><code>const <span class="type">char</span> *oid</code></em>);
245 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-oid" title="gnutls_x509_crt_get_extension_oid ()">gnutls_x509_crt_get_extension_oid</a>   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
246                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
247                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
248                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
249 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-by-oid" title="gnutls_x509_crt_get_extension_by_oid ()">gnutls_x509_crt_get_extension_by_oid</a>
250                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
251                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
252                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
253                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
254                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>,
255                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
256 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-info" title="gnutls_x509_crt_get_extension_info ()">gnutls_x509_crt_get_extension_info</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
257                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
258                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
259                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
260                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
261 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-data" title="gnutls_x509_crt_get_extension_data ()">gnutls_x509_crt_get_extension_data</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
262                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
263                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
264                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);
265 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-extension-by-oid" title="gnutls_x509_crt_set_extension_by_oid ()">gnutls_x509_crt_set_extension_by_oid</a>
266                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
267                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
268                                                          <em class="parameter"><code>const <span class="type">void</span> *buf</code></em>,
269                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_buf</code></em>,
270                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);
271 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-dn-by-oid" title="gnutls_x509_crt_set_dn_by_oid ()">gnutls_x509_crt_set_dn_by_oid</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
272                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
273                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
274                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
275                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);
276 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-issuer-dn-by-oid" title="gnutls_x509_crt_set_issuer_dn_by_oid ()">gnutls_x509_crt_set_issuer_dn_by_oid</a>
277                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
278                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
279                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
280                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
281                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);
282 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-version" title="gnutls_x509_crt_set_version ()">gnutls_x509_crt_set_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
283                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);
284 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-key" title="gnutls_x509_crt_set_key ()">gnutls_x509_crt_set_key</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
285                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
286 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-ca-status" title="gnutls_x509_crt_set_ca_status ()">gnutls_x509_crt_set_ca_status</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
287                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>);
288 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-basic-constraints" title="gnutls_x509_crt_set_basic_constraints ()">gnutls_x509_crt_set_basic_constraints</a>
289                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
290                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>,
291                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>);
292 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-subject-alternative-name" title="gnutls_x509_crt_set_subject_alternative_name ()">gnutls_x509_crt_set_subject_alternative_name</a>
293                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
294                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
295                                                          <em class="parameter"><code>const <span class="type">char</span> *data_string</code></em>);
296 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-subject-alt-name" title="gnutls_x509_crt_set_subject_alt_name ()">gnutls_x509_crt_set_subject_alt_name</a>
297                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
298                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
299                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
300                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
301                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
302 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-sign" title="gnutls_x509_crt_sign ()">gnutls_x509_crt_sign</a>                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
303                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>,
304                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> issuer_key</code></em>);
305 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-sign2" title="gnutls_x509_crt_sign2 ()">gnutls_x509_crt_sign2</a>               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
306                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>,
307                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> issuer_key</code></em>,
308                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-digest-algorithm-t" title="enum gnutls_digest_algorithm_t"><span class="type">gnutls_digest_algorithm_t</span></a> dig</code></em>,
309                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
310 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-activation-time" title="gnutls_x509_crt_set_activation_time ()">gnutls_x509_crt_set_activation_time</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
311                                                          <em class="parameter"><code><span class="type">time_t</span> act_time</code></em>);
312 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-expiration-time" title="gnutls_x509_crt_set_expiration_time ()">gnutls_x509_crt_set_expiration_time</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
313                                                          <em class="parameter"><code><span class="type">time_t</span> exp_time</code></em>);
314 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-serial" title="gnutls_x509_crt_set_serial ()">gnutls_x509_crt_set_serial</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
315                                                          <em class="parameter"><code>const <span class="type">void</span> *serial</code></em>,
316                                                          <em class="parameter"><code><span class="type">size_t</span> serial_size</code></em>);
317 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-subject-key-id" title="gnutls_x509_crt_set_subject_key_id ()">gnutls_x509_crt_set_subject_key_id</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
318                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
319                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);
320 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-proxy-dn" title="gnutls_x509_crt_set_proxy_dn ()">gnutls_x509_crt_set_proxy_dn</a>        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
321                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> eecrt</code></em>,
322                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
323                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
324                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);
325 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-proxy" title="gnutls_x509_crt_set_proxy ()">gnutls_x509_crt_set_proxy</a>           (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
326                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>,
327                                                          <em class="parameter"><code>const <span class="type">char</span> *policyLanguage</code></em>,
328                                                          <em class="parameter"><code>const <span class="type">char</span> *policy</code></em>,
329                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_policy</code></em>);
330 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-print" title="gnutls_x509_crt_print ()">gnutls_x509_crt_print</a>               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
331                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
332                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);
333 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-print" title="gnutls_x509_crl_print ()">gnutls_x509_crl_print</a>               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
334                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
335                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);
336 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-raw-issuer-dn" title="gnutls_x509_crt_get_raw_issuer_dn ()">gnutls_x509_crt_get_raw_issuer_dn</a>   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
337                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *start</code></em>);
338 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-raw-dn" title="gnutls_x509_crt_get_raw_dn ()">gnutls_x509_crt_get_raw_dn</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
339                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *start</code></em>);
340 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-rdn-get" title="gnutls_x509_rdn_get ()">gnutls_x509_rdn_get</a>                 (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
341                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
342                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
343 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-rdn-get-oid" title="gnutls_x509_rdn_get_oid ()">gnutls_x509_rdn_get_oid</a>             (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
344                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
345                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
346                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
347 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-rdn-get-by-oid" title="gnutls_x509_rdn_get_by_oid ()">gnutls_x509_rdn_get_by_oid</a>          (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
348                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
349                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
350                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
351                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
352                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
353 typedef             <a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t">gnutls_x509_dn_t</a>;
354 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject" title="gnutls_x509_crt_get_subject ()">gnutls_x509_crt_get_subject</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
355                                                          <em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);
356 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer" title="gnutls_x509_crt_get_issuer ()">gnutls_x509_crt_get_issuer</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
357                                                          <em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);
358 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-get-rdn-ava" title="gnutls_x509_dn_get_rdn_ava ()">gnutls_x509_dn_get_rdn_ava</a>          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
359                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> irdn</code></em>,
360                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> iava</code></em>,
361                                                          <em class="parameter"><code><span class="type">gnutls_x509_ava_st</span> *ava</code></em>);
362 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-init" title="gnutls_x509_dn_init ()">gnutls_x509_dn_init</a>                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);
363 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-import" title="gnutls_x509_dn_import ()">gnutls_x509_dn_import</a>               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
364                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>);
365 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-export" title="gnutls_x509_dn_export ()">gnutls_x509_dn_export</a>               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
366                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
367                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
368                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
369 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-x509-dn-deinit" title="gnutls_x509_dn_deinit ()">gnutls_x509_dn_deinit</a>               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>);
370 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-init" title="gnutls_x509_crl_init ()">gnutls_x509_crl_init</a>                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *crl</code></em>);
371 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-x509-crl-deinit" title="gnutls_x509_crl_deinit ()">gnutls_x509_crl_deinit</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
372 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-import" title="gnutls_x509_crl_import ()">gnutls_x509_crl_import</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
373                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
374                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);
375 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-export" title="gnutls_x509_crl_export ()">gnutls_x509_crl_export</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
376                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
377                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
378                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
379 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-raw-issuer-dn" title="gnutls_x509_crl_get_raw_issuer_dn ()">gnutls_x509_crl_get_raw_issuer_dn</a>   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
380                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *dn</code></em>);
381 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-issuer-dn" title="gnutls_x509_crl_get_issuer_dn ()">gnutls_x509_crl_get_issuer_dn</a>       (<em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
382                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
383                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
384 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-issuer-dn-by-oid" title="gnutls_x509_crl_get_issuer_dn_by_oid ()">gnutls_x509_crl_get_issuer_dn_by_oid</a>
385                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
386                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
387                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
388                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
389                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
390                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
391 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-dn-oid" title="gnutls_x509_crl_get_dn_oid ()">gnutls_x509_crl_get_dn_oid</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
392                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
393                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
394                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
395 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-signature-algorithm" title="gnutls_x509_crl_get_signature_algorithm ()">gnutls_x509_crl_get_signature_algorithm</a>
396                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
397 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-signature" title="gnutls_x509_crl_get_signature ()">gnutls_x509_crl_get_signature</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
398                                                          <em class="parameter"><code><span class="type">char</span> *sig</code></em>,
399                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_sig</code></em>);
400 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-version" title="gnutls_x509_crl_get_version ()">gnutls_x509_crl_get_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
401 <span class="returnvalue">time_t</span>              <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-this-update" title="gnutls_x509_crl_get_this_update ()">gnutls_x509_crl_get_this_update</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
402 <span class="returnvalue">time_t</span>              <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-next-update" title="gnutls_x509_crl_get_next_update ()">gnutls_x509_crl_get_next_update</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
403 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-crt-count" title="gnutls_x509_crl_get_crt_count ()">gnutls_x509_crl_get_crt_count</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
404 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-crt-serial" title="gnutls_x509_crl_get_crt_serial ()">gnutls_x509_crl_get_crt_serial</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
405                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
406                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *serial</code></em>,
407                                                          <em class="parameter"><code><span class="type">size_t</span> *serial_size</code></em>,
408                                                          <em class="parameter"><code><span class="type">time_t</span> *t</code></em>);
409 #define             <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-certificate-count" title="gnutls_x509_crl_get_certificate_count">gnutls_x509_crl_get_certificate_count</a>
410 #define             <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-certificate" title="gnutls_x509_crl_get_certificate">gnutls_x509_crl_get_certificate</a>
411 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-check-issuer" title="gnutls_x509_crl_check_issuer ()">gnutls_x509_crl_check_issuer</a>        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
412                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>);
413 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-version" title="gnutls_x509_crl_set_version ()">gnutls_x509_crl_set_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
414                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);
415 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-this-update" title="gnutls_x509_crl_set_this_update ()">gnutls_x509_crl_set_this_update</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
416                                                          <em class="parameter"><code><span class="type">time_t</span> act_time</code></em>);
417 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-next-update" title="gnutls_x509_crl_set_next_update ()">gnutls_x509_crl_set_next_update</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
418                                                          <em class="parameter"><code><span class="type">time_t</span> exp_time</code></em>);
419 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-crt-serial" title="gnutls_x509_crl_set_crt_serial ()">gnutls_x509_crl_set_crt_serial</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
420                                                          <em class="parameter"><code>const <span class="type">void</span> *serial</code></em>,
421                                                          <em class="parameter"><code><span class="type">size_t</span> serial_size</code></em>,
422                                                          <em class="parameter"><code><span class="type">time_t</span> revocation_time</code></em>);
423 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-crt" title="gnutls_x509_crl_set_crt ()">gnutls_x509_crl_set_crt</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
424                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
425                                                          <em class="parameter"><code><span class="type">time_t</span> revocation_time</code></em>);
426 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-authority-key-id" title="gnutls_x509_crl_get_authority_key_id ()">gnutls_x509_crl_get_authority_key_id</a>
427                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
428                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
429                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
430                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
431 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-number" title="gnutls_x509_crl_get_number ()">gnutls_x509_crl_get_number</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
432                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
433                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
434                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
435 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-oid" title="gnutls_x509_crl_get_extension_oid ()">gnutls_x509_crl_get_extension_oid</a>   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
436                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
437                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
438                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
439 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-info" title="gnutls_x509_crl_get_extension_info ()">gnutls_x509_crl_get_extension_info</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
440                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
441                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
442                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
443                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
444 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-data" title="gnutls_x509_crl_get_extension_data ()">gnutls_x509_crl_get_extension_data</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
445                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
446                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
447                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);
448 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-authority-key-id" title="gnutls_x509_crl_set_authority_key_id ()">gnutls_x509_crl_set_authority_key_id</a>
449                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
450                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
451                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);
452 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-set-number" title="gnutls_x509_crl_set_number ()">gnutls_x509_crl_set_number</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
453                                                          <em class="parameter"><code>const <span class="type">void</span> *nr</code></em>,
454                                                          <em class="parameter"><code><span class="type">size_t</span> nr_size</code></em>);
455 struct              <a class="link" href="gnutls-x509.html#gnutls-pkcs7-int" title="struct gnutls_pkcs7_int">gnutls_pkcs7_int</a>;
456 typedef             <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t">gnutls_pkcs7_t</a>;
457 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-init" title="gnutls_pkcs7_init ()">gnutls_pkcs7_init</a>                   (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> *pkcs7</code></em>);
458 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-pkcs7-deinit" title="gnutls_pkcs7_deinit ()">gnutls_pkcs7_deinit</a>                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);
459 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-import" title="gnutls_pkcs7_import ()">gnutls_pkcs7_import</a>                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
460                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
461                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);
462 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-export" title="gnutls_pkcs7_export ()">gnutls_pkcs7_export</a>                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
463                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
464                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
465                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
466 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-get-crt-count" title="gnutls_pkcs7_get_crt_count ()">gnutls_pkcs7_get_crt_count</a>          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);
467 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-get-crt-raw" title="gnutls_pkcs7_get_crt_raw ()">gnutls_pkcs7_get_crt_raw</a>            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
468                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
469                                                          <em class="parameter"><code><span class="type">void</span> *certificate</code></em>,
470                                                          <em class="parameter"><code><span class="type">size_t</span> *certificate_size</code></em>);
471 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-set-crt-raw" title="gnutls_pkcs7_set_crt_raw ()">gnutls_pkcs7_set_crt_raw</a>            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
472                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *crt</code></em>);
473 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-set-crt" title="gnutls_pkcs7_set_crt ()">gnutls_pkcs7_set_crt</a>                (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
474                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>);
475 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-delete-crt" title="gnutls_pkcs7_delete_crt ()">gnutls_pkcs7_delete_crt</a>             (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
476                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>);
477 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-get-crl-raw" title="gnutls_pkcs7_get_crl_raw ()">gnutls_pkcs7_get_crl_raw</a>            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
478                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
479                                                          <em class="parameter"><code><span class="type">void</span> *crl</code></em>,
480                                                          <em class="parameter"><code><span class="type">size_t</span> *crl_size</code></em>);
481 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-get-crl-count" title="gnutls_pkcs7_get_crl_count ()">gnutls_pkcs7_get_crl_count</a>          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);
482 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-set-crl-raw" title="gnutls_pkcs7_set_crl_raw ()">gnutls_pkcs7_set_crl_raw</a>            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
483                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *crl</code></em>);
484 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-set-crl" title="gnutls_pkcs7_set_crl ()">gnutls_pkcs7_set_crl</a>                (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
485                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);
486 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-delete-crl" title="gnutls_pkcs7_delete_crl ()">gnutls_pkcs7_delete_crl</a>             (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
487                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>);
488 enum                <a class="link" href="gnutls-x509.html#gnutls-certificate-verify-flags" title="enum gnutls_certificate_verify_flags">gnutls_certificate_verify_flags</a>;
489 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-check-issuer" title="gnutls_x509_crt_check_issuer ()">gnutls_x509_crt_check_issuer</a>        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
490                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>);
491 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-list-verify" title="gnutls_x509_crt_list_verify ()">gnutls_x509_crt_list_verify</a>         (<em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *cert_list</code></em>,
492                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> cert_list_length</code></em>,
493                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
494                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
495                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *CRL_list</code></em>,
496                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CRL_list_length</code></em>,
497                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
498                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);
499 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-verify" title="gnutls_x509_crt_verify ()">gnutls_x509_crt_verify</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
500                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
501                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
502                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
503                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);
504 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-verify" title="gnutls_x509_crl_verify ()">gnutls_x509_crl_verify</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
505                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
506                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
507                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
508                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);
509 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-check-revocation" title="gnutls_x509_crt_check_revocation ()">gnutls_x509_crt_check_revocation</a>    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
510                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *crl_list</code></em>,
511                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> crl_list_length</code></em>);
512 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-fingerprint" title="gnutls_x509_crt_get_fingerprint ()">gnutls_x509_crt_get_fingerprint</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
513                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-digest-algorithm-t" title="enum gnutls_digest_algorithm_t"><span class="type">gnutls_digest_algorithm_t</span></a> algo</code></em>,
514                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
515                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
516 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-key-purpose-oid" title="gnutls_x509_crt_get_key_purpose_oid ()">gnutls_x509_crt_get_key_purpose_oid</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
517                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
518                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
519                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
520                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
521 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-key-purpose-oid" title="gnutls_x509_crt_set_key_purpose_oid ()">gnutls_x509_crt_set_key_purpose_oid</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
522                                                          <em class="parameter"><code>const <span class="type">void</span> *oid</code></em>,
523                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);
524 enum                <a class="link" href="gnutls-x509.html#gnutls-pkcs-encrypt-flags-t" title="enum gnutls_pkcs_encrypt_flags_t">gnutls_pkcs_encrypt_flags_t</a>;
525 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-init" title="gnutls_x509_privkey_init ()">gnutls_x509_privkey_init</a>            (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> *key</code></em>);
526 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-deinit" title="gnutls_x509_privkey_deinit ()">gnutls_x509_privkey_deinit</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
527 <a class="link" href="gnutls-gnutls.html#gnutls-sec-param-t" title="enum gnutls_sec_param_t"><span class="returnvalue">gnutls_sec_param_t</span></a>  <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-sec-param" title="gnutls_x509_privkey_sec_param ()">gnutls_x509_privkey_sec_param</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
528 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-cpy" title="gnutls_x509_privkey_cpy ()">gnutls_x509_privkey_cpy</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> dst</code></em>,
529                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> src</code></em>);
530 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-import" title="gnutls_x509_privkey_import ()">gnutls_x509_privkey_import</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
531                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
532                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);
533 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-import-pkcs8" title="gnutls_x509_privkey_import_pkcs8 ()">gnutls_x509_privkey_import_pkcs8</a>    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
534                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
535                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
536                                                          <em class="parameter"><code>const <span class="type">char</span> *password</code></em>,
537                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
538 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-import-rsa-raw" title="gnutls_x509_privkey_import_rsa_raw ()">gnutls_x509_privkey_import_rsa_raw</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
539                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
540                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>,
541                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *d</code></em>,
542                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
543                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
544                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *u</code></em>);
545 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-import-rsa-raw2" title="gnutls_x509_privkey_import_rsa_raw2 ()">gnutls_x509_privkey_import_rsa_raw2</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
546                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
547                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>,
548                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *d</code></em>,
549                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
550                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
551                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *u</code></em>,
552                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e1</code></em>,
553                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e2</code></em>);
554 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-fix" title="gnutls_x509_privkey_fix ()">gnutls_x509_privkey_fix</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
555 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-export-dsa-raw" title="gnutls_x509_privkey_export_dsa_raw ()">gnutls_x509_privkey_export_dsa_raw</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
556                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
557                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
558                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *g</code></em>,
559                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *y</code></em>,
560                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *x</code></em>);
561 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-import-dsa-raw" title="gnutls_x509_privkey_import_dsa_raw ()">gnutls_x509_privkey_import_dsa_raw</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
562                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
563                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
564                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *g</code></em>,
565                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *y</code></em>,
566                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *x</code></em>);
567 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-get-pk-algorithm" title="gnutls_x509_privkey_get_pk_algorithm ()">gnutls_x509_privkey_get_pk_algorithm</a>
568                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
569 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-get-key-id" title="gnutls_x509_privkey_get_key_id ()">gnutls_x509_privkey_get_key_id</a>      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
570                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
571                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
572                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
573 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-generate" title="gnutls_x509_privkey_generate ()">gnutls_x509_privkey_generate</a>        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
574                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-pk-algorithm-t" title="enum gnutls_pk_algorithm_t"><span class="type">gnutls_pk_algorithm_t</span></a> algo</code></em>,
575                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> bits</code></em>,
576                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
577 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-export" title="gnutls_x509_privkey_export ()">gnutls_x509_privkey_export</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
578                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
579                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
580                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
581 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-export-pkcs8" title="gnutls_x509_privkey_export_pkcs8 ()">gnutls_x509_privkey_export_pkcs8</a>    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
582                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
583                                                          <em class="parameter"><code>const <span class="type">char</span> *password</code></em>,
584                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
585                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
586                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
587 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-export-rsa-raw2" title="gnutls_x509_privkey_export_rsa_raw2 ()">gnutls_x509_privkey_export_rsa_raw2</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
588                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
589                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>,
590                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *d</code></em>,
591                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
592                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
593                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *u</code></em>,
594                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e1</code></em>,
595                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e2</code></em>);
596 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-privkey-export-rsa-raw" title="gnutls_x509_privkey_export_rsa_raw ()">gnutls_x509_privkey_export_rsa_raw</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
597                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
598                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>,
599                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *d</code></em>,
600                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
601                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
602                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *u</code></em>);
603 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-print" title="gnutls_x509_crq_print ()">gnutls_x509_crq_print</a>               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
604                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
605                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);
606 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-init" title="gnutls_x509_crq_init ()">gnutls_x509_crq_init</a>                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> *crq</code></em>);
607 <span class="returnvalue">void</span>                <a class="link" href="gnutls-x509.html#gnutls-x509-crq-deinit" title="gnutls_x509_crq_deinit ()">gnutls_x509_crq_deinit</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);
608 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-import" title="gnutls_x509_crq_import ()">gnutls_x509_crq_import</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
609                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
610                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);
611 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-dn" title="gnutls_x509_crq_get_dn ()">gnutls_x509_crq_get_dn</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
612                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
613                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
614 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-dn-oid" title="gnutls_x509_crq_get_dn_oid ()">gnutls_x509_crq_get_dn_oid</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
615                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
616                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
617                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
618 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-dn-by-oid" title="gnutls_x509_crq_get_dn_by_oid ()">gnutls_x509_crq_get_dn_by_oid</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
619                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
620                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
621                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
622                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
623                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
624 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-dn-by-oid" title="gnutls_x509_crq_set_dn_by_oid ()">gnutls_x509_crq_set_dn_by_oid</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
625                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
626                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
627                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
628                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_data</code></em>);
629 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-version" title="gnutls_x509_crq_set_version ()">gnutls_x509_crq_set_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
630                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);
631 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-version" title="gnutls_x509_crq_get_version ()">gnutls_x509_crq_get_version</a>         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);
632 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-key" title="gnutls_x509_crq_set_key ()">gnutls_x509_crq_set_key</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
633                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);
634 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-challenge-password" title="gnutls_x509_crq_set_challenge_password ()">gnutls_x509_crq_set_challenge_password</a>
635                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
636                                                          <em class="parameter"><code>const <span class="type">char</span> *pass</code></em>);
637 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-challenge-password" title="gnutls_x509_crq_get_challenge_password ()">gnutls_x509_crq_get_challenge_password</a>
638                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
639                                                          <em class="parameter"><code><span class="type">char</span> *pass</code></em>,
640                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_pass</code></em>);
641 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-attribute-by-oid" title="gnutls_x509_crq_set_attribute_by_oid ()">gnutls_x509_crq_set_attribute_by_oid</a>
642                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
643                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
644                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
645                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_buf</code></em>);
646 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-by-oid" title="gnutls_x509_crq_get_attribute_by_oid ()">gnutls_x509_crq_get_attribute_by_oid</a>
647                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
648                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
649                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
650                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
651                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);
652 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-export" title="gnutls_x509_crq_export ()">gnutls_x509_crq_export</a>              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
653                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
654                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
655                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
656 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-crq" title="gnutls_x509_crt_set_crq ()">gnutls_x509_crt_set_crq</a>             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
657                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);
658 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-crq-extensions" title="gnutls_x509_crt_set_crq_extensions ()">gnutls_x509_crt_set_crq_extensions</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
659                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);
660 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-key-rsa-raw" title="gnutls_x509_crq_set_key_rsa_raw ()">gnutls_x509_crq_set_key_rsa_raw</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
661                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
662                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>);
663 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-subject-alt-name" title="gnutls_x509_crq_set_subject_alt_name ()">gnutls_x509_crq_set_subject_alt_name</a>
664                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
665                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> nt</code></em>,
666                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
667                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
668                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);
669 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-key-usage" title="gnutls_x509_crq_set_key_usage ()">gnutls_x509_crq_set_key_usage</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
670                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> usage</code></em>);
671 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-basic-constraints" title="gnutls_x509_crq_set_basic_constraints ()">gnutls_x509_crq_set_basic_constraints</a>
672                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
673                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>,
674                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>);
675 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-set-key-purpose-oid" title="gnutls_x509_crq_set_key_purpose_oid ()">gnutls_x509_crq_set_key_purpose_oid</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
676                                                          <em class="parameter"><code>const <span class="type">void</span> *oid</code></em>,
677                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);
678 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-key-purpose-oid" title="gnutls_x509_crq_get_key_purpose_oid ()">gnutls_x509_crq_get_key_purpose_oid</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
679                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
680                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
681                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
682                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
683 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-data" title="gnutls_x509_crq_get_extension_data ()">gnutls_x509_crq_get_extension_data</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
684                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
685                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
686                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);
687 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-info" title="gnutls_x509_crq_get_extension_info ()">gnutls_x509_crq_get_extension_info</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
688                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
689                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
690                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
691                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
692 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-data" title="gnutls_x509_crq_get_attribute_data ()">gnutls_x509_crq_get_attribute_data</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
693                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
694                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
695                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);
696 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-info" title="gnutls_x509_crq_get_attribute_info ()">gnutls_x509_crq_get_attribute_info</a>  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
697                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
698                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
699                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);
700 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-pk-algorithm" title="gnutls_x509_crq_get_pk_algorithm ()">gnutls_x509_crq_get_pk_algorithm</a>    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
701                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *bits</code></em>);
702 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-key-id" title="gnutls_x509_crq_get_key_id ()">gnutls_x509_crq_get_key_id</a>          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
703                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
704                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
705                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);
706 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-key-rsa-raw" title="gnutls_x509_crq_get_key_rsa_raw ()">gnutls_x509_crq_get_key_rsa_raw</a>     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
707                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
708                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>);
709 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-key-usage" title="gnutls_x509_crq_get_key_usage ()">gnutls_x509_crq_get_key_usage</a>       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
710                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *key_usage</code></em>,
711                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
712 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-basic-constraints" title="gnutls_x509_crq_get_basic_constraints ()">gnutls_x509_crq_get_basic_constraints</a>
713                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
714                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
715                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ca</code></em>,
716                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>);
717 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-subject-alt-name" title="gnutls_x509_crq_get_subject_alt_name ()">gnutls_x509_crq_get_subject_alt_name</a>
718                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
719                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
720                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
721                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
722                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
723                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
724 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-subject-alt-othername-oid" title="gnutls_x509_crq_get_subject_alt_othername_oid ()">gnutls_x509_crq_get_subject_alt_othername_oid</a>
725                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
726                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
727                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
728                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);
729 <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-by-oid" title="gnutls_x509_crq_get_extension_by_oid ()">gnutls_x509_crq_get_extension_by_oid</a>
730                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
731                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
732                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
733                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
734                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>,
735                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);
736 </pre>
737 </div>
738 <div class="refsect1">
739 <a name="gnutls-x509.description"></a><h2>Description</h2>
740 <p>
741 </p>
742 </div>
743 <div class="refsect1">
744 <a name="gnutls-x509.details"></a><h2>Details</h2>
745 <div class="refsect2">
746 <a name="GNUTLS-OID-X520-COUNTRY-NAME:CAPS"></a><h3>GNUTLS_OID_X520_COUNTRY_NAME</h3>
747 <pre class="programlisting">#define GNUTLS_OID_X520_COUNTRY_NAME                "2.5.4.6"
748 </pre>
749 <p>
750 </p>
751 </div>
752 <hr>
753 <div class="refsect2">
754 <a name="GNUTLS-OID-X520-ORGANIZATION-NAME:CAPS"></a><h3>GNUTLS_OID_X520_ORGANIZATION_NAME</h3>
755 <pre class="programlisting">#define GNUTLS_OID_X520_ORGANIZATION_NAME "2.5.4.10"
756 </pre>
757 <p>
758 </p>
759 </div>
760 <hr>
761 <div class="refsect2">
762 <a name="GNUTLS-OID-X520-ORGANIZATIONAL-UNIT-NAME:CAPS"></a><h3>GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME</h3>
763 <pre class="programlisting">#define GNUTLS_OID_X520_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
764 </pre>
765 <p>
766 </p>
767 </div>
768 <hr>
769 <div class="refsect2">
770 <a name="GNUTLS-OID-X520-COMMON-NAME:CAPS"></a><h3>GNUTLS_OID_X520_COMMON_NAME</h3>
771 <pre class="programlisting">#define GNUTLS_OID_X520_COMMON_NAME         "2.5.4.3"
772 </pre>
773 <p>
774 </p>
775 </div>
776 <hr>
777 <div class="refsect2">
778 <a name="GNUTLS-OID-X520-LOCALITY-NAME:CAPS"></a><h3>GNUTLS_OID_X520_LOCALITY_NAME</h3>
779 <pre class="programlisting">#define GNUTLS_OID_X520_LOCALITY_NAME               "2.5.4.7"
780 </pre>
781 <p>
782 </p>
783 </div>
784 <hr>
785 <div class="refsect2">
786 <a name="GNUTLS-OID-X520-STATE-OR-PROVINCE-NAME:CAPS"></a><h3>GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME</h3>
787 <pre class="programlisting">#define GNUTLS_OID_X520_STATE_OR_PROVINCE_NAME "2.5.4.8"
788 </pre>
789 <p>
790 </p>
791 </div>
792 <hr>
793 <div class="refsect2">
794 <a name="GNUTLS-OID-X520-INITIALS:CAPS"></a><h3>GNUTLS_OID_X520_INITIALS</h3>
795 <pre class="programlisting">#define GNUTLS_OID_X520_INITIALS            "2.5.4.43"
796 </pre>
797 <p>
798 </p>
799 </div>
800 <hr>
801 <div class="refsect2">
802 <a name="GNUTLS-OID-X520-GENERATION-QUALIFIER:CAPS"></a><h3>GNUTLS_OID_X520_GENERATION_QUALIFIER</h3>
803 <pre class="programlisting">#define GNUTLS_OID_X520_GENERATION_QUALIFIER "2.5.4.44"
804 </pre>
805 <p>
806 </p>
807 </div>
808 <hr>
809 <div class="refsect2">
810 <a name="GNUTLS-OID-X520-SURNAME:CAPS"></a><h3>GNUTLS_OID_X520_SURNAME</h3>
811 <pre class="programlisting">#define GNUTLS_OID_X520_SURNAME                     "2.5.4.4"
812 </pre>
813 <p>
814 </p>
815 </div>
816 <hr>
817 <div class="refsect2">
818 <a name="GNUTLS-OID-X520-GIVEN-NAME:CAPS"></a><h3>GNUTLS_OID_X520_GIVEN_NAME</h3>
819 <pre class="programlisting">#define GNUTLS_OID_X520_GIVEN_NAME          "2.5.4.42"
820 </pre>
821 <p>
822 </p>
823 </div>
824 <hr>
825 <div class="refsect2">
826 <a name="GNUTLS-OID-X520-TITLE:CAPS"></a><h3>GNUTLS_OID_X520_TITLE</h3>
827 <pre class="programlisting">#define GNUTLS_OID_X520_TITLE                       "2.5.4.12"
828 </pre>
829 <p>
830 </p>
831 </div>
832 <hr>
833 <div class="refsect2">
834 <a name="GNUTLS-OID-X520-DN-QUALIFIER:CAPS"></a><h3>GNUTLS_OID_X520_DN_QUALIFIER</h3>
835 <pre class="programlisting">#define GNUTLS_OID_X520_DN_QUALIFIER                "2.5.4.46"
836 </pre>
837 <p>
838 </p>
839 </div>
840 <hr>
841 <div class="refsect2">
842 <a name="GNUTLS-OID-X520-PSEUDONYM:CAPS"></a><h3>GNUTLS_OID_X520_PSEUDONYM</h3>
843 <pre class="programlisting">#define GNUTLS_OID_X520_PSEUDONYM           "2.5.4.65"
844 </pre>
845 <p>
846 </p>
847 </div>
848 <hr>
849 <div class="refsect2">
850 <a name="GNUTLS-OID-X520-POSTALCODE:CAPS"></a><h3>GNUTLS_OID_X520_POSTALCODE</h3>
851 <pre class="programlisting">#define GNUTLS_OID_X520_POSTALCODE              "2.5.4.17"
852 </pre>
853 <p>
854 </p>
855 </div>
856 <hr>
857 <div class="refsect2">
858 <a name="GNUTLS-OID-X520-NAME:CAPS"></a><h3>GNUTLS_OID_X520_NAME</h3>
859 <pre class="programlisting">#define GNUTLS_OID_X520_NAME                    "2.5.4.41"
860 </pre>
861 <p>
862 </p>
863 </div>
864 <hr>
865 <div class="refsect2">
866 <a name="GNUTLS-OID-LDAP-DC:CAPS"></a><h3>GNUTLS_OID_LDAP_DC</h3>
867 <pre class="programlisting">#define GNUTLS_OID_LDAP_DC                  "0.9.2342.19200300.100.1.25"
868 </pre>
869 <p>
870 </p>
871 </div>
872 <hr>
873 <div class="refsect2">
874 <a name="GNUTLS-OID-LDAP-UID:CAPS"></a><h3>GNUTLS_OID_LDAP_UID</h3>
875 <pre class="programlisting">#define GNUTLS_OID_LDAP_UID                 "0.9.2342.19200300.100.1.1"
876 </pre>
877 <p>
878 </p>
879 </div>
880 <hr>
881 <div class="refsect2">
882 <a name="GNUTLS-OID-PKCS9-EMAIL:CAPS"></a><h3>GNUTLS_OID_PKCS9_EMAIL</h3>
883 <pre class="programlisting">#define GNUTLS_OID_PKCS9_EMAIL                      "1.2.840.113549.1.9.1"
884 </pre>
885 <p>
886 </p>
887 </div>
888 <hr>
889 <div class="refsect2">
890 <a name="GNUTLS-OID-PKIX-DATE-OF-BIRTH:CAPS"></a><h3>GNUTLS_OID_PKIX_DATE_OF_BIRTH</h3>
891 <pre class="programlisting">#define GNUTLS_OID_PKIX_DATE_OF_BIRTH               "1.3.6.1.5.5.7.9.1"
892 </pre>
893 <p>
894 </p>
895 </div>
896 <hr>
897 <div class="refsect2">
898 <a name="GNUTLS-OID-PKIX-PLACE-OF-BIRTH:CAPS"></a><h3>GNUTLS_OID_PKIX_PLACE_OF_BIRTH</h3>
899 <pre class="programlisting">#define GNUTLS_OID_PKIX_PLACE_OF_BIRTH              "1.3.6.1.5.5.7.9.2"
900 </pre>
901 <p>
902 </p>
903 </div>
904 <hr>
905 <div class="refsect2">
906 <a name="GNUTLS-OID-PKIX-GENDER:CAPS"></a><h3>GNUTLS_OID_PKIX_GENDER</h3>
907 <pre class="programlisting">#define GNUTLS_OID_PKIX_GENDER                      "1.3.6.1.5.5.7.9.3"
908 </pre>
909 <p>
910 </p>
911 </div>
912 <hr>
913 <div class="refsect2">
914 <a name="GNUTLS-OID-PKIX-COUNTRY-OF-CITIZENSHIP:CAPS"></a><h3>GNUTLS_OID_PKIX_COUNTRY_OF_CITIZENSHIP</h3>
915 <pre class="programlisting">#define GNUTLS_OID_PKIX_COUNTRY_OF_CITIZENSHIP "1.3.6.1.5.5.7.9.4"
916 </pre>
917 <p>
918 </p>
919 </div>
920 <hr>
921 <div class="refsect2">
922 <a name="GNUTLS-OID-PKIX-COUNTRY-OF-RESIDENCE:CAPS"></a><h3>GNUTLS_OID_PKIX_COUNTRY_OF_RESIDENCE</h3>
923 <pre class="programlisting">#define GNUTLS_OID_PKIX_COUNTRY_OF_RESIDENCE "1.3.6.1.5.5.7.9.5"
924 </pre>
925 <p>
926 </p>
927 </div>
928 <hr>
929 <div class="refsect2">
930 <a name="GNUTLS-KP-TLS-WWW-SERVER:CAPS"></a><h3>GNUTLS_KP_TLS_WWW_SERVER</h3>
931 <pre class="programlisting">#define GNUTLS_KP_TLS_WWW_SERVER            "1.3.6.1.5.5.7.3.1"
932 </pre>
933 <p>
934 </p>
935 </div>
936 <hr>
937 <div class="refsect2">
938 <a name="GNUTLS-KP-TLS-WWW-CLIENT:CAPS"></a><h3>GNUTLS_KP_TLS_WWW_CLIENT</h3>
939 <pre class="programlisting">#define GNUTLS_KP_TLS_WWW_CLIENT                "1.3.6.1.5.5.7.3.2"
940 </pre>
941 <p>
942 </p>
943 </div>
944 <hr>
945 <div class="refsect2">
946 <a name="GNUTLS-KP-CODE-SIGNING:CAPS"></a><h3>GNUTLS_KP_CODE_SIGNING</h3>
947 <pre class="programlisting">#define GNUTLS_KP_CODE_SIGNING                      "1.3.6.1.5.5.7.3.3"
948 </pre>
949 <p>
950 </p>
951 </div>
952 <hr>
953 <div class="refsect2">
954 <a name="GNUTLS-KP-EMAIL-PROTECTION:CAPS"></a><h3>GNUTLS_KP_EMAIL_PROTECTION</h3>
955 <pre class="programlisting">#define GNUTLS_KP_EMAIL_PROTECTION          "1.3.6.1.5.5.7.3.4"
956 </pre>
957 <p>
958 </p>
959 </div>
960 <hr>
961 <div class="refsect2">
962 <a name="GNUTLS-KP-TIME-STAMPING:CAPS"></a><h3>GNUTLS_KP_TIME_STAMPING</h3>
963 <pre class="programlisting">#define GNUTLS_KP_TIME_STAMPING                     "1.3.6.1.5.5.7.3.8"
964 </pre>
965 <p>
966 </p>
967 </div>
968 <hr>
969 <div class="refsect2">
970 <a name="GNUTLS-KP-OCSP-SIGNING:CAPS"></a><h3>GNUTLS_KP_OCSP_SIGNING</h3>
971 <pre class="programlisting">#define GNUTLS_KP_OCSP_SIGNING                      "1.3.6.1.5.5.7.3.9"
972 </pre>
973 <p>
974 </p>
975 </div>
976 <hr>
977 <div class="refsect2">
978 <a name="GNUTLS-KP-IPSEC-IKE:CAPS"></a><h3>GNUTLS_KP_IPSEC_IKE</h3>
979 <pre class="programlisting">#define GNUTLS_KP_IPSEC_IKE                 "1.3.6.1.5.5.7.3.17"
980 </pre>
981 <p>
982 </p>
983 </div>
984 <hr>
985 <div class="refsect2">
986 <a name="GNUTLS-KP-ANY:CAPS"></a><h3>GNUTLS_KP_ANY</h3>
987 <pre class="programlisting">#define GNUTLS_KP_ANY                               "2.5.29.37.0"
988 </pre>
989 <p>
990 </p>
991 </div>
992 <hr>
993 <div class="refsect2">
994 <a name="GNUTLS-FSAN-SET:CAPS"></a><h3>GNUTLS_FSAN_SET</h3>
995 <pre class="programlisting">#define GNUTLS_FSAN_SET 0
996 </pre>
997 <p>
998 </p>
999 </div>
1000 <hr>
1001 <div class="refsect2">
1002 <a name="GNUTLS-FSAN-APPEND:CAPS"></a><h3>GNUTLS_FSAN_APPEND</h3>
1003 <pre class="programlisting">#define GNUTLS_FSAN_APPEND 1
1004 </pre>
1005 <p>
1006 </p>
1007 </div>
1008 <hr>
1009 <div class="refsect2">
1010 <a name="gnutls-certificate-import-flags"></a><h3>enum gnutls_certificate_import_flags</h3>
1011 <pre class="programlisting">typedef enum {
1012     GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED = 1,
1013     GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED = 2
1014 } gnutls_certificate_import_flags;
1015 </pre>
1016 <p>
1017 Enumeration of different certificate import flags.
1018 </p>
1019 <div class="variablelist"><table border="0">
1020 <col align="left" valign="top">
1021 <tbody>
1022 <tr>
1023 <td><p><a name="GNUTLS-X509-CRT-LIST-IMPORT-FAIL-IF-EXCEED:CAPS"></a><span class="term"><code class="literal">GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED</code></span></p></td>
1024 <td>Fail if the
1025   certificates in the buffer are more than the space allocated for
1026   certificates. The error code will be <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a>.
1027 </td>
1028 </tr>
1029 <tr>
1030 <td><p><a name="GNUTLS-X509-CRT-LIST-FAIL-IF-UNSORTED:CAPS"></a><span class="term"><code class="literal">GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED</code></span></p></td>
1031 <td>Fail if the certificates
1032   in the buffer are not ordered starting from subject to issuer.
1033   The error code will be <code class="literal">GNUTLS_E_CERTIFICATE_LIST_UNSORTED</code>.
1034 </td>
1035 </tr>
1036 </tbody>
1037 </table></div>
1038 </div>
1039 <hr>
1040 <div class="refsect2">
1041 <a name="gnutls-x509-crt-init"></a><h3>gnutls_x509_crt_init ()</h3>
1042 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_init                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *cert</code></em>);</pre>
1043 <p>
1044 This function will initialize an X.509 certificate structure.
1045 </p>
1046 <div class="variablelist"><table border="0">
1047 <col align="left" valign="top">
1048 <tbody>
1049 <tr>
1050 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1051 <td>The structure to be initialized</td>
1052 </tr>
1053 <tr>
1054 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1055 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1056 negative error value.</td>
1057 </tr>
1058 </tbody>
1059 </table></div>
1060 </div>
1061 <hr>
1062 <div class="refsect2">
1063 <a name="gnutls-x509-crt-deinit"></a><h3>gnutls_x509_crt_deinit ()</h3>
1064 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_x509_crt_deinit              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);</pre>
1065 <p>
1066 This function will deinitialize a certificate structure.
1067 </p>
1068 <div class="variablelist"><table border="0">
1069 <col align="left" valign="top">
1070 <tbody><tr>
1071 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1072 <td>The structure to be deinitialized</td>
1073 </tr></tbody>
1074 </table></div>
1075 </div>
1076 <hr>
1077 <div class="refsect2">
1078 <a name="gnutls-x509-crt-import"></a><h3>gnutls_x509_crt_import ()</h3>
1079 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_import              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1080                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
1081                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);</pre>
1082 <p>
1083 This function will convert the given DER or PEM encoded Certificate
1084 to the native gnutls_x509_crt_t format. The output will be stored
1085 in <em class="parameter"><code>cert</code></em>.
1086 </p>
1087 <p>
1088 If the Certificate is PEM encoded it should have a header of "X509
1089 CERTIFICATE", or "CERTIFICATE".
1090 </p>
1091 <div class="variablelist"><table border="0">
1092 <col align="left" valign="top">
1093 <tbody>
1094 <tr>
1095 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1096 <td>The structure to store the parsed certificate.</td>
1097 </tr>
1098 <tr>
1099 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1100 <td>The DER or PEM encoded certificate.</td>
1101 </tr>
1102 <tr>
1103 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
1104 <td>One of DER or PEM</td>
1105 </tr>
1106 <tr>
1107 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1108 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1109 negative error value.</td>
1110 </tr>
1111 </tbody>
1112 </table></div>
1113 </div>
1114 <hr>
1115 <div class="refsect2">
1116 <a name="gnutls-x509-crt-list-import"></a><h3>gnutls_x509_crt_list_import ()</h3>
1117 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_list_import         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *certs</code></em>,
1118                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *cert_max</code></em>,
1119                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
1120                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
1121                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
1122 <p>
1123 This function will convert the given PEM encoded certificate list
1124 to the native gnutls_x509_crt_t format. The output will be stored
1125 in <em class="parameter"><code>certs</code></em>.  They will be automatically initialized.
1126 </p>
1127 <p>
1128 The flag <a class="link" href="gnutls-x509.html#GNUTLS-X509-CRT-LIST-IMPORT-FAIL-IF-EXCEED:CAPS"><code class="literal">GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED</code></a> will cause
1129 import to fail if the certificates in the provided buffer are more
1130 than the available structures. The <a class="link" href="gnutls-x509.html#GNUTLS-X509-CRT-LIST-FAIL-IF-UNSORTED:CAPS"><code class="literal">GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED</code></a>
1131 flag will cause the function to fail if the provided list is not
1132 sorted from subject to issuer.
1133 </p>
1134 <p>
1135 If the Certificate is PEM encoded it should have a header of "X509
1136 CERTIFICATE", or "CERTIFICATE".
1137 </p>
1138 <div class="variablelist"><table border="0">
1139 <col align="left" valign="top">
1140 <tbody>
1141 <tr>
1142 <td><p><span class="term"><em class="parameter"><code>certs</code></em> :</span></p></td>
1143 <td>The structures to store the parsed certificate. Must not be initialized.</td>
1144 </tr>
1145 <tr>
1146 <td><p><span class="term"><em class="parameter"><code>cert_max</code></em> :</span></p></td>
1147 <td>Initially must hold the maximum number of certs. It will be updated with the number of certs available.</td>
1148 </tr>
1149 <tr>
1150 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1151 <td>The PEM encoded certificate.</td>
1152 </tr>
1153 <tr>
1154 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
1155 <td>One of DER or PEM.</td>
1156 </tr>
1157 <tr>
1158 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
1159 <td>must be zero or an OR'd sequence of gnutls_certificate_import_flags.</td>
1160 </tr>
1161 <tr>
1162 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1163 <td>the number of certificates read or a negative error value.</td>
1164 </tr>
1165 </tbody>
1166 </table></div>
1167 </div>
1168 <hr>
1169 <div class="refsect2">
1170 <a name="gnutls-x509-crt-export"></a><h3>gnutls_x509_crt_export ()</h3>
1171 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_export              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1172                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
1173                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
1174                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
1175 <p>
1176 This function will export the certificate to DER or PEM format.
1177 </p>
1178 <p>
1179 If the buffer provided is not long enough to hold the output, then
1180 *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
1181 be returned.
1182 </p>
1183 <p>
1184 If the structure is PEM encoded, it will have a header
1185 of "BEGIN CERTIFICATE".
1186 </p>
1187 <div class="variablelist"><table border="0">
1188 <col align="left" valign="top">
1189 <tbody>
1190 <tr>
1191 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1192 <td>Holds the certificate</td>
1193 </tr>
1194 <tr>
1195 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
1196 <td>the format of output params. One of PEM or DER.</td>
1197 </tr>
1198 <tr>
1199 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
1200 <td>will contain a certificate PEM or DER encoded</td>
1201 </tr>
1202 <tr>
1203 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
1204 <td>holds the size of output_data (and will be
1205 replaced by the actual size of parameters)</td>
1206 </tr>
1207 <tr>
1208 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1209 <td>In case of failure a negative value will be
1210 returned, and 0 on success.</td>
1211 </tr>
1212 </tbody>
1213 </table></div>
1214 </div>
1215 <hr>
1216 <div class="refsect2">
1217 <a name="gnutls-x509-crt-get-issuer-dn"></a><h3>gnutls_x509_crt_get_issuer_dn ()</h3>
1218 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_dn       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1219                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
1220                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1221 <p>
1222 This function will copy the name of the Certificate issuer in the
1223 provided buffer. The name will be in the form
1224 "C=xxxx,O=yyyy,CN=zzzz" as described in RFC2253. The output string
1225 will be ASCII or UTF-8 encoded, depending on the certificate data.
1226 </p>
1227 <p>
1228 If <em class="parameter"><code>buf</code></em> is null then only the size will be filled.
1229 </p>
1230 <div class="variablelist"><table border="0">
1231 <col align="left" valign="top">
1232 <tbody>
1233 <tr>
1234 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1235 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1236 </tr>
1237 <tr>
1238 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1239 <td>a pointer to a structure to hold the name (may be null)</td>
1240 </tr>
1241 <tr>
1242 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1243 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
1244 </td>
1245 </tr>
1246 <tr>
1247 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1248 <td>GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
1249 long enough, and in that case the *sizeof_buf will be updated with
1250 the required size.  On success 0 is returned.</td>
1251 </tr>
1252 </tbody>
1253 </table></div>
1254 </div>
1255 <hr>
1256 <div class="refsect2">
1257 <a name="gnutls-x509-crt-get-issuer-dn-oid"></a><h3>gnutls_x509_crt_get_issuer_dn_oid ()</h3>
1258 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_dn_oid   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1259                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
1260                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
1261                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
1262 <p>
1263 This function will extract the OIDs of the name of the Certificate
1264 issuer specified by the given index.
1265 </p>
1266 <p>
1267 If <em class="parameter"><code>oid</code></em> is null then only the size will be filled.
1268 </p>
1269 <div class="variablelist"><table border="0">
1270 <col align="left" valign="top">
1271 <tbody>
1272 <tr>
1273 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1274 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1275 </tr>
1276 <tr>
1277 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
1278 <td>This specifies which OID to return. Use zero to get the first one.</td>
1279 </tr>
1280 <tr>
1281 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
1282 <td>a pointer to a buffer to hold the OID (may be null)</td>
1283 </tr>
1284 <tr>
1285 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
1286 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
1287 </td>
1288 </tr>
1289 <tr>
1290 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1291 <td>GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
1292 long enough, and in that case the *sizeof_oid will be updated
1293 with the required size.  On success 0 is returned.</td>
1294 </tr>
1295 </tbody>
1296 </table></div>
1297 </div>
1298 <hr>
1299 <div class="refsect2">
1300 <a name="gnutls-x509-crt-get-issuer-dn-by-oid"></a><h3>gnutls_x509_crt_get_issuer_dn_by_oid ()</h3>
1301 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_dn_by_oid
1302                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1303                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
1304                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
1305                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
1306                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
1307                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1308 <p>
1309 This function will extract the part of the name of the Certificate
1310 issuer specified by the given OID. The output, if the raw flag is not
1311 used, will be encoded as described in RFC2253. Thus a string that is
1312 ASCII or UTF-8 encoded, depending on the certificate data.
1313 </p>
1314 <p>
1315 Some helper macros with popular OIDs can be found in gnutls/x509.h
1316 If raw flag is zero, this function will only return known OIDs as
1317 text. Other OIDs will be DER encoded, as described in RFC2253 --
1318 in hex format with a '#' prefix.  You can check about known OIDs
1319 using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>.
1320 </p>
1321 <p>
1322 If <em class="parameter"><code>buf</code></em> is null then only the size will be filled.
1323 </p>
1324 <div class="variablelist"><table border="0">
1325 <col align="left" valign="top">
1326 <tbody>
1327 <tr>
1328 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1329 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1330 </tr>
1331 <tr>
1332 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
1333 <td>holds an Object Identified in null terminated string</td>
1334 </tr>
1335 <tr>
1336 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
1337 <td>In case multiple same OIDs exist in the RDN, this specifies which to send. Use zero to get the first one.</td>
1338 </tr>
1339 <tr>
1340 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
1341 <td>If non zero returns the raw DER data of the DN part.</td>
1342 </tr>
1343 <tr>
1344 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1345 <td>a pointer to a structure to hold the name (may be null)</td>
1346 </tr>
1347 <tr>
1348 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1349 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
1350 </td>
1351 </tr>
1352 <tr>
1353 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1354 <td>GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
1355 long enough, and in that case the *sizeof_buf will be updated
1356 with the required size.  On success 0 is returned.</td>
1357 </tr>
1358 </tbody>
1359 </table></div>
1360 </div>
1361 <hr>
1362 <div class="refsect2">
1363 <a name="gnutls-x509-crt-get-dn"></a><h3>gnutls_x509_crt_get_dn ()</h3>
1364 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_dn              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1365                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
1366                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1367 <p>
1368 This function will copy the name of the Certificate in the provided
1369 buffer. The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
1370 described in RFC2253. The output string will be ASCII or UTF-8
1371 encoded, depending on the certificate data.
1372 </p>
1373 <p>
1374 If <em class="parameter"><code>buf</code></em> is null then only the size will be filled.
1375 </p>
1376 <div class="variablelist"><table border="0">
1377 <col align="left" valign="top">
1378 <tbody>
1379 <tr>
1380 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1381 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1382 </tr>
1383 <tr>
1384 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1385 <td>a pointer to a structure to hold the name (may be null)</td>
1386 </tr>
1387 <tr>
1388 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1389 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
1390 </td>
1391 </tr>
1392 <tr>
1393 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1394 <td>
1395 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is not
1396 long enough, and in that case the *sizeof_buf will be updated
1397 with the required size.  On success 0 is returned.</td>
1398 </tr>
1399 </tbody>
1400 </table></div>
1401 </div>
1402 <hr>
1403 <div class="refsect2">
1404 <a name="gnutls-x509-crt-get-dn-oid"></a><h3>gnutls_x509_crt_get_dn_oid ()</h3>
1405 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_dn_oid          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1406                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
1407                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
1408                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
1409 <p>
1410 This function will extract the OIDs of the name of the Certificate
1411 subject specified by the given index.
1412 </p>
1413 <p>
1414 If oid is null then only the size will be filled.
1415 </p>
1416 <div class="variablelist"><table border="0">
1417 <col align="left" valign="top">
1418 <tbody>
1419 <tr>
1420 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1421 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1422 </tr>
1423 <tr>
1424 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
1425 <td>This specifies which OID to return. Use zero to get the first one.</td>
1426 </tr>
1427 <tr>
1428 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
1429 <td>a pointer to a buffer to hold the OID (may be null)</td>
1430 </tr>
1431 <tr>
1432 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
1433 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
1434 </td>
1435 </tr>
1436 <tr>
1437 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1438 <td>
1439 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
1440 not long enough, and in that case the *sizeof_oid will be updated
1441 with the required size.  On success 0 is returned.</td>
1442 </tr>
1443 </tbody>
1444 </table></div>
1445 </div>
1446 <hr>
1447 <div class="refsect2">
1448 <a name="gnutls-x509-crt-get-dn-by-oid"></a><h3>gnutls_x509_crt_get_dn_by_oid ()</h3>
1449 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_dn_by_oid       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1450                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
1451                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
1452                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
1453                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
1454                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1455 <p>
1456 This function will extract the part of the name of the Certificate
1457 subject specified by the given OID. The output, if the raw flag is
1458 not used, will be encoded as described in RFC2253. Thus a string
1459 that is ASCII or UTF-8 encoded, depending on the certificate data.
1460 </p>
1461 <p>
1462 Some helper macros with popular OIDs can be found in gnutls/x509.h
1463 If raw flag is zero, this function will only return known OIDs as
1464 text. Other OIDs will be DER encoded, as described in RFC2253 --
1465 in hex format with a '#' prefix.  You can check about known OIDs
1466 using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>.
1467 </p>
1468 <p>
1469 If <em class="parameter"><code>buf</code></em> is null then only the size will be filled.
1470 </p>
1471 <div class="variablelist"><table border="0">
1472 <col align="left" valign="top">
1473 <tbody>
1474 <tr>
1475 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1476 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1477 </tr>
1478 <tr>
1479 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
1480 <td>holds an Object Identified in null terminated string</td>
1481 </tr>
1482 <tr>
1483 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
1484 <td>In case multiple same OIDs exist in the RDN, this specifies which to send. Use zero to get the first one.</td>
1485 </tr>
1486 <tr>
1487 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
1488 <td>If non zero returns the raw DER data of the DN part.</td>
1489 </tr>
1490 <tr>
1491 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1492 <td>a pointer where the DN part will be copied (may be null).</td>
1493 </tr>
1494 <tr>
1495 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1496 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
1497 </td>
1498 </tr>
1499 <tr>
1500 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1501 <td>
1502 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
1503 not long enough, and in that case the *sizeof_buf will be updated
1504 with the required size.  On success 0 is returned.</td>
1505 </tr>
1506 </tbody>
1507 </table></div>
1508 </div>
1509 <hr>
1510 <div class="refsect2">
1511 <a name="gnutls-x509-crt-check-hostname"></a><h3>gnutls_x509_crt_check_hostname ()</h3>
1512 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_check_hostname      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1513                                                          <em class="parameter"><code>const <span class="type">char</span> *hostname</code></em>);</pre>
1514 <p>
1515 This function will check if the given certificate's subject matches
1516 the given hostname.  This is a basic implementation of the matching
1517 described in RFC2818 (HTTPS), which takes into account wildcards,
1518 and the DNSName/IPAddress subject alternative name PKIX extension.
1519 </p>
1520 <div class="variablelist"><table border="0">
1521 <col align="left" valign="top">
1522 <tbody>
1523 <tr>
1524 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1525 <td>should contain an gnutls_x509_crt_t structure</td>
1526 </tr>
1527 <tr>
1528 <td><p><span class="term"><em class="parameter"><code>hostname</code></em> :</span></p></td>
1529 <td>A null terminated string that contains a DNS name</td>
1530 </tr>
1531 <tr>
1532 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1533 <td>non zero for a successful match, and zero on failure.</td>
1534 </tr>
1535 </tbody>
1536 </table></div>
1537 </div>
1538 <hr>
1539 <div class="refsect2">
1540 <a name="gnutls-x509-crt-get-signature-algorithm"></a><h3>gnutls_x509_crt_get_signature_algorithm ()</h3>
1541 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_signature_algorithm
1542                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);</pre>
1543 <p>
1544 This function will return a value of the <a class="link" href="gnutls-gnutls.html#gnutls-sign-algorithm-t" title="enum gnutls_sign_algorithm_t"><span class="type">gnutls_sign_algorithm_t</span></a>
1545 enumeration that is the signature algorithm that has been used to
1546 sign this certificate.
1547 </p>
1548 <div class="variablelist"><table border="0">
1549 <col align="left" valign="top">
1550 <tbody>
1551 <tr>
1552 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1553 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1554 </tr>
1555 <tr>
1556 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1557 <td>a <a class="link" href="gnutls-gnutls.html#gnutls-sign-algorithm-t" title="enum gnutls_sign_algorithm_t"><span class="type">gnutls_sign_algorithm_t</span></a> value, or a negative value on
1558 error.</td>
1559 </tr>
1560 </tbody>
1561 </table></div>
1562 </div>
1563 <hr>
1564 <div class="refsect2">
1565 <a name="gnutls-x509-crt-get-signature"></a><h3>gnutls_x509_crt_get_signature ()</h3>
1566 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_signature       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1567                                                          <em class="parameter"><code><span class="type">char</span> *sig</code></em>,
1568                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_sig</code></em>);</pre>
1569 <p>
1570 This function will extract the signature field of a certificate.
1571 </p>
1572 <div class="variablelist"><table border="0">
1573 <col align="left" valign="top">
1574 <tbody>
1575 <tr>
1576 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1577 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1578 </tr>
1579 <tr>
1580 <td><p><span class="term"><em class="parameter"><code>sig</code></em> :</span></p></td>
1581 <td>a pointer where the signature part will be copied (may be null).</td>
1582 </tr>
1583 <tr>
1584 <td><p><span class="term"><em class="parameter"><code>sizeof_sig</code></em> :</span></p></td>
1585 <td>initially holds the size of <em class="parameter"><code>sig</code></em>
1586 </td>
1587 </tr>
1588 <tr>
1589 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1590 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1591 negative error value. and a negative value on error.</td>
1592 </tr>
1593 </tbody>
1594 </table></div>
1595 </div>
1596 <hr>
1597 <div class="refsect2">
1598 <a name="gnutls-x509-crt-get-version"></a><h3>gnutls_x509_crt_get_version ()</h3>
1599 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);</pre>
1600 <p>
1601 This function will return the version of the specified Certificate.
1602 </p>
1603 <div class="variablelist"><table border="0">
1604 <col align="left" valign="top">
1605 <tbody>
1606 <tr>
1607 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1608 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1609 </tr>
1610 <tr>
1611 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1612 <td>version of certificate, or a negative value on error.</td>
1613 </tr>
1614 </tbody>
1615 </table></div>
1616 </div>
1617 <hr>
1618 <div class="refsect2">
1619 <a name="gnutls-x509-crt-get-key-id"></a><h3>gnutls_x509_crt_get_key_id ()</h3>
1620 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_key_id          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
1621                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
1622                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
1623                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
1624 <p>
1625 This function will return a unique ID the depends on the public
1626 key parameters. This ID can be used in checking whether a
1627 certificate corresponds to the given private key.
1628 </p>
1629 <p>
1630 If the buffer provided is not long enough to hold the output, then
1631 *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
1632 be returned.  The output will normally be a SHA-1 hash output,
1633 which is 20 bytes.
1634 </p>
1635 <div class="variablelist"><table border="0">
1636 <col align="left" valign="top">
1637 <tbody>
1638 <tr>
1639 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
1640 <td>Holds the certificate</td>
1641 </tr>
1642 <tr>
1643 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
1644 <td>should be 0 for now</td>
1645 </tr>
1646 <tr>
1647 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
1648 <td>will contain the key ID</td>
1649 </tr>
1650 <tr>
1651 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
1652 <td>holds the size of output_data (and will be
1653 replaced by the actual size of parameters)</td>
1654 </tr>
1655 <tr>
1656 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1657 <td>In case of failure a negative value will be
1658 returned, and 0 on success.</td>
1659 </tr>
1660 </tbody>
1661 </table></div>
1662 </div>
1663 <hr>
1664 <div class="refsect2">
1665 <a name="gnutls-x509-crt-set-authority-key-id"></a><h3>gnutls_x509_crt_set_authority_key_id ()</h3>
1666 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_authority_key_id
1667                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1668                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
1669                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);</pre>
1670 <p>
1671 This function will set the X.509 certificate's authority key ID extension.
1672 Only the keyIdentifier field can be set with this function.
1673 </p>
1674 <div class="variablelist"><table border="0">
1675 <col align="left" valign="top">
1676 <tbody>
1677 <tr>
1678 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1679 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
1680 </td>
1681 </tr>
1682 <tr>
1683 <td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
1684 <td>The key ID</td>
1685 </tr>
1686 <tr>
1687 <td><p><span class="term"><em class="parameter"><code>id_size</code></em> :</span></p></td>
1688 <td>Holds the size of the serial field.</td>
1689 </tr>
1690 <tr>
1691 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1692 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1693 negative error value.</td>
1694 </tr>
1695 </tbody>
1696 </table></div>
1697 </div>
1698 <hr>
1699 <div class="refsect2">
1700 <a name="gnutls-x509-crt-get-authority-key-id"></a><h3>gnutls_x509_crt_get_authority_key_id ()</h3>
1701 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_authority_key_id
1702                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1703                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
1704                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
1705                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
1706 <p>
1707 This function will return the X.509v3 certificate authority's key
1708 identifier.  This is obtained by the X.509 Authority Key
1709 identifier extension field (2.5.29.35). Note that this function
1710 only returns the keyIdentifier field of the extension.
1711 </p>
1712 <div class="variablelist"><table border="0">
1713 <col align="left" valign="top">
1714 <tbody>
1715 <tr>
1716 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1717 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1718 </tr>
1719 <tr>
1720 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
1721 <td>The place where the identifier will be copied</td>
1722 </tr>
1723 <tr>
1724 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
1725 <td>Holds the size of the result field.</td>
1726 </tr>
1727 <tr>
1728 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
1729 <td>will be non zero if the extension is marked as critical (may be null)</td>
1730 </tr>
1731 <tr>
1732 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1733 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1734 negative error value.</td>
1735 </tr>
1736 </tbody>
1737 </table></div>
1738 </div>
1739 <hr>
1740 <div class="refsect2">
1741 <a name="gnutls-x509-crt-get-subject-key-id"></a><h3>gnutls_x509_crt_get_subject_key_id ()</h3>
1742 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject_key_id  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1743                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
1744                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
1745                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
1746 <p>
1747 This function will return the X.509v3 certificate's subject key
1748 identifier.  This is obtained by the X.509 Subject Key identifier
1749 extension field (2.5.29.14).
1750 </p>
1751 <div class="variablelist"><table border="0">
1752 <col align="left" valign="top">
1753 <tbody>
1754 <tr>
1755 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1756 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1757 </tr>
1758 <tr>
1759 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
1760 <td>The place where the identifier will be copied</td>
1761 </tr>
1762 <tr>
1763 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
1764 <td>Holds the size of the result field.</td>
1765 </tr>
1766 <tr>
1767 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
1768 <td>will be non zero if the extension is marked as critical (may be null)</td>
1769 </tr>
1770 <tr>
1771 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1772 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
1773 negative error value.</td>
1774 </tr>
1775 </tbody>
1776 </table></div>
1777 </div>
1778 <hr>
1779 <div class="refsect2">
1780 <a name="gnutls-x509-crt-get-subject-unique-id"></a><h3>gnutls_x509_crt_get_subject_unique_id ()</h3>
1781 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject_unique_id
1782                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
1783                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
1784                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1785 <p>
1786 This function will extract the subjectUniqueID value (if present) for
1787 the given certificate.
1788 </p>
1789 <p>
1790 If the user allocated memory buffer is not large enough to hold the
1791 full subjectUniqueID, then a GNUTLS_E_SHORT_MEMORY_BUFFER error will be
1792 returned, and sizeof_buf will be set to the actual length.
1793 </p>
1794 <div class="variablelist"><table border="0">
1795 <col align="left" valign="top">
1796 <tbody>
1797 <tr>
1798 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
1799 <td>Holds the certificate</td>
1800 </tr>
1801 <tr>
1802 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1803 <td>user allocated memory buffer, will hold the unique id</td>
1804 </tr>
1805 <tr>
1806 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1807 <td>size of user allocated memory buffer (on input), will hold
1808 actual size of the unique ID on return.</td>
1809 </tr>
1810 <tr>
1811 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1812 <td>
1813 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> on success, otherwise an error.</td>
1814 </tr>
1815 </tbody>
1816 </table></div>
1817 </div>
1818 <hr>
1819 <div class="refsect2">
1820 <a name="gnutls-x509-crt-get-issuer-unique-id"></a><h3>gnutls_x509_crt_get_issuer_unique_id ()</h3>
1821 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_unique_id
1822                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
1823                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
1824                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
1825 <p>
1826 This function will extract the issuerUniqueID value (if present) for
1827 the given certificate.
1828 </p>
1829 <p>
1830 If the user allocated memory buffer is not large enough to hold the
1831 full subjectUniqueID, then a GNUTLS_E_SHORT_MEMORY_BUFFER error will be
1832 returned, and sizeof_buf will be set to the actual length.
1833 </p>
1834 <div class="variablelist"><table border="0">
1835 <col align="left" valign="top">
1836 <tbody>
1837 <tr>
1838 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
1839 <td>Holds the certificate</td>
1840 </tr>
1841 <tr>
1842 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1843 <td>user allocated memory buffer, will hold the unique id</td>
1844 </tr>
1845 <tr>
1846 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
1847 <td>size of user allocated memory buffer (on input), will hold
1848 actual size of the unique ID on return.</td>
1849 </tr>
1850 <tr>
1851 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1852 <td>
1853 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> on success, otherwise an error.</td>
1854 </tr>
1855 </tbody>
1856 </table></div>
1857 </div>
1858 <hr>
1859 <div class="refsect2">
1860 <a name="GNUTLS-CRL-REASON-UNUSED:CAPS"></a><h3>GNUTLS_CRL_REASON_UNUSED</h3>
1861 <pre class="programlisting">#define GNUTLS_CRL_REASON_UNUSED 128
1862 </pre>
1863 <p>
1864 </p>
1865 </div>
1866 <hr>
1867 <div class="refsect2">
1868 <a name="GNUTLS-CRL-REASON-KEY-COMPROMISE:CAPS"></a><h3>GNUTLS_CRL_REASON_KEY_COMPROMISE</h3>
1869 <pre class="programlisting">#define GNUTLS_CRL_REASON_KEY_COMPROMISE 64
1870 </pre>
1871 <p>
1872 </p>
1873 </div>
1874 <hr>
1875 <div class="refsect2">
1876 <a name="GNUTLS-CRL-REASON-CA-COMPROMISE:CAPS"></a><h3>GNUTLS_CRL_REASON_CA_COMPROMISE</h3>
1877 <pre class="programlisting">#define GNUTLS_CRL_REASON_CA_COMPROMISE 32
1878 </pre>
1879 <p>
1880 </p>
1881 </div>
1882 <hr>
1883 <div class="refsect2">
1884 <a name="GNUTLS-CRL-REASON-AFFILIATION-CHANGED:CAPS"></a><h3>GNUTLS_CRL_REASON_AFFILIATION_CHANGED</h3>
1885 <pre class="programlisting">#define GNUTLS_CRL_REASON_AFFILIATION_CHANGED 16
1886 </pre>
1887 <p>
1888 </p>
1889 </div>
1890 <hr>
1891 <div class="refsect2">
1892 <a name="GNUTLS-CRL-REASON-SUPERSEDED:CAPS"></a><h3>GNUTLS_CRL_REASON_SUPERSEDED</h3>
1893 <pre class="programlisting">#define GNUTLS_CRL_REASON_SUPERSEDED 8
1894 </pre>
1895 <p>
1896 </p>
1897 </div>
1898 <hr>
1899 <div class="refsect2">
1900 <a name="GNUTLS-CRL-REASON-SUPERSEEDED:CAPS"></a><h3>GNUTLS_CRL_REASON_SUPERSEEDED</h3>
1901 <pre class="programlisting">#define GNUTLS_CRL_REASON_SUPERSEEDED GNUTLS_CRL_REASON_SUPERSEDED
1902 </pre>
1903 <p>
1904 </p>
1905 </div>
1906 <hr>
1907 <div class="refsect2">
1908 <a name="GNUTLS-CRL-REASON-CESSATION-OF-OPERATION:CAPS"></a><h3>GNUTLS_CRL_REASON_CESSATION_OF_OPERATION</h3>
1909 <pre class="programlisting">#define GNUTLS_CRL_REASON_CESSATION_OF_OPERATION 4
1910 </pre>
1911 <p>
1912 </p>
1913 </div>
1914 <hr>
1915 <div class="refsect2">
1916 <a name="GNUTLS-CRL-REASON-CERTIFICATE-HOLD:CAPS"></a><h3>GNUTLS_CRL_REASON_CERTIFICATE_HOLD</h3>
1917 <pre class="programlisting">#define GNUTLS_CRL_REASON_CERTIFICATE_HOLD 2
1918 </pre>
1919 <p>
1920 </p>
1921 </div>
1922 <hr>
1923 <div class="refsect2">
1924 <a name="GNUTLS-CRL-REASON-PRIVILEGE-WITHDRAWN:CAPS"></a><h3>GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN</h3>
1925 <pre class="programlisting">#define GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN 1
1926 </pre>
1927 <p>
1928 </p>
1929 </div>
1930 <hr>
1931 <div class="refsect2">
1932 <a name="GNUTLS-CRL-REASON-AA-COMPROMISE:CAPS"></a><h3>GNUTLS_CRL_REASON_AA_COMPROMISE</h3>
1933 <pre class="programlisting">#define GNUTLS_CRL_REASON_AA_COMPROMISE 32768
1934 </pre>
1935 <p>
1936 </p>
1937 </div>
1938 <hr>
1939 <div class="refsect2">
1940 <a name="gnutls-x509-crt-get-crl-dist-points"></a><h3>gnutls_x509_crt_get_crl_dist_points ()</h3>
1941 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_crl_dist_points (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
1942                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
1943                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
1944                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
1945                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *reason_flags</code></em>,
1946                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
1947 <p>
1948 This function retrieves the CRL distribution points (2.5.29.31),
1949 contained in the given certificate in the X509v3 Certificate
1950 Extensions.
1951 </p>
1952 <p>
1953 <em class="parameter"><code>reason_flags</code></em> should be an ORed sequence of
1954 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-UNUSED:CAPS" title="GNUTLS_CRL_REASON_UNUSED"><code class="literal">GNUTLS_CRL_REASON_UNUSED</code></a>, <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-KEY-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_KEY_COMPROMISE"><code class="literal">GNUTLS_CRL_REASON_KEY_COMPROMISE</code></a>,
1955 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CA-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_CA_COMPROMISE"><code class="literal">GNUTLS_CRL_REASON_CA_COMPROMISE</code></a>,
1956 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-AFFILIATION-CHANGED:CAPS" title="GNUTLS_CRL_REASON_AFFILIATION_CHANGED"><code class="literal">GNUTLS_CRL_REASON_AFFILIATION_CHANGED</code></a>,
1957 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-SUPERSEEDED:CAPS" title="GNUTLS_CRL_REASON_SUPERSEEDED"><code class="literal">GNUTLS_CRL_REASON_SUPERSEEDED</code></a>,
1958 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CESSATION-OF-OPERATION:CAPS" title="GNUTLS_CRL_REASON_CESSATION_OF_OPERATION"><code class="literal">GNUTLS_CRL_REASON_CESSATION_OF_OPERATION</code></a>,
1959 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-CERTIFICATE-HOLD:CAPS" title="GNUTLS_CRL_REASON_CERTIFICATE_HOLD"><code class="literal">GNUTLS_CRL_REASON_CERTIFICATE_HOLD</code></a>,
1960 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-PRIVILEGE-WITHDRAWN:CAPS" title="GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN"><code class="literal">GNUTLS_CRL_REASON_PRIVILEGE_WITHDRAWN</code></a>,
1961 <a class="link" href="gnutls-x509.html#GNUTLS-CRL-REASON-AA-COMPROMISE:CAPS" title="GNUTLS_CRL_REASON_AA_COMPROMISE"><code class="literal">GNUTLS_CRL_REASON_AA_COMPROMISE</code></a>, or zero for all possible reasons.
1962 </p>
1963 <div class="variablelist"><table border="0">
1964 <col align="left" valign="top">
1965 <tbody>
1966 <tr>
1967 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
1968 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
1969 </tr>
1970 <tr>
1971 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
1972 <td>specifies the sequence number of the distribution point (0 for the first one, 1 for the second etc.)</td>
1973 </tr>
1974 <tr>
1975 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
1976 <td>is the place where the distribution point will be copied to</td>
1977 </tr>
1978 <tr>
1979 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
1980 <td>holds the size of ret.</td>
1981 </tr>
1982 <tr>
1983 <td><p><span class="term"><em class="parameter"><code>reason_flags</code></em> :</span></p></td>
1984 <td>Revocation reasons flags.</td>
1985 </tr>
1986 <tr>
1987 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
1988 <td>will be non zero if the extension is marked as critical (may be null)</td>
1989 </tr>
1990 <tr>
1991 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1992 <td>
1993 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> and updates &amp;<em class="parameter"><code>ret_size</code></em> if
1994 &amp;<em class="parameter"><code>ret_size</code></em> is not enough to hold the distribution point, or the
1995 type of the distribution point if everything was ok. The type is
1996 one of the enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><code class="literal">gnutls_x509_subject_alt_name_t</code></a>.  If the
1997 certificate does not have an Alternative name with the specified
1998 sequence number then <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is
1999 returned.</td>
2000 </tr>
2001 </tbody>
2002 </table></div>
2003 </div>
2004 <hr>
2005 <div class="refsect2">
2006 <a name="gnutls-x509-crt-set-crl-dist-points2"></a><h3>gnutls_x509_crt_set_crl_dist_points2 ()</h3>
2007 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_crl_dist_points2
2008                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
2009                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
2010                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
2011                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
2012                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> reason_flags</code></em>);</pre>
2013 <p>
2014 This function will set the CRL distribution points certificate extension.
2015 </p>
2016 <div class="variablelist"><table border="0">
2017 <col align="left" valign="top">
2018 <tbody>
2019 <tr>
2020 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
2021 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
2022 </td>
2023 </tr>
2024 <tr>
2025 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2026 <td>is one of the gnutls_x509_subject_alt_name_t enumerations</td>
2027 </tr>
2028 <tr>
2029 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
2030 <td>The data to be set</td>
2031 </tr>
2032 <tr>
2033 <td><p><span class="term"><em class="parameter"><code>data_size</code></em> :</span></p></td>
2034 <td>The data size</td>
2035 </tr>
2036 <tr>
2037 <td><p><span class="term"><em class="parameter"><code>reason_flags</code></em> :</span></p></td>
2038 <td>revocation reasons</td>
2039 </tr>
2040 <tr>
2041 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2042 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
2043 negative error value.</td>
2044 </tr>
2045 </tbody>
2046 </table></div>
2047 <p class="since">Since 2.6.0</p>
2048 </div>
2049 <hr>
2050 <div class="refsect2">
2051 <a name="gnutls-x509-crt-set-crl-dist-points"></a><h3>gnutls_x509_crt_set_crl_dist_points ()</h3>
2052 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_crl_dist_points (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
2053                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
2054                                                          <em class="parameter"><code>const <span class="type">void</span> *data_string</code></em>,
2055                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> reason_flags</code></em>);</pre>
2056 <p>
2057 This function will set the CRL distribution points certificate extension.
2058 </p>
2059 <div class="variablelist"><table border="0">
2060 <col align="left" valign="top">
2061 <tbody>
2062 <tr>
2063 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
2064 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
2065 </td>
2066 </tr>
2067 <tr>
2068 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
2069 <td>is one of the gnutls_x509_subject_alt_name_t enumerations</td>
2070 </tr>
2071 <tr>
2072 <td><p><span class="term"><em class="parameter"><code>data_string</code></em> :</span></p></td>
2073 <td>The data to be set</td>
2074 </tr>
2075 <tr>
2076 <td><p><span class="term"><em class="parameter"><code>reason_flags</code></em> :</span></p></td>
2077 <td>revocation reasons</td>
2078 </tr>
2079 <tr>
2080 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2081 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
2082 negative error value.</td>
2083 </tr>
2084 </tbody>
2085 </table></div>
2086 </div>
2087 <hr>
2088 <div class="refsect2">
2089 <a name="gnutls-x509-crt-cpy-crl-dist-points"></a><h3>gnutls_x509_crt_cpy_crl_dist_points ()</h3>
2090 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_cpy_crl_dist_points (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> dst</code></em>,
2091                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> src</code></em>);</pre>
2092 <p>
2093 This function will copy the CRL distribution points certificate
2094 extension, from the source to the destination certificate.
2095 This may be useful to copy from a CA certificate to issued ones.
2096 </p>
2097 <div class="variablelist"><table border="0">
2098 <col align="left" valign="top">
2099 <tbody>
2100 <tr>
2101 <td><p><span class="term"><em class="parameter"><code>dst</code></em> :</span></p></td>
2102 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
2103 </td>
2104 </tr>
2105 <tr>
2106 <td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
2107 <td>the certificate where the dist points will be copied from</td>
2108 </tr>
2109 <tr>
2110 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2111 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
2112 negative error value.</td>
2113 </tr>
2114 </tbody>
2115 </table></div>
2116 </div>
2117 <hr>
2118 <div class="refsect2">
2119 <a name="gnutls-x509-crt-get-activation-time"></a><h3>gnutls_x509_crt_get_activation_time ()</h3>
2120 <pre class="programlisting"><span class="returnvalue">time_t</span>              gnutls_x509_crt_get_activation_time (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);</pre>
2121 <p>
2122 This function will return the time this Certificate was or will be
2123 activated.
2124 </p>
2125 <div class="variablelist"><table border="0">
2126 <col align="left" valign="top">
2127 <tbody>
2128 <tr>
2129 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2130 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2131 </tr>
2132 <tr>
2133 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2134 <td>activation time, or (time_t)-1 on error.</td>
2135 </tr>
2136 </tbody>
2137 </table></div>
2138 </div>
2139 <hr>
2140 <div class="refsect2">
2141 <a name="gnutls-x509-crt-get-expiration-time"></a><h3>gnutls_x509_crt_get_expiration_time ()</h3>
2142 <pre class="programlisting"><span class="returnvalue">time_t</span>              gnutls_x509_crt_get_expiration_time (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>);</pre>
2143 <p>
2144 This function will return the time this Certificate was or will be
2145 expired.
2146 </p>
2147 <div class="variablelist"><table border="0">
2148 <col align="left" valign="top">
2149 <tbody>
2150 <tr>
2151 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2152 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2153 </tr>
2154 <tr>
2155 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2156 <td>expiration time, or (time_t)-1 on error.</td>
2157 </tr>
2158 </tbody>
2159 </table></div>
2160 </div>
2161 <hr>
2162 <div class="refsect2">
2163 <a name="gnutls-x509-crt-get-serial"></a><h3>gnutls_x509_crt_get_serial ()</h3>
2164 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_serial          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2165                                                          <em class="parameter"><code><span class="type">void</span> *result</code></em>,
2166                                                          <em class="parameter"><code><span class="type">size_t</span> *result_size</code></em>);</pre>
2167 <p>
2168 This function will return the X.509 certificate's serial number.
2169 This is obtained by the X509 Certificate serialNumber field. Serial
2170 is not always a 32 or 64bit number. Some CAs use large serial
2171 numbers, thus it may be wise to handle it as something opaque.
2172 </p>
2173 <div class="variablelist"><table border="0">
2174 <col align="left" valign="top">
2175 <tbody>
2176 <tr>
2177 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2178 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2179 </tr>
2180 <tr>
2181 <td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
2182 <td>The place where the serial number will be copied</td>
2183 </tr>
2184 <tr>
2185 <td><p><span class="term"><em class="parameter"><code>result_size</code></em> :</span></p></td>
2186 <td>Holds the size of the result field.</td>
2187 </tr>
2188 <tr>
2189 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2190 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
2191 negative error value.</td>
2192 </tr>
2193 </tbody>
2194 </table></div>
2195 </div>
2196 <hr>
2197 <div class="refsect2">
2198 <a name="gnutls-x509-crt-get-pk-algorithm"></a><h3>gnutls_x509_crt_get_pk_algorithm ()</h3>
2199 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_pk_algorithm    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2200                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *bits</code></em>);</pre>
2201 <p>
2202 This function will return the public key algorithm of an X.509
2203 certificate.
2204 </p>
2205 <p>
2206 If bits is non null, it should have enough size to hold the parameters
2207 size in bits. For RSA the bits returned is the modulus.
2208 For DSA the bits returned are of the public
2209 exponent.
2210 </p>
2211 <div class="variablelist"><table border="0">
2212 <col align="left" valign="top">
2213 <tbody>
2214 <tr>
2215 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2216 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2217 </tr>
2218 <tr>
2219 <td><p><span class="term"><em class="parameter"><code>bits</code></em> :</span></p></td>
2220 <td>if bits is non null it will hold the size of the parameters' in bits</td>
2221 </tr>
2222 <tr>
2223 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2224 <td>a member of the <a class="link" href="gnutls-gnutls.html#gnutls-pk-algorithm-t" title="enum gnutls_pk_algorithm_t"><span class="type">gnutls_pk_algorithm_t</span></a> enumeration on
2225 success, or a negative value on error.</td>
2226 </tr>
2227 </tbody>
2228 </table></div>
2229 </div>
2230 <hr>
2231 <div class="refsect2">
2232 <a name="gnutls-x509-crt-get-pk-rsa-raw"></a><h3>gnutls_x509_crt_get_pk_rsa_raw ()</h3>
2233 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_pk_rsa_raw      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
2234                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
2235                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>);</pre>
2236 <p>
2237 This function will export the RSA public key's parameters found in
2238 the given structure.  The new parameters will be allocated using
2239 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
2240 </p>
2241 <div class="variablelist"><table border="0">
2242 <col align="left" valign="top">
2243 <tbody>
2244 <tr>
2245 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
2246 <td>Holds the certificate</td>
2247 </tr>
2248 <tr>
2249 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
2250 <td>will hold the modulus</td>
2251 </tr>
2252 <tr>
2253 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
2254 <td>will hold the public exponent</td>
2255 </tr>
2256 <tr>
2257 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2258 <td>
2259 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> on success, otherwise an error.</td>
2260 </tr>
2261 </tbody>
2262 </table></div>
2263 </div>
2264 <hr>
2265 <div class="refsect2">
2266 <a name="gnutls-x509-crt-get-pk-dsa-raw"></a><h3>gnutls_x509_crt_get_pk_dsa_raw ()</h3>
2267 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_pk_dsa_raw      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
2268                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
2269                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
2270                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *g</code></em>,
2271                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *y</code></em>);</pre>
2272 <p>
2273 This function will export the DSA public key's parameters found in
2274 the given certificate.  The new parameters will be allocated using
2275 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
2276 </p>
2277 <div class="variablelist"><table border="0">
2278 <col align="left" valign="top">
2279 <tbody>
2280 <tr>
2281 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
2282 <td>Holds the certificate</td>
2283 </tr>
2284 <tr>
2285 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
2286 <td>will hold the p</td>
2287 </tr>
2288 <tr>
2289 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
2290 <td>will hold the q</td>
2291 </tr>
2292 <tr>
2293 <td><p><span class="term"><em class="parameter"><code>g</code></em> :</span></p></td>
2294 <td>will hold the g</td>
2295 </tr>
2296 <tr>
2297 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
2298 <td>will hold the y</td>
2299 </tr>
2300 <tr>
2301 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2302 <td>
2303 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> on success, otherwise an error.</td>
2304 </tr>
2305 </tbody>
2306 </table></div>
2307 </div>
2308 <hr>
2309 <div class="refsect2">
2310 <a name="gnutls-x509-crt-get-subject-alt-name"></a><h3>gnutls_x509_crt_get_subject_alt_name ()</h3>
2311 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject_alt_name
2312                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2313                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2314                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2315                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
2316                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2317 <p>
2318 This function retrieves the Alternative Name (2.5.29.17), contained
2319 in the given certificate in the X509v3 Certificate Extensions.
2320 </p>
2321 <p>
2322 When the SAN type is otherName, it will extract the data in the
2323 otherName's value field, and <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a> is returned.
2324 You may use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-othername-oid" title="gnutls_x509_crt_get_subject_alt_othername_oid ()"><code class="function">gnutls_x509_crt_get_subject_alt_othername_oid()</code></a> to get
2325 the corresponding OID and the "virtual" SAN types (e.g.,
2326 <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME-XMPP:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME_XMPP</code></a>).
2327 </p>
2328 <p>
2329 If an otherName OID is known, the data will be decoded.  Otherwise
2330 the returned data will be DER encoded, and you will have to decode
2331 it yourself.  Currently, only the RFC 3920 id-on-xmppAddr SAN is
2332 recognized.
2333 </p>
2334 <div class="variablelist"><table border="0">
2335 <col align="left" valign="top">
2336 <tbody>
2337 <tr>
2338 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2339 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2340 </tr>
2341 <tr>
2342 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2343 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2344 </tr>
2345 <tr>
2346 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2347 <td>is the place where the alternative name will be copied to</td>
2348 </tr>
2349 <tr>
2350 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2351 <td>holds the size of ret.</td>
2352 </tr>
2353 <tr>
2354 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2355 <td>will be non zero if the extension is marked as critical (may be null)</td>
2356 </tr>
2357 <tr>
2358 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2359 <td>the alternative subject name type on success, one of the
2360 enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a>.  It will return
2361 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if <em class="parameter"><code>ret_size</code></em> is not large enough to
2362 hold the value.  In that case <em class="parameter"><code>ret_size</code></em> will be updated with the
2363 required size.  If the certificate does not have an Alternative
2364 name with the specified sequence number then
2365 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2366 </tr>
2367 </tbody>
2368 </table></div>
2369 </div>
2370 <hr>
2371 <div class="refsect2">
2372 <a name="gnutls-x509-crt-get-subject-alt-name2"></a><h3>gnutls_x509_crt_get_subject_alt_name2 ()</h3>
2373 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject_alt_name2
2374                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2375                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2376                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2377                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
2378                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
2379                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2380 <p>
2381 This function will return the alternative names, contained in the
2382 given certificate. It is the same as
2383 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-name" title="gnutls_x509_crt_get_subject_alt_name ()"><code class="function">gnutls_x509_crt_get_subject_alt_name()</code></a> except for the fact that it
2384 will return the type of the alternative name in <em class="parameter"><code>ret_type</code></em> even if
2385 the function fails for some reason (i.e.  the buffer provided is
2386 not enough).
2387 </p>
2388 <div class="variablelist"><table border="0">
2389 <col align="left" valign="top">
2390 <tbody>
2391 <tr>
2392 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2393 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2394 </tr>
2395 <tr>
2396 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2397 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2398 </tr>
2399 <tr>
2400 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2401 <td>is the place where the alternative name will be copied to</td>
2402 </tr>
2403 <tr>
2404 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2405 <td>holds the size of ret.</td>
2406 </tr>
2407 <tr>
2408 <td><p><span class="term"><em class="parameter"><code>ret_type</code></em> :</span></p></td>
2409 <td>holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).</td>
2410 </tr>
2411 <tr>
2412 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2413 <td>will be non zero if the extension is marked as critical (may be null)</td>
2414 </tr>
2415 <tr>
2416 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2417 <td>the alternative subject name type on success, one of the
2418 enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a>.  It will return
2419 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if <em class="parameter"><code>ret_size</code></em> is not large enough
2420 to hold the value.  In that case <em class="parameter"><code>ret_size</code></em> will be updated with
2421 the required size.  If the certificate does not have an
2422 Alternative name with the specified sequence number then
2423 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2424 </tr>
2425 </tbody>
2426 </table></div>
2427 </div>
2428 <hr>
2429 <div class="refsect2">
2430 <a name="gnutls-x509-crt-get-subject-alt-othername-oid"></a><h3>gnutls_x509_crt_get_subject_alt_othername_oid ()</h3>
2431 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject_alt_othername_oid
2432                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2433                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2434                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2435                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);</pre>
2436 <p>
2437 This function will extract the type OID of an otherName Subject
2438 Alternative Name, contained in the given certificate, and return
2439 the type as an enumerated element.
2440 </p>
2441 <p>
2442 This function is only useful if
2443 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-name" title="gnutls_x509_crt_get_subject_alt_name ()"><code class="function">gnutls_x509_crt_get_subject_alt_name()</code></a> returned
2444 <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a>.
2445 </p>
2446 <div class="variablelist"><table border="0">
2447 <col align="left" valign="top">
2448 <tbody>
2449 <tr>
2450 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2451 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2452 </tr>
2453 <tr>
2454 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2455 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2456 </tr>
2457 <tr>
2458 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2459 <td>is the place where the otherName OID will be copied to</td>
2460 </tr>
2461 <tr>
2462 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2463 <td>holds the size of ret.</td>
2464 </tr>
2465 <tr>
2466 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2467 <td>the alternative subject name type on success, one of the
2468 enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs, it
2469 will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
2470 e.g. <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME-XMPP:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME_XMPP</code></a>, and <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a> for
2471 unknown OIDs.  It will return <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if
2472 <em class="parameter"><code>ret_size</code></em> is not large enough to hold the value.  In that case
2473 <em class="parameter"><code>ret_size</code></em> will be updated with the required size.  If the
2474 certificate does not have an Alternative name with the specified
2475 sequence number and with the otherName type then
2476 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2477 </tr>
2478 </tbody>
2479 </table></div>
2480 </div>
2481 <hr>
2482 <div class="refsect2">
2483 <a name="gnutls-x509-crt-get-issuer-alt-name"></a><h3>gnutls_x509_crt_get_issuer_alt_name ()</h3>
2484 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_alt_name (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2485                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2486                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2487                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
2488                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2489 <p>
2490 This function retrieves the Issuer Alternative Name (2.5.29.18),
2491 contained in the given certificate in the X509v3 Certificate
2492 Extensions.
2493 </p>
2494 <p>
2495 When the SAN type is otherName, it will extract the data in the
2496 otherName's value field, and <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a> is returned.
2497 You may use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-othername-oid" title="gnutls_x509_crt_get_subject_alt_othername_oid ()"><code class="function">gnutls_x509_crt_get_subject_alt_othername_oid()</code></a> to get
2498 the corresponding OID and the "virtual" SAN types (e.g.,
2499 <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME-XMPP:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME_XMPP</code></a>).
2500 </p>
2501 <p>
2502 If an otherName OID is known, the data will be decoded.  Otherwise
2503 the returned data will be DER encoded, and you will have to decode
2504 it yourself.  Currently, only the RFC 3920 id-on-xmppAddr Issuer
2505 AltName is recognized.
2506 </p>
2507 <div class="variablelist"><table border="0">
2508 <col align="left" valign="top">
2509 <tbody>
2510 <tr>
2511 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2512 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2513 </tr>
2514 <tr>
2515 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2516 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2517 </tr>
2518 <tr>
2519 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2520 <td>is the place where the alternative name will be copied to</td>
2521 </tr>
2522 <tr>
2523 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2524 <td>holds the size of ret.</td>
2525 </tr>
2526 <tr>
2527 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2528 <td>will be non zero if the extension is marked as critical (may be null)</td>
2529 </tr>
2530 <tr>
2531 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2532 <td>the alternative issuer name type on success, one of the
2533 enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a>.  It will return
2534 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if <em class="parameter"><code>ret_size</code></em> is not large enough
2535 to hold the value.  In that case <em class="parameter"><code>ret_size</code></em> will be updated with
2536 the required size.  If the certificate does not have an
2537 Alternative name with the specified sequence number then
2538 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2539 </tr>
2540 </tbody>
2541 </table></div>
2542 <p class="since">Since 2.10.0</p>
2543 </div>
2544 <hr>
2545 <div class="refsect2">
2546 <a name="gnutls-x509-crt-get-issuer-alt-name2"></a><h3>gnutls_x509_crt_get_issuer_alt_name2 ()</h3>
2547 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_alt_name2
2548                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2549                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2550                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2551                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
2552                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
2553                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2554 <p>
2555 This function will return the alternative names, contained in the
2556 given certificate. It is the same as
2557 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-alt-name" title="gnutls_x509_crt_get_issuer_alt_name ()"><code class="function">gnutls_x509_crt_get_issuer_alt_name()</code></a> except for the fact that it
2558 will return the type of the alternative name in <em class="parameter"><code>ret_type</code></em> even if
2559 the function fails for some reason (i.e.  the buffer provided is
2560 not enough).
2561 </p>
2562 <div class="variablelist"><table border="0">
2563 <col align="left" valign="top">
2564 <tbody>
2565 <tr>
2566 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2567 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2568 </tr>
2569 <tr>
2570 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2571 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2572 </tr>
2573 <tr>
2574 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2575 <td>is the place where the alternative name will be copied to</td>
2576 </tr>
2577 <tr>
2578 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2579 <td>holds the size of ret.</td>
2580 </tr>
2581 <tr>
2582 <td><p><span class="term"><em class="parameter"><code>ret_type</code></em> :</span></p></td>
2583 <td>holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).</td>
2584 </tr>
2585 <tr>
2586 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2587 <td>will be non zero if the extension is marked as critical (may be null)</td>
2588 </tr>
2589 <tr>
2590 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2591 <td>the alternative issuer name type on success, one of the
2592 enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a>.  It will return
2593 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if <em class="parameter"><code>ret_size</code></em> is not large enough
2594 to hold the value.  In that case <em class="parameter"><code>ret_size</code></em> will be updated with
2595 the required size.  If the certificate does not have an
2596 Alternative name with the specified sequence number then
2597 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2598 </tr>
2599 </tbody>
2600 </table></div>
2601 <p class="since">Since 2.10.0</p>
2602 </div>
2603 <hr>
2604 <div class="refsect2">
2605 <a name="gnutls-x509-crt-get-issuer-alt-othername-oid"></a><h3>gnutls_x509_crt_get_issuer_alt_othername_oid ()</h3>
2606 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer_alt_othername_oid
2607                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2608                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
2609                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
2610                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);</pre>
2611 <p>
2612 This function will extract the type OID of an otherName Subject
2613 Alternative Name, contained in the given certificate, and return
2614 the type as an enumerated element.
2615 </p>
2616 <p>
2617 This function is only useful if
2618 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-issuer-alt-name" title="gnutls_x509_crt_get_issuer_alt_name ()"><code class="function">gnutls_x509_crt_get_issuer_alt_name()</code></a> returned
2619 <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a>.
2620 </p>
2621 <div class="variablelist"><table border="0">
2622 <col align="left" valign="top">
2623 <tbody>
2624 <tr>
2625 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2626 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2627 </tr>
2628 <tr>
2629 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
2630 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
2631 </tr>
2632 <tr>
2633 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
2634 <td>is the place where the otherName OID will be copied to</td>
2635 </tr>
2636 <tr>
2637 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
2638 <td>holds the size of ret.</td>
2639 </tr>
2640 <tr>
2641 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2642 <td>the alternative issuer name type on success, one of the
2643 enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs, it
2644 will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
2645 e.g. <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME-XMPP:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME_XMPP</code></a>, and <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a> for
2646 unknown OIDs.  It will return <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if
2647 <em class="parameter"><code>ret_size</code></em> is not large enough to hold the value.  In that case
2648 <em class="parameter"><code>ret_size</code></em> will be updated with the required size.  If the
2649 certificate does not have an Alternative name with the specified
2650 sequence number and with the otherName type then
2651 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
2652 </tr>
2653 </tbody>
2654 </table></div>
2655 <p class="since">Since 2.10.0</p>
2656 </div>
2657 <hr>
2658 <div class="refsect2">
2659 <a name="gnutls-x509-crt-get-ca-status"></a><h3>gnutls_x509_crt_get_ca_status ()</h3>
2660 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_ca_status       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2661                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2662 <p>
2663 This function will return certificates CA status, by reading the
2664 basicConstraints X.509 extension (2.5.29.19). If the certificate is
2665 a CA a positive value will be returned, or zero if the certificate
2666 does not have CA flag set.
2667 </p>
2668 <p>
2669 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-basic-constraints" title="gnutls_x509_crt_get_basic_constraints ()"><code class="function">gnutls_x509_crt_get_basic_constraints()</code></a> if you want to read the
2670 pathLenConstraint field too.
2671 </p>
2672 <div class="variablelist"><table border="0">
2673 <col align="left" valign="top">
2674 <tbody>
2675 <tr>
2676 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2677 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2678 </tr>
2679 <tr>
2680 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2681 <td>will be non zero if the extension is marked as critical</td>
2682 </tr>
2683 <tr>
2684 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2685 <td>A negative value may be returned in case of parsing error.
2686 If the certificate does not contain the basicConstraints extension
2687 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be returned.</td>
2688 </tr>
2689 </tbody>
2690 </table></div>
2691 </div>
2692 <hr>
2693 <div class="refsect2">
2694 <a name="gnutls-x509-crt-get-basic-constraints"></a><h3>gnutls_x509_crt_get_basic_constraints ()</h3>
2695 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_basic_constraints
2696                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2697                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
2698                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ca</code></em>,
2699                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>);</pre>
2700 <p>
2701 This function will read the certificate's basic constraints, and
2702 return the certificates CA status.  It reads the basicConstraints
2703 X.509 extension (2.5.29.19).
2704 </p>
2705 <div class="variablelist"><table border="0">
2706 <col align="left" valign="top">
2707 <tbody>
2708 <tr>
2709 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2710 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2711 </tr>
2712 <tr>
2713 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2714 <td>will be non zero if the extension is marked as critical</td>
2715 </tr>
2716 <tr>
2717 <td><p><span class="term"><em class="parameter"><code>ca</code></em> :</span></p></td>
2718 <td>pointer to output integer indicating CA status, may be NULL,
2719 value is 1 if the certificate CA flag is set, 0 otherwise.</td>
2720 </tr>
2721 <tr>
2722 <td><p><span class="term"><em class="parameter"><code>pathlen</code></em> :</span></p></td>
2723 <td>pointer to output integer indicating path length (may be
2724 NULL), non-negative values indicate a present pathLenConstraint
2725 field and the actual value, -1 indicate that the field is absent.</td>
2726 </tr>
2727 <tr>
2728 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2729 <td>If the certificate is a CA a positive value will be
2730 returned, or zero if the certificate does not have CA flag set.  A
2731 negative value may be returned in case of errors.  If the
2732 certificate does not contain the basicConstraints extension
2733 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.</td>
2734 </tr>
2735 </tbody>
2736 </table></div>
2737 </div>
2738 <hr>
2739 <div class="refsect2">
2740 <a name="gnutls-x509-crt-get-key-usage"></a><h3>gnutls_x509_crt_get_key_usage ()</h3>
2741 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_key_usage       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2742                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *key_usage</code></em>,
2743                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2744 <p>
2745 This function will return certificate's key usage, by reading the
2746 keyUsage X.509 extension (2.5.29.15). The key usage value will ORed
2747 values of the: <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DIGITAL-SIGNATURE:CAPS" title="GNUTLS_KEY_DIGITAL_SIGNATURE"><code class="literal">GNUTLS_KEY_DIGITAL_SIGNATURE</code></a>,
2748 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-NON-REPUDIATION:CAPS" title="GNUTLS_KEY_NON_REPUDIATION"><code class="literal">GNUTLS_KEY_NON_REPUDIATION</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-ENCIPHERMENT:CAPS" title="GNUTLS_KEY_KEY_ENCIPHERMENT"><code class="literal">GNUTLS_KEY_KEY_ENCIPHERMENT</code></a>,
2749 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DATA-ENCIPHERMENT:CAPS" title="GNUTLS_KEY_DATA_ENCIPHERMENT"><code class="literal">GNUTLS_KEY_DATA_ENCIPHERMENT</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-AGREEMENT:CAPS" title="GNUTLS_KEY_KEY_AGREEMENT"><code class="literal">GNUTLS_KEY_KEY_AGREEMENT</code></a>,
2750 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-CERT-SIGN:CAPS" title="GNUTLS_KEY_KEY_CERT_SIGN"><code class="literal">GNUTLS_KEY_KEY_CERT_SIGN</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-CRL-SIGN:CAPS" title="GNUTLS_KEY_CRL_SIGN"><code class="literal">GNUTLS_KEY_CRL_SIGN</code></a>,
2751 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-ENCIPHER-ONLY:CAPS" title="GNUTLS_KEY_ENCIPHER_ONLY"><code class="literal">GNUTLS_KEY_ENCIPHER_ONLY</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DECIPHER-ONLY:CAPS" title="GNUTLS_KEY_DECIPHER_ONLY"><code class="literal">GNUTLS_KEY_DECIPHER_ONLY</code></a>.
2752 </p>
2753 <div class="variablelist"><table border="0">
2754 <col align="left" valign="top">
2755 <tbody>
2756 <tr>
2757 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2758 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2759 </tr>
2760 <tr>
2761 <td><p><span class="term"><em class="parameter"><code>key_usage</code></em> :</span></p></td>
2762 <td>where the key usage bits will be stored</td>
2763 </tr>
2764 <tr>
2765 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2766 <td>will be non zero if the extension is marked as critical</td>
2767 </tr>
2768 <tr>
2769 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2770 <td>the certificate key usage, or a negative value in case of
2771 parsing error.  If the certificate does not contain the keyUsage
2772 extension <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be
2773 returned.</td>
2774 </tr>
2775 </tbody>
2776 </table></div>
2777 </div>
2778 <hr>
2779 <div class="refsect2">
2780 <a name="gnutls-x509-crt-set-key-usage"></a><h3>gnutls_x509_crt_set_key_usage ()</h3>
2781 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_key_usage       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
2782                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> usage</code></em>);</pre>
2783 <p>
2784 This function will set the keyUsage certificate extension.
2785 </p>
2786 <div class="variablelist"><table border="0">
2787 <col align="left" valign="top">
2788 <tbody>
2789 <tr>
2790 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
2791 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
2792 </td>
2793 </tr>
2794 <tr>
2795 <td><p><span class="term"><em class="parameter"><code>usage</code></em> :</span></p></td>
2796 <td>an ORed sequence of the GNUTLS_KEY_* elements.</td>
2797 </tr>
2798 <tr>
2799 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2800 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
2801 negative error value.</td>
2802 </tr>
2803 </tbody>
2804 </table></div>
2805 </div>
2806 <hr>
2807 <div class="refsect2">
2808 <a name="gnutls-x509-crt-get-proxy"></a><h3>gnutls_x509_crt_get_proxy ()</h3>
2809 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_proxy           (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2810                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
2811                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>,
2812                                                          <em class="parameter"><code><span class="type">char</span> **policyLanguage</code></em>,
2813                                                          <em class="parameter"><code><span class="type">char</span> **policy</code></em>,
2814                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_policy</code></em>);</pre>
2815 <p>
2816 This function will get information from a proxy certificate.  It
2817 reads the ProxyCertInfo X.509 extension (1.3.6.1.5.5.7.1.14).
2818 </p>
2819 <div class="variablelist"><table border="0">
2820 <col align="left" valign="top">
2821 <tbody>
2822 <tr>
2823 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2824 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2825 </tr>
2826 <tr>
2827 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2828 <td>will be non zero if the extension is marked as critical</td>
2829 </tr>
2830 <tr>
2831 <td><p><span class="term"><em class="parameter"><code>pathlen</code></em> :</span></p></td>
2832 <td>pointer to output integer indicating path length (may be
2833 NULL), non-negative values indicate a present pCPathLenConstraint
2834 field and the actual value, -1 indicate that the field is absent.</td>
2835 </tr>
2836 <tr>
2837 <td><p><span class="term"><em class="parameter"><code>policyLanguage</code></em> :</span></p></td>
2838 <td>output variable with OID of policy language</td>
2839 </tr>
2840 <tr>
2841 <td><p><span class="term"><em class="parameter"><code>policy</code></em> :</span></p></td>
2842 <td>output variable with policy data</td>
2843 </tr>
2844 <tr>
2845 <td><p><span class="term"><em class="parameter"><code>sizeof_policy</code></em> :</span></p></td>
2846 <td>output variable size of policy data</td>
2847 </tr>
2848 <tr>
2849 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2850 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
2851 otherwise an error code is returned.</td>
2852 </tr>
2853 </tbody>
2854 </table></div>
2855 </div>
2856 <hr>
2857 <div class="refsect2">
2858 <a name="gnutls-x509-dn-oid-known"></a><h3>gnutls_x509_dn_oid_known ()</h3>
2859 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_dn_oid_known            (<em class="parameter"><code>const <span class="type">char</span> *oid</code></em>);</pre>
2860 <p>
2861 This function will inform about known DN OIDs. This is useful since
2862 functions like <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-dn-by-oid" title="gnutls_x509_crt_set_dn_by_oid ()"><code class="function">gnutls_x509_crt_set_dn_by_oid()</code></a> use the information
2863 on known OIDs to properly encode their input. Object Identifiers
2864 that are not known are not encoded by these functions, and their
2865 input is stored directly into the ASN.1 structure. In that case of
2866 unknown OIDs, you have the responsibility of DER encoding your
2867 data.
2868 </p>
2869 <div class="variablelist"><table border="0">
2870 <col align="left" valign="top">
2871 <tbody>
2872 <tr>
2873 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
2874 <td>holds an Object Identifier in a null terminated string</td>
2875 </tr>
2876 <tr>
2877 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2878 <td>1 on known OIDs and 0 otherwise.</td>
2879 </tr>
2880 </tbody>
2881 </table></div>
2882 </div>
2883 <hr>
2884 <div class="refsect2">
2885 <a name="gnutls-x509-crt-get-extension-oid"></a><h3>gnutls_x509_crt_get_extension_oid ()</h3>
2886 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_extension_oid   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2887                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
2888                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
2889                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
2890 <p>
2891 This function will return the requested extension OID in the certificate.
2892 The extension OID will be stored as a string in the provided buffer.
2893 </p>
2894 <div class="variablelist"><table border="0">
2895 <col align="left" valign="top">
2896 <tbody>
2897 <tr>
2898 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2899 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2900 </tr>
2901 <tr>
2902 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
2903 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
2904 </tr>
2905 <tr>
2906 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
2907 <td>a pointer to a structure to hold the OID (may be null)</td>
2908 </tr>
2909 <tr>
2910 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
2911 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
2912 </td>
2913 </tr>
2914 <tr>
2915 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2916 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
2917 otherwise an error code is returned.  If you have reached the
2918 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
2919 will be returned.</td>
2920 </tr>
2921 </tbody>
2922 </table></div>
2923 </div>
2924 <hr>
2925 <div class="refsect2">
2926 <a name="gnutls-x509-crt-get-extension-by-oid"></a><h3>gnutls_x509_crt_get_extension_by_oid ()</h3>
2927 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_extension_by_oid
2928                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2929                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
2930                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
2931                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
2932                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>,
2933                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2934 <p>
2935 This function will return the extension specified by the OID in the
2936 certificate.  The extensions will be returned as binary data DER
2937 encoded, in the provided buffer.
2938 </p>
2939 <div class="variablelist"><table border="0">
2940 <col align="left" valign="top">
2941 <tbody>
2942 <tr>
2943 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
2944 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
2945 </tr>
2946 <tr>
2947 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
2948 <td>holds an Object Identified in null terminated string</td>
2949 </tr>
2950 <tr>
2951 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
2952 <td>In case multiple same OIDs exist in the extensions, this specifies which to send. Use zero to get the first one.</td>
2953 </tr>
2954 <tr>
2955 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
2956 <td>a pointer to a structure to hold the name (may be null)</td>
2957 </tr>
2958 <tr>
2959 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
2960 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
2961 </td>
2962 </tr>
2963 <tr>
2964 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
2965 <td>will be non zero if the extension is marked as critical</td>
2966 </tr>
2967 <tr>
2968 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
2969 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
2970 otherwise an error code is returned. If the certificate does not
2971 contain the specified extension
2972 GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.</td>
2973 </tr>
2974 </tbody>
2975 </table></div>
2976 </div>
2977 <hr>
2978 <div class="refsect2">
2979 <a name="gnutls-x509-crt-get-extension-info"></a><h3>gnutls_x509_crt_get_extension_info ()</h3>
2980 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_extension_info  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
2981                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
2982                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
2983                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
2984                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
2985 <p>
2986 This function will return the requested extension OID in the
2987 certificate, and the critical flag for it.  The extension OID will
2988 be stored as a string in the provided buffer.  Use
2989 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-data" title="gnutls_x509_crt_get_extension_data ()"><code class="function">gnutls_x509_crt_get_extension_data()</code></a> to extract the data.
2990 </p>
2991 <p>
2992 If the buffer provided is not long enough to hold the output, then
2993 *<em class="parameter"><code>sizeof_oid</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be
2994 returned.
2995 </p>
2996 <div class="variablelist"><table border="0">
2997 <col align="left" valign="top">
2998 <tbody>
2999 <tr>
3000 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3001 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
3002 </tr>
3003 <tr>
3004 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
3005 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
3006 </tr>
3007 <tr>
3008 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
3009 <td>a pointer to a structure to hold the OID</td>
3010 </tr>
3011 <tr>
3012 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
3013 <td>initially holds the maximum size of <em class="parameter"><code>oid</code></em>, on return
3014 holds actual size of <em class="parameter"><code>oid</code></em>.</td>
3015 </tr>
3016 <tr>
3017 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
3018 <td>output variable with critical flag, may be NULL.</td>
3019 </tr>
3020 <tr>
3021 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3022 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
3023 otherwise an error code is returned.  If you have reached the
3024 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
3025 will be returned.</td>
3026 </tr>
3027 </tbody>
3028 </table></div>
3029 </div>
3030 <hr>
3031 <div class="refsect2">
3032 <a name="gnutls-x509-crt-get-extension-data"></a><h3>gnutls_x509_crt_get_extension_data ()</h3>
3033 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_extension_data  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3034                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
3035                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
3036                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);</pre>
3037 <p>
3038 This function will return the requested extension data in the
3039 certificate.  The extension data will be stored as a string in the
3040 provided buffer.
3041 </p>
3042 <p>
3043 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-info" title="gnutls_x509_crt_get_extension_info ()"><code class="function">gnutls_x509_crt_get_extension_info()</code></a> to extract the OID and
3044 critical flag.  Use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-extension-by-oid" title="gnutls_x509_crt_get_extension_by_oid ()"><code class="function">gnutls_x509_crt_get_extension_by_oid()</code></a> instead,
3045 if you want to get data indexed by the extension OID rather than
3046 sequence.
3047 </p>
3048 <div class="variablelist"><table border="0">
3049 <col align="left" valign="top">
3050 <tbody>
3051 <tr>
3052 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3053 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
3054 </tr>
3055 <tr>
3056 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
3057 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
3058 </tr>
3059 <tr>
3060 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
3061 <td>a pointer to a structure to hold the data (may be null)</td>
3062 </tr>
3063 <tr>
3064 <td><p><span class="term"><em class="parameter"><code>sizeof_data</code></em> :</span></p></td>
3065 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
3066 </td>
3067 </tr>
3068 <tr>
3069 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3070 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
3071 otherwise an error code is returned.  If you have reached the
3072 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
3073 will be returned.</td>
3074 </tr>
3075 </tbody>
3076 </table></div>
3077 </div>
3078 <hr>
3079 <div class="refsect2">
3080 <a name="gnutls-x509-crt-set-extension-by-oid"></a><h3>gnutls_x509_crt_set_extension_by_oid ()</h3>
3081 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_extension_by_oid
3082                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3083                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
3084                                                          <em class="parameter"><code>const <span class="type">void</span> *buf</code></em>,
3085                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_buf</code></em>,
3086                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);</pre>
3087 <p>
3088 This function will set an the extension, by the specified OID, in
3089 the certificate.  The extension data should be binary data DER
3090 encoded.
3091 </p>
3092 <div class="variablelist"><table border="0">
3093 <col align="left" valign="top">
3094 <tbody>
3095 <tr>
3096 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3097 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3098 </td>
3099 </tr>
3100 <tr>
3101 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
3102 <td>holds an Object Identified in null terminated string</td>
3103 </tr>
3104 <tr>
3105 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
3106 <td>a pointer to a DER encoded data</td>
3107 </tr>
3108 <tr>
3109 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
3110 <td>holds the size of <em class="parameter"><code>buf</code></em>
3111 </td>
3112 </tr>
3113 <tr>
3114 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
3115 <td>should be non zero if the extension is to be marked as critical</td>
3116 </tr>
3117 <tr>
3118 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3119 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3120 negative error value.</td>
3121 </tr>
3122 </tbody>
3123 </table></div>
3124 </div>
3125 <hr>
3126 <div class="refsect2">
3127 <a name="gnutls-x509-crt-set-dn-by-oid"></a><h3>gnutls_x509_crt_set_dn_by_oid ()</h3>
3128 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_dn_by_oid       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3129                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
3130                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
3131                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
3132                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);</pre>
3133 <p>
3134 This function will set the part of the name of the Certificate
3135 subject, specified by the given OID. The input string should be
3136 ASCII or UTF-8 encoded.
3137 </p>
3138 <p>
3139 Some helper macros with popular OIDs can be found in gnutls/x509.h
3140 With this function you can only set the known OIDs. You can test
3141 for known OIDs using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>. For OIDs that are
3142 not known (by gnutls) you should properly DER encode your data,
3143 and call this function with <em class="parameter"><code>raw_flag</code></em> set.
3144 </p>
3145 <div class="variablelist"><table border="0">
3146 <col align="left" valign="top">
3147 <tbody>
3148 <tr>
3149 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3150 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3151 </td>
3152 </tr>
3153 <tr>
3154 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
3155 <td>holds an Object Identifier in a null terminated string</td>
3156 </tr>
3157 <tr>
3158 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
3159 <td>must be 0, or 1 if the data are DER encoded</td>
3160 </tr>
3161 <tr>
3162 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
3163 <td>a pointer to the name</td>
3164 </tr>
3165 <tr>
3166 <td><p><span class="term"><em class="parameter"><code>sizeof_name</code></em> :</span></p></td>
3167 <td>holds the size of <em class="parameter"><code>name</code></em>
3168 </td>
3169 </tr>
3170 <tr>
3171 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3172 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3173 negative error value.</td>
3174 </tr>
3175 </tbody>
3176 </table></div>
3177 </div>
3178 <hr>
3179 <div class="refsect2">
3180 <a name="gnutls-x509-crt-set-issuer-dn-by-oid"></a><h3>gnutls_x509_crt_set_issuer_dn_by_oid ()</h3>
3181 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_issuer_dn_by_oid
3182                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3183                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
3184                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
3185                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
3186                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);</pre>
3187 <p>
3188 This function will set the part of the name of the Certificate
3189 issuer, specified by the given OID.  The input string should be
3190 ASCII or UTF-8 encoded.
3191 </p>
3192 <p>
3193 Some helper macros with popular OIDs can be found in gnutls/x509.h
3194 With this function you can only set the known OIDs. You can test
3195 for known OIDs using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>. For OIDs that are
3196 not known (by gnutls) you should properly DER encode your data,
3197 and call this function with <em class="parameter"><code>raw_flag</code></em> set.
3198 </p>
3199 <p>
3200 Normally you do not need to call this function, since the signing
3201 operation will copy the signer's name as the issuer of the
3202 certificate.
3203 </p>
3204 <div class="variablelist"><table border="0">
3205 <col align="left" valign="top">
3206 <tbody>
3207 <tr>
3208 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3209 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3210 </td>
3211 </tr>
3212 <tr>
3213 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
3214 <td>holds an Object Identifier in a null terminated string</td>
3215 </tr>
3216 <tr>
3217 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
3218 <td>must be 0, or 1 if the data are DER encoded</td>
3219 </tr>
3220 <tr>
3221 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
3222 <td>a pointer to the name</td>
3223 </tr>
3224 <tr>
3225 <td><p><span class="term"><em class="parameter"><code>sizeof_name</code></em> :</span></p></td>
3226 <td>holds the size of <em class="parameter"><code>name</code></em>
3227 </td>
3228 </tr>
3229 <tr>
3230 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3231 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3232 negative error value.</td>
3233 </tr>
3234 </tbody>
3235 </table></div>
3236 </div>
3237 <hr>
3238 <div class="refsect2">
3239 <a name="gnutls-x509-crt-set-version"></a><h3>gnutls_x509_crt_set_version ()</h3>
3240 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3241                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);</pre>
3242 <p>
3243 This function will set the version of the certificate.  This must
3244 be one for X.509 version 1, and so on.  Plain certificates without
3245 extensions must have version set to one.
3246 </p>
3247 <p>
3248 To create well-formed certificates, you must specify version 3 if
3249 you use any certificate extensions.  Extensions are created by
3250 functions such as <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-subject-alt-name" title="gnutls_x509_crt_set_subject_alt_name ()"><code class="function">gnutls_x509_crt_set_subject_alt_name()</code></a>
3251 or <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-key-usage" title="gnutls_x509_crt_set_key_usage ()"><code class="function">gnutls_x509_crt_set_key_usage()</code></a>.
3252 </p>
3253 <div class="variablelist"><table border="0">
3254 <col align="left" valign="top">
3255 <tbody>
3256 <tr>
3257 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3258 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3259 </td>
3260 </tr>
3261 <tr>
3262 <td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
3263 <td>holds the version number. For X.509v1 certificates must be 1.</td>
3264 </tr>
3265 <tr>
3266 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3267 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3268 negative error value.</td>
3269 </tr>
3270 </tbody>
3271 </table></div>
3272 </div>
3273 <hr>
3274 <div class="refsect2">
3275 <a name="gnutls-x509-crt-set-key"></a><h3>gnutls_x509_crt_set_key ()</h3>
3276 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_key             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3277                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
3278 <p>
3279 This function will set the public parameters from the given
3280 private key to the certificate. Only RSA keys are currently
3281 supported.
3282 </p>
3283 <div class="variablelist"><table border="0">
3284 <col align="left" valign="top">
3285 <tbody>
3286 <tr>
3287 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3288 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3289 </td>
3290 </tr>
3291 <tr>
3292 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
3293 <td>holds a private key</td>
3294 </tr>
3295 <tr>
3296 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3297 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3298 negative error value.</td>
3299 </tr>
3300 </tbody>
3301 </table></div>
3302 </div>
3303 <hr>
3304 <div class="refsect2">
3305 <a name="gnutls-x509-crt-set-ca-status"></a><h3>gnutls_x509_crt_set_ca_status ()</h3>
3306 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_ca_status       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3307                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>);</pre>
3308 <p>
3309 This function will set the basicConstraints certificate extension.
3310 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-basic-constraints" title="gnutls_x509_crt_set_basic_constraints ()"><code class="function">gnutls_x509_crt_set_basic_constraints()</code></a> if you want to control
3311 the pathLenConstraint field too.
3312 </p>
3313 <div class="variablelist"><table border="0">
3314 <col align="left" valign="top">
3315 <tbody>
3316 <tr>
3317 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3318 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3319 </td>
3320 </tr>
3321 <tr>
3322 <td><p><span class="term"><em class="parameter"><code>ca</code></em> :</span></p></td>
3323 <td>true(1) or false(0). Depending on the Certificate authority status.</td>
3324 </tr>
3325 <tr>
3326 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3327 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3328 negative error value.</td>
3329 </tr>
3330 </tbody>
3331 </table></div>
3332 </div>
3333 <hr>
3334 <div class="refsect2">
3335 <a name="gnutls-x509-crt-set-basic-constraints"></a><h3>gnutls_x509_crt_set_basic_constraints ()</h3>
3336 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_basic_constraints
3337                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3338                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>,
3339                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>);</pre>
3340 <p>
3341 This function will set the basicConstraints certificate extension.
3342 </p>
3343 <div class="variablelist"><table border="0">
3344 <col align="left" valign="top">
3345 <tbody>
3346 <tr>
3347 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3348 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3349 </td>
3350 </tr>
3351 <tr>
3352 <td><p><span class="term"><em class="parameter"><code>ca</code></em> :</span></p></td>
3353 <td>true(1) or false(0). Depending on the Certificate authority status.</td>
3354 </tr>
3355 <tr>
3356 <td><p><span class="term"><em class="parameter"><code>pathLenConstraint</code></em> :</span></p></td>
3357 <td>non-negative values indicate maximum length of path,
3358 and negative values indicate that the pathLenConstraints field should
3359 not be present.</td>
3360 </tr>
3361 <tr>
3362 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3363 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3364 negative error value.</td>
3365 </tr>
3366 </tbody>
3367 </table></div>
3368 </div>
3369 <hr>
3370 <div class="refsect2">
3371 <a name="gnutls-x509-crt-set-subject-alternative-name"></a><h3>gnutls_x509_crt_set_subject_alternative_name ()</h3>
3372 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_subject_alternative_name
3373                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3374                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
3375                                                          <em class="parameter"><code>const <span class="type">char</span> *data_string</code></em>);</pre>
3376 <p>
3377 This function will set the subject alternative name certificate
3378 extension. This function assumes that data can be expressed as a null
3379 terminated string.
3380 </p>
3381 <p>
3382 The name of the function is unfortunate since it is incosistent with
3383 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-get-subject-alt-name" title="gnutls_x509_crt_get_subject_alt_name ()"><code class="function">gnutls_x509_crt_get_subject_alt_name()</code></a>.
3384 </p>
3385 <div class="variablelist"><table border="0">
3386 <col align="left" valign="top">
3387 <tbody>
3388 <tr>
3389 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3390 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3391 </td>
3392 </tr>
3393 <tr>
3394 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3395 <td>is one of the gnutls_x509_subject_alt_name_t enumerations</td>
3396 </tr>
3397 <tr>
3398 <td><p><span class="term"><em class="parameter"><code>data_string</code></em> :</span></p></td>
3399 <td>The data to be set, a zero terminated string</td>
3400 </tr>
3401 <tr>
3402 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3403 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3404 negative error value.</td>
3405 </tr>
3406 </tbody>
3407 </table></div>
3408 </div>
3409 <hr>
3410 <div class="refsect2">
3411 <a name="gnutls-x509-crt-set-subject-alt-name"></a><h3>gnutls_x509_crt_set_subject_alt_name ()</h3>
3412 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_subject_alt_name
3413                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3414                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> type</code></em>,
3415                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
3416                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
3417                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
3418 <p>
3419 This function will set the subject alternative name certificate
3420 extension. It can set the following types:
3421 </p>
3422 <p>
3423 &amp;GNUTLS_SAN_DNSNAME: as a text string
3424 </p>
3425 <p>
3426 &amp;GNUTLS_SAN_RFC822NAME: as a text string
3427 </p>
3428 <p>
3429 &amp;GNUTLS_SAN_URI: as a text string
3430 </p>
3431 <p>
3432 &amp;GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
3433 </p>
3434 <p>
3435 Other values can be set as binary values with the proper DER encoding.
3436 </p>
3437 <div class="variablelist"><table border="0">
3438 <col align="left" valign="top">
3439 <tbody>
3440 <tr>
3441 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3442 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3443 </td>
3444 </tr>
3445 <tr>
3446 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
3447 <td>is one of the gnutls_x509_subject_alt_name_t enumerations</td>
3448 </tr>
3449 <tr>
3450 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
3451 <td>The data to be set</td>
3452 </tr>
3453 <tr>
3454 <td><p><span class="term"><em class="parameter"><code>data_size</code></em> :</span></p></td>
3455 <td>The size of data to be set</td>
3456 </tr>
3457 <tr>
3458 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
3459 <td>GNUTLS_FSAN_SET to clear previous data or GNUTLS_FSAN_APPEND to append.</td>
3460 </tr>
3461 <tr>
3462 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3463 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3464 negative error value.</td>
3465 </tr>
3466 </tbody>
3467 </table></div>
3468 <p class="since">Since 2.6.0</p>
3469 </div>
3470 <hr>
3471 <div class="refsect2">
3472 <a name="gnutls-x509-crt-sign"></a><h3>gnutls_x509_crt_sign ()</h3>
3473 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_sign                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3474                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>,
3475                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> issuer_key</code></em>);</pre>
3476 <p>
3477 This function is the same a <a class="link" href="gnutls-x509.html#gnutls-x509-crt-sign2" title="gnutls_x509_crt_sign2 ()"><code class="function">gnutls_x509_crt_sign2()</code></a> with no flags,
3478 and SHA1 as the hash algorithm.
3479 </p>
3480 <div class="variablelist"><table border="0">
3481 <col align="left" valign="top">
3482 <tbody>
3483 <tr>
3484 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3485 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3486 </td>
3487 </tr>
3488 <tr>
3489 <td><p><span class="term"><em class="parameter"><code>issuer</code></em> :</span></p></td>
3490 <td>is the certificate of the certificate issuer</td>
3491 </tr>
3492 <tr>
3493 <td><p><span class="term"><em class="parameter"><code>issuer_key</code></em> :</span></p></td>
3494 <td>holds the issuer's private key</td>
3495 </tr>
3496 <tr>
3497 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3498 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3499 negative error value.</td>
3500 </tr>
3501 </tbody>
3502 </table></div>
3503 </div>
3504 <hr>
3505 <div class="refsect2">
3506 <a name="gnutls-x509-crt-sign2"></a><h3>gnutls_x509_crt_sign2 ()</h3>
3507 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_sign2               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3508                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>,
3509                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> issuer_key</code></em>,
3510                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-digest-algorithm-t" title="enum gnutls_digest_algorithm_t"><span class="type">gnutls_digest_algorithm_t</span></a> dig</code></em>,
3511                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
3512 <p>
3513 This function will sign the certificate with the issuer's private key, and
3514 will copy the issuer's information into the certificate.
3515 </p>
3516 <p>
3517 This must be the last step in a certificate generation since all
3518 the previously set parameters are now signed.
3519 </p>
3520 <div class="variablelist"><table border="0">
3521 <col align="left" valign="top">
3522 <tbody>
3523 <tr>
3524 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3525 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3526 </td>
3527 </tr>
3528 <tr>
3529 <td><p><span class="term"><em class="parameter"><code>issuer</code></em> :</span></p></td>
3530 <td>is the certificate of the certificate issuer</td>
3531 </tr>
3532 <tr>
3533 <td><p><span class="term"><em class="parameter"><code>issuer_key</code></em> :</span></p></td>
3534 <td>holds the issuer's private key</td>
3535 </tr>
3536 <tr>
3537 <td><p><span class="term"><em class="parameter"><code>dig</code></em> :</span></p></td>
3538 <td>The message digest to use, <a class="link" href="gnutls-gnutls.html#GNUTLS-DIG-SHA1:CAPS"><code class="literal">GNUTLS_DIG_SHA1</code></a> is a safe choice</td>
3539 </tr>
3540 <tr>
3541 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
3542 <td>must be 0</td>
3543 </tr>
3544 <tr>
3545 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3546 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3547 negative error value.</td>
3548 </tr>
3549 </tbody>
3550 </table></div>
3551 </div>
3552 <hr>
3553 <div class="refsect2">
3554 <a name="gnutls-x509-crt-set-activation-time"></a><h3>gnutls_x509_crt_set_activation_time ()</h3>
3555 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_activation_time (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3556                                                          <em class="parameter"><code><span class="type">time_t</span> act_time</code></em>);</pre>
3557 <p>
3558 This function will set the time this Certificate was or will be
3559 activated.
3560 </p>
3561 <div class="variablelist"><table border="0">
3562 <col align="left" valign="top">
3563 <tbody>
3564 <tr>
3565 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3566 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3567 </td>
3568 </tr>
3569 <tr>
3570 <td><p><span class="term"><em class="parameter"><code>act_time</code></em> :</span></p></td>
3571 <td>The actual time</td>
3572 </tr>
3573 <tr>
3574 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3575 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3576 negative error value.</td>
3577 </tr>
3578 </tbody>
3579 </table></div>
3580 </div>
3581 <hr>
3582 <div class="refsect2">
3583 <a name="gnutls-x509-crt-set-expiration-time"></a><h3>gnutls_x509_crt_set_expiration_time ()</h3>
3584 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_expiration_time (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3585                                                          <em class="parameter"><code><span class="type">time_t</span> exp_time</code></em>);</pre>
3586 <p>
3587 This function will set the time this Certificate will expire.
3588 </p>
3589 <div class="variablelist"><table border="0">
3590 <col align="left" valign="top">
3591 <tbody>
3592 <tr>
3593 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3594 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3595 </td>
3596 </tr>
3597 <tr>
3598 <td><p><span class="term"><em class="parameter"><code>exp_time</code></em> :</span></p></td>
3599 <td>The actual time</td>
3600 </tr>
3601 <tr>
3602 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3603 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3604 negative error value.</td>
3605 </tr>
3606 </tbody>
3607 </table></div>
3608 </div>
3609 <hr>
3610 <div class="refsect2">
3611 <a name="gnutls-x509-crt-set-serial"></a><h3>gnutls_x509_crt_set_serial ()</h3>
3612 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_serial          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3613                                                          <em class="parameter"><code>const <span class="type">void</span> *serial</code></em>,
3614                                                          <em class="parameter"><code><span class="type">size_t</span> serial_size</code></em>);</pre>
3615 <p>
3616 This function will set the X.509 certificate's serial number.
3617 Serial is not always a 32 or 64bit number.  Some CAs use large
3618 serial numbers, thus it may be wise to handle it as something
3619 opaque.
3620 </p>
3621 <div class="variablelist"><table border="0">
3622 <col align="left" valign="top">
3623 <tbody>
3624 <tr>
3625 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3626 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3627 </td>
3628 </tr>
3629 <tr>
3630 <td><p><span class="term"><em class="parameter"><code>serial</code></em> :</span></p></td>
3631 <td>The serial number</td>
3632 </tr>
3633 <tr>
3634 <td><p><span class="term"><em class="parameter"><code>serial_size</code></em> :</span></p></td>
3635 <td>Holds the size of the serial field.</td>
3636 </tr>
3637 <tr>
3638 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3639 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3640 negative error value.</td>
3641 </tr>
3642 </tbody>
3643 </table></div>
3644 </div>
3645 <hr>
3646 <div class="refsect2">
3647 <a name="gnutls-x509-crt-set-subject-key-id"></a><h3>gnutls_x509_crt_set_subject_key_id ()</h3>
3648 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_subject_key_id  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3649                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
3650                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);</pre>
3651 <p>
3652 This function will set the X.509 certificate's subject key ID
3653 extension.
3654 </p>
3655 <div class="variablelist"><table border="0">
3656 <col align="left" valign="top">
3657 <tbody>
3658 <tr>
3659 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3660 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3661 </td>
3662 </tr>
3663 <tr>
3664 <td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
3665 <td>The key ID</td>
3666 </tr>
3667 <tr>
3668 <td><p><span class="term"><em class="parameter"><code>id_size</code></em> :</span></p></td>
3669 <td>Holds the size of the serial field.</td>
3670 </tr>
3671 <tr>
3672 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3673 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3674 negative error value.</td>
3675 </tr>
3676 </tbody>
3677 </table></div>
3678 </div>
3679 <hr>
3680 <div class="refsect2">
3681 <a name="gnutls-x509-crt-set-proxy-dn"></a><h3>gnutls_x509_crt_set_proxy_dn ()</h3>
3682 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_proxy_dn        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3683                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> eecrt</code></em>,
3684                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
3685                                                          <em class="parameter"><code>const <span class="type">void</span> *name</code></em>,
3686                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_name</code></em>);</pre>
3687 <p>
3688 This function will set the subject in <em class="parameter"><code>crt</code></em> to the end entity's
3689 <em class="parameter"><code>eecrt</code></em> subject name, and add a single Common Name component <em class="parameter"><code>name</code></em>
3690 of size <em class="parameter"><code>sizeof_name</code></em>.  This corresponds to the required proxy
3691 certificate naming style.  Note that if <em class="parameter"><code>name</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, you MUST
3692 set it later by using <a class="link" href="gnutls-x509.html#gnutls-x509-crt-set-dn-by-oid" title="gnutls_x509_crt_set_dn_by_oid ()"><code class="function">gnutls_x509_crt_set_dn_by_oid()</code></a> or similar.
3693 </p>
3694 <div class="variablelist"><table border="0">
3695 <col align="left" valign="top">
3696 <tbody>
3697 <tr>
3698 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3699 <td>a gnutls_x509_crt_t structure with the new proxy cert</td>
3700 </tr>
3701 <tr>
3702 <td><p><span class="term"><em class="parameter"><code>eecrt</code></em> :</span></p></td>
3703 <td>the end entity certificate that will be issuing the proxy</td>
3704 </tr>
3705 <tr>
3706 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
3707 <td>must be 0, or 1 if the CN is DER encoded</td>
3708 </tr>
3709 <tr>
3710 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
3711 <td>a pointer to the CN name, may be NULL (but MUST then be added later)</td>
3712 </tr>
3713 <tr>
3714 <td><p><span class="term"><em class="parameter"><code>sizeof_name</code></em> :</span></p></td>
3715 <td>holds the size of <em class="parameter"><code>name</code></em>
3716 </td>
3717 </tr>
3718 <tr>
3719 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3720 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3721 negative error value.</td>
3722 </tr>
3723 </tbody>
3724 </table></div>
3725 </div>
3726 <hr>
3727 <div class="refsect2">
3728 <a name="gnutls-x509-crt-set-proxy"></a><h3>gnutls_x509_crt_set_proxy ()</h3>
3729 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_proxy           (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
3730                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>,
3731                                                          <em class="parameter"><code>const <span class="type">char</span> *policyLanguage</code></em>,
3732                                                          <em class="parameter"><code>const <span class="type">char</span> *policy</code></em>,
3733                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_policy</code></em>);</pre>
3734 <p>
3735 This function will set the proxyCertInfo extension.
3736 </p>
3737 <div class="variablelist"><table border="0">
3738 <col align="left" valign="top">
3739 <tbody>
3740 <tr>
3741 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
3742 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
3743 </td>
3744 </tr>
3745 <tr>
3746 <td><p><span class="term"><em class="parameter"><code>pathLenConstraint</code></em> :</span></p></td>
3747 <td>non-negative values indicate maximum length of path,
3748 and negative values indicate that the pathLenConstraints field should
3749 not be present.</td>
3750 </tr>
3751 <tr>
3752 <td><p><span class="term"><em class="parameter"><code>policyLanguage</code></em> :</span></p></td>
3753 <td>OID describing the language of <em class="parameter"><code>policy</code></em>.</td>
3754 </tr>
3755 <tr>
3756 <td><p><span class="term"><em class="parameter"><code>policy</code></em> :</span></p></td>
3757 <td>opaque byte array with policy language, can be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>
3758 </td>
3759 </tr>
3760 <tr>
3761 <td><p><span class="term"><em class="parameter"><code>sizeof_policy</code></em> :</span></p></td>
3762 <td>size of <em class="parameter"><code>policy</code></em>.</td>
3763 </tr>
3764 <tr>
3765 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3766 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3767 negative error value.</td>
3768 </tr>
3769 </tbody>
3770 </table></div>
3771 </div>
3772 <hr>
3773 <div class="refsect2">
3774 <a name="gnutls-x509-crt-print"></a><h3>gnutls_x509_crt_print ()</h3>
3775 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_print               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3776                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
3777                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);</pre>
3778 <p>
3779 This function will pretty print a X.509 certificate, suitable for
3780 display to a human.
3781 </p>
3782 <p>
3783 If the format is <a class="link" href="gnutls-gnutls.html#GNUTLS-CRT-PRINT-FULL:CAPS"><code class="literal">GNUTLS_CRT_PRINT_FULL</code></a> then all fields of the
3784 certificate will be output, on multiple lines.  The
3785 <a class="link" href="gnutls-gnutls.html#GNUTLS-CRT-PRINT-ONELINE:CAPS"><code class="literal">GNUTLS_CRT_PRINT_ONELINE</code></a> format will generate one line with some
3786 selected fields, which is useful for logging purposes.
3787 </p>
3788 <p>
3789 The output <em class="parameter"><code>out</code></em> needs to be deallocate using <a class="link" href="gnutls-gnutls.html#gnutls-free" title="gnutls_free"><code class="function">gnutls_free()</code></a>.
3790 </p>
3791 <div class="variablelist"><table border="0">
3792 <col align="left" valign="top">
3793 <tbody>
3794 <tr>
3795 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3796 <td>The structure to be printed</td>
3797 </tr>
3798 <tr>
3799 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
3800 <td>Indicate the format to use</td>
3801 </tr>
3802 <tr>
3803 <td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
3804 <td>Newly allocated datum with zero terminated string.</td>
3805 </tr>
3806 <tr>
3807 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3808 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3809 negative error value.</td>
3810 </tr>
3811 </tbody>
3812 </table></div>
3813 </div>
3814 <hr>
3815 <div class="refsect2">
3816 <a name="gnutls-x509-crl-print"></a><h3>gnutls_x509_crl_print ()</h3>
3817 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_print               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
3818                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
3819                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);</pre>
3820 <p>
3821 This function will pretty print a X.509 certificate revocation
3822 list, suitable for display to a human.
3823 </p>
3824 <p>
3825 The output <em class="parameter"><code>out</code></em> needs to be deallocate using <a class="link" href="gnutls-gnutls.html#gnutls-free" title="gnutls_free"><code class="function">gnutls_free()</code></a>.
3826 </p>
3827 <div class="variablelist"><table border="0">
3828 <col align="left" valign="top">
3829 <tbody>
3830 <tr>
3831 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
3832 <td>The structure to be printed</td>
3833 </tr>
3834 <tr>
3835 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
3836 <td>Indicate the format to use</td>
3837 </tr>
3838 <tr>
3839 <td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
3840 <td>Newly allocated datum with zero terminated string.</td>
3841 </tr>
3842 <tr>
3843 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3844 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3845 negative error value.</td>
3846 </tr>
3847 </tbody>
3848 </table></div>
3849 </div>
3850 <hr>
3851 <div class="refsect2">
3852 <a name="gnutls-x509-crt-get-raw-issuer-dn"></a><h3>gnutls_x509_crt_get_raw_issuer_dn ()</h3>
3853 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_raw_issuer_dn   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3854                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *start</code></em>);</pre>
3855 <p>
3856 This function will return a pointer to the DER encoded DN structure
3857 and the length.
3858 </p>
3859 <div class="variablelist"><table border="0">
3860 <col align="left" valign="top">
3861 <tbody>
3862 <tr>
3863 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3864 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
3865 </tr>
3866 <tr>
3867 <td><p><span class="term"><em class="parameter"><code>start</code></em> :</span></p></td>
3868 <td>will hold the starting point of the DN</td>
3869 </tr>
3870 <tr>
3871 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3872 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3873 negative error value.or a negative value on error.</td>
3874 </tr>
3875 </tbody>
3876 </table></div>
3877 </div>
3878 <hr>
3879 <div class="refsect2">
3880 <a name="gnutls-x509-crt-get-raw-dn"></a><h3>gnutls_x509_crt_get_raw_dn ()</h3>
3881 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_raw_dn          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
3882                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *start</code></em>);</pre>
3883 <p>
3884 This function will return a pointer to the DER encoded DN structure and
3885 the length.
3886 </p>
3887 <div class="variablelist"><table border="0">
3888 <col align="left" valign="top">
3889 <tbody>
3890 <tr>
3891 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
3892 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
3893 </tr>
3894 <tr>
3895 <td><p><span class="term"><em class="parameter"><code>start</code></em> :</span></p></td>
3896 <td>will hold the starting point of the DN</td>
3897 </tr>
3898 <tr>
3899 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3900 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
3901 negative error value. or a negative value on error.</td>
3902 </tr>
3903 </tbody>
3904 </table></div>
3905 </div>
3906 <hr>
3907 <div class="refsect2">
3908 <a name="gnutls-x509-rdn-get"></a><h3>gnutls_x509_rdn_get ()</h3>
3909 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_rdn_get                 (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
3910                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
3911                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
3912 <p>
3913 This function will return the name of the given RDN sequence.  The
3914 name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as described in
3915 RFC2253.
3916 </p>
3917 <div class="variablelist"><table border="0">
3918 <col align="left" valign="top">
3919 <tbody>
3920 <tr>
3921 <td><p><span class="term"><em class="parameter"><code>idn</code></em> :</span></p></td>
3922 <td>should contain a DER encoded RDN sequence</td>
3923 </tr>
3924 <tr>
3925 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
3926 <td>a pointer to a structure to hold the peer's name</td>
3927 </tr>
3928 <tr>
3929 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
3930 <td>holds the size of <em class="parameter"><code>buf</code></em>
3931 </td>
3932 </tr>
3933 <tr>
3934 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3935 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, or
3936 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> is returned and *<em class="parameter"><code>sizeof_buf</code></em> is
3937 updated if the provided buffer is not long enough, otherwise a
3938 negative error value.</td>
3939 </tr>
3940 </tbody>
3941 </table></div>
3942 </div>
3943 <hr>
3944 <div class="refsect2">
3945 <a name="gnutls-x509-rdn-get-oid"></a><h3>gnutls_x509_rdn_get_oid ()</h3>
3946 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_rdn_get_oid             (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
3947                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
3948                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
3949                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
3950 <p>
3951 This function will return the specified Object identifier, of the
3952 RDN sequence.
3953 </p>
3954 <div class="variablelist"><table border="0">
3955 <col align="left" valign="top">
3956 <tbody>
3957 <tr>
3958 <td><p><span class="term"><em class="parameter"><code>idn</code></em> :</span></p></td>
3959 <td>should contain a DER encoded RDN sequence</td>
3960 </tr>
3961 <tr>
3962 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
3963 <td>Indicates which OID to return. Use 0 for the first one.</td>
3964 </tr>
3965 <tr>
3966 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
3967 <td>a pointer to a structure to hold the peer's name OID</td>
3968 </tr>
3969 <tr>
3970 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
3971 <td>holds the size of <em class="parameter"><code>buf</code></em>
3972 </td>
3973 </tr>
3974 <tr>
3975 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
3976 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, or
3977 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> is returned and *<em class="parameter"><code>sizeof_buf</code></em> is
3978 updated if the provided buffer is not long enough, otherwise a
3979 negative error value.</td>
3980 </tr>
3981 </tbody>
3982 </table></div>
3983 <p class="since">Since 2.4.0</p>
3984 </div>
3985 <hr>
3986 <div class="refsect2">
3987 <a name="gnutls-x509-rdn-get-by-oid"></a><h3>gnutls_x509_rdn_get_by_oid ()</h3>
3988 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_rdn_get_by_oid          (<em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *idn</code></em>,
3989                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
3990                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
3991                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
3992                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
3993                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
3994 <p>
3995 This function will return the name of the given Object identifier,
3996 of the RDN sequence.  The name will be encoded using the rules
3997 from RFC2253.
3998 </p>
3999 <div class="variablelist"><table border="0">
4000 <col align="left" valign="top">
4001 <tbody>
4002 <tr>
4003 <td><p><span class="term"><em class="parameter"><code>idn</code></em> :</span></p></td>
4004 <td>should contain a DER encoded RDN sequence</td>
4005 </tr>
4006 <tr>
4007 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
4008 <td>an Object Identifier</td>
4009 </tr>
4010 <tr>
4011 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
4012 <td>In case multiple same OIDs exist in the RDN indicates which
4013 to send. Use 0 for the first one.</td>
4014 </tr>
4015 <tr>
4016 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
4017 <td>If non zero then the raw DER data are returned.</td>
4018 </tr>
4019 <tr>
4020 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
4021 <td>a pointer to a structure to hold the peer's name</td>
4022 </tr>
4023 <tr>
4024 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
4025 <td>holds the size of <em class="parameter"><code>buf</code></em>
4026 </td>
4027 </tr>
4028 <tr>
4029 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4030 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, or
4031 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> is returned and *<em class="parameter"><code>sizeof_buf</code></em> is
4032 updated if the provided buffer is not long enough, otherwise a
4033 negative error value.</td>
4034 </tr>
4035 </tbody>
4036 </table></div>
4037 </div>
4038 <hr>
4039 <div class="refsect2">
4040 <a name="gnutls-x509-dn-t"></a><h3>gnutls_x509_dn_t</h3>
4041 <pre class="programlisting">  typedef void *gnutls_x509_dn_t;
4042 </pre>
4043 <p>
4044 </p>
4045 </div>
4046 <hr>
4047 <div class="refsect2">
4048 <a name="gnutls-x509-crt-get-subject"></a><h3>gnutls_x509_crt_get_subject ()</h3>
4049 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_subject         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
4050                                                          <em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);</pre>
4051 <p>
4052 Return the Certificate's Subject DN as an opaque data type.  You
4053 may use <a class="link" href="gnutls-x509.html#gnutls-x509-dn-get-rdn-ava" title="gnutls_x509_dn_get_rdn_ava ()"><code class="function">gnutls_x509_dn_get_rdn_ava()</code></a> to decode the DN. 
4054 </p>
4055 <p>
4056 Note that <em class="parameter"><code>dn</code></em> should be treated as constant. Because points 
4057 into the <em class="parameter"><code>cert</code></em> object, you may not deallocate <em class="parameter"><code>cert</code></em> 
4058 and continue to access <em class="parameter"><code>dn</code></em>.
4059 </p>
4060 <div class="variablelist"><table border="0">
4061 <col align="left" valign="top">
4062 <tbody>
4063 <tr>
4064 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
4065 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
4066 </tr>
4067 <tr>
4068 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4069 <td>output variable with pointer to opaque DN.</td>
4070 </tr>
4071 <tr>
4072 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4073 <td>Returns 0 on success, or an error code.</td>
4074 </tr>
4075 </tbody>
4076 </table></div>
4077 </div>
4078 <hr>
4079 <div class="refsect2">
4080 <a name="gnutls-x509-crt-get-issuer"></a><h3>gnutls_x509_crt_get_issuer ()</h3>
4081 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_issuer          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
4082                                                          <em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);</pre>
4083 <p>
4084 Return the Certificate's Issuer DN as an opaque data type.  You may
4085 use <a class="link" href="gnutls-x509.html#gnutls-x509-dn-get-rdn-ava" title="gnutls_x509_dn_get_rdn_ava ()"><code class="function">gnutls_x509_dn_get_rdn_ava()</code></a> to decode the DN.
4086 </p>
4087 <p>
4088 Note that <em class="parameter"><code>dn</code></em> should be treated as constant. Because points 
4089 into the <em class="parameter"><code>cert</code></em> object, you may not deallocate <em class="parameter"><code>cert</code></em> 
4090 and continue to access <em class="parameter"><code>dn</code></em>.
4091 </p>
4092 <div class="variablelist"><table border="0">
4093 <col align="left" valign="top">
4094 <tbody>
4095 <tr>
4096 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
4097 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
4098 </tr>
4099 <tr>
4100 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4101 <td>output variable with pointer to opaque DN</td>
4102 </tr>
4103 <tr>
4104 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4105 <td>Returns 0 on success, or an error code.</td>
4106 </tr>
4107 </tbody>
4108 </table></div>
4109 </div>
4110 <hr>
4111 <div class="refsect2">
4112 <a name="gnutls-x509-dn-get-rdn-ava"></a><h3>gnutls_x509_dn_get_rdn_ava ()</h3>
4113 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_dn_get_rdn_ava          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
4114                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> irdn</code></em>,
4115                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> iava</code></em>,
4116                                                          <em class="parameter"><code><span class="type">gnutls_x509_ava_st</span> *ava</code></em>);</pre>
4117 <p>
4118 Get pointers to data within the DN.
4119 </p>
4120 <p>
4121 Note that <em class="parameter"><code>ava</code></em> will contain pointers into the <em class="parameter"><code>dn</code></em> structure, so you
4122 should not modify any data or deallocate it.  Note also that the DN
4123 in turn points into the original certificate structure, and thus
4124 you may not deallocate the certificate and continue to access <em class="parameter"><code>dn</code></em>.
4125 </p>
4126 <div class="variablelist"><table border="0">
4127 <col align="left" valign="top">
4128 <tbody>
4129 <tr>
4130 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4131 <td>input variable with opaque DN pointer</td>
4132 </tr>
4133 <tr>
4134 <td><p><span class="term"><em class="parameter"><code>irdn</code></em> :</span></p></td>
4135 <td>index of RDN</td>
4136 </tr>
4137 <tr>
4138 <td><p><span class="term"><em class="parameter"><code>iava</code></em> :</span></p></td>
4139 <td>index of AVA.</td>
4140 </tr>
4141 <tr>
4142 <td><p><span class="term"><em class="parameter"><code>ava</code></em> :</span></p></td>
4143 <td>Pointer to structure which will hold output information.</td>
4144 </tr>
4145 <tr>
4146 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4147 <td>Returns 0 on success, or an error code.</td>
4148 </tr>
4149 </tbody>
4150 </table></div>
4151 </div>
4152 <hr>
4153 <div class="refsect2">
4154 <a name="gnutls-x509-dn-init"></a><h3>gnutls_x509_dn_init ()</h3>
4155 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_dn_init                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> *dn</code></em>);</pre>
4156 <p>
4157 This function initializes a <a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> structure.
4158 </p>
4159 <p>
4160 The object returned must be deallocated using
4161 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-deinit" title="gnutls_x509_dn_deinit ()"><code class="function">gnutls_x509_dn_deinit()</code></a>.
4162 </p>
4163 <div class="variablelist"><table border="0">
4164 <col align="left" valign="top">
4165 <tbody>
4166 <tr>
4167 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4168 <td>the object to be initialized</td>
4169 </tr>
4170 <tr>
4171 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4172 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4173 negative error value.</td>
4174 </tr>
4175 </tbody>
4176 </table></div>
4177 <p class="since">Since 2.4.0</p>
4178 </div>
4179 <hr>
4180 <div class="refsect2">
4181 <a name="gnutls-x509-dn-import"></a><h3>gnutls_x509_dn_import ()</h3>
4182 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_dn_import               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
4183                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>);</pre>
4184 <p>
4185 This function parses an RDN sequence and stores the result to a
4186 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> structure. The structure must have been initialized
4187 with <a class="link" href="gnutls-x509.html#gnutls-x509-dn-init" title="gnutls_x509_dn_init ()"><code class="function">gnutls_x509_dn_init()</code></a>. You may use <a class="link" href="gnutls-x509.html#gnutls-x509-dn-get-rdn-ava" title="gnutls_x509_dn_get_rdn_ava ()"><code class="function">gnutls_x509_dn_get_rdn_ava()</code></a> to
4188 decode the DN.
4189 </p>
4190 <div class="variablelist"><table border="0">
4191 <col align="left" valign="top">
4192 <tbody>
4193 <tr>
4194 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4195 <td>the structure that will hold the imported DN</td>
4196 </tr>
4197 <tr>
4198 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
4199 <td>should contain a DER encoded RDN sequence</td>
4200 </tr>
4201 <tr>
4202 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4203 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4204 negative error value.</td>
4205 </tr>
4206 </tbody>
4207 </table></div>
4208 <p class="since">Since 2.4.0</p>
4209 </div>
4210 <hr>
4211 <div class="refsect2">
4212 <a name="gnutls-x509-dn-export"></a><h3>gnutls_x509_dn_export ()</h3>
4213 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_dn_export               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>,
4214                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
4215                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
4216                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
4217 <p>
4218 This function will export the DN to DER or PEM format.
4219 </p>
4220 <p>
4221 If the buffer provided is not long enough to hold the output, then
4222 *<em class="parameter"><code>output_data_size</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a>
4223 will be returned.
4224 </p>
4225 <p>
4226 If the structure is PEM encoded, it will have a header
4227 of "BEGIN NAME".
4228 </p>
4229 <div class="variablelist"><table border="0">
4230 <col align="left" valign="top">
4231 <tbody>
4232 <tr>
4233 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4234 <td>Holds the opaque DN object</td>
4235 </tr>
4236 <tr>
4237 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
4238 <td>the format of output params. One of PEM or DER.</td>
4239 </tr>
4240 <tr>
4241 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
4242 <td>will contain a DN PEM or DER encoded</td>
4243 </tr>
4244 <tr>
4245 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
4246 <td>holds the size of output_data (and will be
4247 replaced by the actual size of parameters)</td>
4248 </tr>
4249 <tr>
4250 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4251 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4252 negative error value.</td>
4253 </tr>
4254 </tbody>
4255 </table></div>
4256 </div>
4257 <hr>
4258 <div class="refsect2">
4259 <a name="gnutls-x509-dn-deinit"></a><h3>gnutls_x509_dn_deinit ()</h3>
4260 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_x509_dn_deinit               (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-x509-dn-t" title="gnutls_x509_dn_t"><span class="type">gnutls_x509_dn_t</span></a> dn</code></em>);</pre>
4261 <p>
4262 This function deallocates the DN object as returned by
4263 <a class="link" href="gnutls-x509.html#gnutls-x509-dn-import" title="gnutls_x509_dn_import ()"><code class="function">gnutls_x509_dn_import()</code></a>.
4264 </p>
4265 <div class="variablelist"><table border="0">
4266 <col align="left" valign="top">
4267 <tbody><tr>
4268 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4269 <td>a DN opaque object pointer.</td>
4270 </tr></tbody>
4271 </table></div>
4272 <p class="since">Since 2.4.0</p>
4273 </div>
4274 <hr>
4275 <div class="refsect2">
4276 <a name="gnutls-x509-crl-init"></a><h3>gnutls_x509_crl_init ()</h3>
4277 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_init                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *crl</code></em>);</pre>
4278 <p>
4279 This function will initialize a CRL structure. CRL stands for
4280 Certificate Revocation List. A revocation list usually contains
4281 lists of certificate serial numbers that have been revoked by an
4282 Authority. The revocation lists are always signed with the
4283 authority's private key.
4284 </p>
4285 <div class="variablelist"><table border="0">
4286 <col align="left" valign="top">
4287 <tbody>
4288 <tr>
4289 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4290 <td>The structure to be initialized</td>
4291 </tr>
4292 <tr>
4293 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4294 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4295 negative error value.</td>
4296 </tr>
4297 </tbody>
4298 </table></div>
4299 </div>
4300 <hr>
4301 <div class="refsect2">
4302 <a name="gnutls-x509-crl-deinit"></a><h3>gnutls_x509_crl_deinit ()</h3>
4303 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_x509_crl_deinit              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4304 <p>
4305 This function will deinitialize a CRL structure.
4306 </p>
4307 <div class="variablelist"><table border="0">
4308 <col align="left" valign="top">
4309 <tbody><tr>
4310 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4311 <td>The structure to be initialized</td>
4312 </tr></tbody>
4313 </table></div>
4314 </div>
4315 <hr>
4316 <div class="refsect2">
4317 <a name="gnutls-x509-crl-import"></a><h3>gnutls_x509_crl_import ()</h3>
4318 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_import              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4319                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
4320                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);</pre>
4321 <p>
4322 This function will convert the given DER or PEM encoded CRL
4323 to the native <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> format. The output will be stored in 'crl'.
4324 </p>
4325 <p>
4326 If the CRL is PEM encoded it should have a header of "X509 CRL".
4327 </p>
4328 <div class="variablelist"><table border="0">
4329 <col align="left" valign="top">
4330 <tbody>
4331 <tr>
4332 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4333 <td>The structure to store the parsed CRL.</td>
4334 </tr>
4335 <tr>
4336 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
4337 <td>The DER or PEM encoded CRL.</td>
4338 </tr>
4339 <tr>
4340 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
4341 <td>One of DER or PEM</td>
4342 </tr>
4343 <tr>
4344 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4345 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4346 negative error value.</td>
4347 </tr>
4348 </tbody>
4349 </table></div>
4350 </div>
4351 <hr>
4352 <div class="refsect2">
4353 <a name="gnutls-x509-crl-export"></a><h3>gnutls_x509_crl_export ()</h3>
4354 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_export              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4355                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
4356                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
4357                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
4358 <p>
4359 This function will export the revocation list to DER or PEM format.
4360 </p>
4361 <p>
4362 If the buffer provided is not long enough to hold the output, then
4363 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be returned.
4364 </p>
4365 <p>
4366 If the structure is PEM encoded, it will have a header
4367 of "BEGIN X509 CRL".
4368 </p>
4369 <div class="variablelist"><table border="0">
4370 <col align="left" valign="top">
4371 <tbody>
4372 <tr>
4373 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4374 <td>Holds the revocation list</td>
4375 </tr>
4376 <tr>
4377 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
4378 <td>the format of output params. One of PEM or DER.</td>
4379 </tr>
4380 <tr>
4381 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
4382 <td>will contain a private key PEM or DER encoded</td>
4383 </tr>
4384 <tr>
4385 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
4386 <td>holds the size of output_data (and will
4387 be replaced by the actual size of parameters)</td>
4388 </tr>
4389 <tr>
4390 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4391 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4392 negative error value. and a negative value on failure.</td>
4393 </tr>
4394 </tbody>
4395 </table></div>
4396 </div>
4397 <hr>
4398 <div class="refsect2">
4399 <a name="gnutls-x509-crl-get-raw-issuer-dn"></a><h3>gnutls_x509_crl_get_raw_issuer_dn ()</h3>
4400 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_raw_issuer_dn   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4401                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *dn</code></em>);</pre>
4402 <p>
4403 This function will return a pointer to the DER encoded DN structure
4404 and the length.
4405 </p>
4406 <div class="variablelist"><table border="0">
4407 <col align="left" valign="top">
4408 <tbody>
4409 <tr>
4410 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4411 <td>should contain a gnutls_x509_crl_t structure</td>
4412 </tr>
4413 <tr>
4414 <td><p><span class="term"><em class="parameter"><code>dn</code></em> :</span></p></td>
4415 <td>will hold the starting point of the DN</td>
4416 </tr>
4417 <tr>
4418 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4419 <td>a negative value on error, and zero on success.</td>
4420 </tr>
4421 </tbody>
4422 </table></div>
4423 <p class="since">Since 2.12.0</p>
4424 </div>
4425 <hr>
4426 <div class="refsect2">
4427 <a name="gnutls-x509-crl-get-issuer-dn"></a><h3>gnutls_x509_crl_get_issuer_dn ()</h3>
4428 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_issuer_dn       (<em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4429                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
4430                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
4431 <p>
4432 This function will copy the name of the CRL issuer in the provided
4433 buffer. The name will be in the form "C=xxxx,O=yyyy,CN=zzzz" as
4434 described in RFC2253. The output string will be ASCII or UTF-8
4435 encoded, depending on the certificate data.
4436 </p>
4437 <p>
4438 If buf is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> then only the size will be filled.
4439 </p>
4440 <div class="variablelist"><table border="0">
4441 <col align="left" valign="top">
4442 <tbody>
4443 <tr>
4444 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4445 <td>should contain a gnutls_x509_crl_t structure</td>
4446 </tr>
4447 <tr>
4448 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
4449 <td>a pointer to a structure to hold the peer's name (may be null)</td>
4450 </tr>
4451 <tr>
4452 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
4453 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
4454 </td>
4455 </tr>
4456 <tr>
4457 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4458 <td>
4459 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
4460 not long enough, and in that case the sizeof_buf will be updated
4461 with the required size, and 0 on success.</td>
4462 </tr>
4463 </tbody>
4464 </table></div>
4465 </div>
4466 <hr>
4467 <div class="refsect2">
4468 <a name="gnutls-x509-crl-get-issuer-dn-by-oid"></a><h3>gnutls_x509_crl_get_issuer_dn_by_oid ()</h3>
4469 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_issuer_dn_by_oid
4470                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4471                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
4472                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
4473                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
4474                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
4475                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
4476 <p>
4477 This function will extract the part of the name of the CRL issuer
4478 specified by the given OID. The output will be encoded as described
4479 in RFC2253. The output string will be ASCII or UTF-8 encoded,
4480 depending on the certificate data.
4481 </p>
4482 <p>
4483 Some helper macros with popular OIDs can be found in gnutls/x509.h
4484 If raw flag is zero, this function will only return known OIDs as
4485 text. Other OIDs will be DER encoded, as described in RFC2253 -- in
4486 hex format with a '#' prefix.  You can check about known OIDs
4487 using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>.
4488 </p>
4489 <p>
4490 If buf is null then only the size will be filled.
4491 </p>
4492 <div class="variablelist"><table border="0">
4493 <col align="left" valign="top">
4494 <tbody>
4495 <tr>
4496 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4497 <td>should contain a gnutls_x509_crl_t structure</td>
4498 </tr>
4499 <tr>
4500 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
4501 <td>holds an Object Identified in null terminated string</td>
4502 </tr>
4503 <tr>
4504 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
4505 <td>In case multiple same OIDs exist in the RDN, this specifies which to send. Use zero to get the first one.</td>
4506 </tr>
4507 <tr>
4508 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
4509 <td>If non zero returns the raw DER data of the DN part.</td>
4510 </tr>
4511 <tr>
4512 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
4513 <td>a pointer to a structure to hold the peer's name (may be null)</td>
4514 </tr>
4515 <tr>
4516 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
4517 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
4518 </td>
4519 </tr>
4520 <tr>
4521 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4522 <td>
4523 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
4524 not long enough, and in that case the sizeof_buf will be updated
4525 with the required size, and 0 on success.</td>
4526 </tr>
4527 </tbody>
4528 </table></div>
4529 </div>
4530 <hr>
4531 <div class="refsect2">
4532 <a name="gnutls-x509-crl-get-dn-oid"></a><h3>gnutls_x509_crl_get_dn_oid ()</h3>
4533 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_dn_oid          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4534                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
4535                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
4536                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
4537 <p>
4538 This function will extract the requested OID of the name of the CRL
4539 issuer, specified by the given index.
4540 </p>
4541 <p>
4542 If oid is null then only the size will be filled.
4543 </p>
4544 <div class="variablelist"><table border="0">
4545 <col align="left" valign="top">
4546 <tbody>
4547 <tr>
4548 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4549 <td>should contain a gnutls_x509_crl_t structure</td>
4550 </tr>
4551 <tr>
4552 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
4553 <td>Specifies which DN OID to send. Use zero to get the first one.</td>
4554 </tr>
4555 <tr>
4556 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
4557 <td>a pointer to a structure to hold the name (may be null)</td>
4558 </tr>
4559 <tr>
4560 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
4561 <td>initially holds the size of 'oid'</td>
4562 </tr>
4563 <tr>
4564 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4565 <td>
4566 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
4567 not long enough, and in that case the sizeof_oid will be updated
4568 with the required size.  On success 0 is returned.</td>
4569 </tr>
4570 </tbody>
4571 </table></div>
4572 </div>
4573 <hr>
4574 <div class="refsect2">
4575 <a name="gnutls-x509-crl-get-signature-algorithm"></a><h3>gnutls_x509_crl_get_signature_algorithm ()</h3>
4576 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_signature_algorithm
4577                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4578 <p>
4579 This function will return a value of the <a class="link" href="gnutls-gnutls.html#gnutls-sign-algorithm-t" title="enum gnutls_sign_algorithm_t"><span class="type">gnutls_sign_algorithm_t</span></a>
4580 enumeration that is the signature algorithm.
4581 </p>
4582 <div class="variablelist"><table border="0">
4583 <col align="left" valign="top">
4584 <tbody>
4585 <tr>
4586 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4587 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4588 </tr>
4589 <tr>
4590 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4591 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4592 negative error value.</td>
4593 </tr>
4594 </tbody>
4595 </table></div>
4596 </div>
4597 <hr>
4598 <div class="refsect2">
4599 <a name="gnutls-x509-crl-get-signature"></a><h3>gnutls_x509_crl_get_signature ()</h3>
4600 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_signature       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4601                                                          <em class="parameter"><code><span class="type">char</span> *sig</code></em>,
4602                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_sig</code></em>);</pre>
4603 <p>
4604 This function will extract the signature field of a CRL.
4605 </p>
4606 <div class="variablelist"><table border="0">
4607 <col align="left" valign="top">
4608 <tbody>
4609 <tr>
4610 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4611 <td>should contain a gnutls_x509_crl_t structure</td>
4612 </tr>
4613 <tr>
4614 <td><p><span class="term"><em class="parameter"><code>sig</code></em> :</span></p></td>
4615 <td>a pointer where the signature part will be copied (may be null).</td>
4616 </tr>
4617 <tr>
4618 <td><p><span class="term"><em class="parameter"><code>sizeof_sig</code></em> :</span></p></td>
4619 <td>initially holds the size of <em class="parameter"><code>sig</code></em>
4620 </td>
4621 </tr>
4622 <tr>
4623 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4624 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4625 negative error value. and a negative value on error.</td>
4626 </tr>
4627 </tbody>
4628 </table></div>
4629 </div>
4630 <hr>
4631 <div class="refsect2">
4632 <a name="gnutls-x509-crl-get-version"></a><h3>gnutls_x509_crl_get_version ()</h3>
4633 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4634 <p>
4635 This function will return the version of the specified CRL.
4636 </p>
4637 <div class="variablelist"><table border="0">
4638 <col align="left" valign="top">
4639 <tbody>
4640 <tr>
4641 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4642 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4643 </tr>
4644 <tr>
4645 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4646 <td>The version number, or a negative value on error.</td>
4647 </tr>
4648 </tbody>
4649 </table></div>
4650 </div>
4651 <hr>
4652 <div class="refsect2">
4653 <a name="gnutls-x509-crl-get-this-update"></a><h3>gnutls_x509_crl_get_this_update ()</h3>
4654 <pre class="programlisting"><span class="returnvalue">time_t</span>              gnutls_x509_crl_get_this_update     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4655 <p>
4656 This function will return the time this CRL was issued.
4657 </p>
4658 <div class="variablelist"><table border="0">
4659 <col align="left" valign="top">
4660 <tbody>
4661 <tr>
4662 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4663 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4664 </tr>
4665 <tr>
4666 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4667 <td>when the CRL was issued, or (time_t)-1 on error.</td>
4668 </tr>
4669 </tbody>
4670 </table></div>
4671 </div>
4672 <hr>
4673 <div class="refsect2">
4674 <a name="gnutls-x509-crl-get-next-update"></a><h3>gnutls_x509_crl_get_next_update ()</h3>
4675 <pre class="programlisting"><span class="returnvalue">time_t</span>              gnutls_x509_crl_get_next_update     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4676 <p>
4677 This function will return the time the next CRL will be issued.
4678 This field is optional in a CRL so it might be normal to get an
4679 error instead.
4680 </p>
4681 <div class="variablelist"><table border="0">
4682 <col align="left" valign="top">
4683 <tbody>
4684 <tr>
4685 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4686 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4687 </tr>
4688 <tr>
4689 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4690 <td>when the next CRL will be issued, or (time_t)-1 on error.</td>
4691 </tr>
4692 </tbody>
4693 </table></div>
4694 </div>
4695 <hr>
4696 <div class="refsect2">
4697 <a name="gnutls-x509-crl-get-crt-count"></a><h3>gnutls_x509_crl_get_crt_count ()</h3>
4698 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_crt_count       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
4699 <p>
4700 This function will return the number of revoked certificates in the
4701 given CRL.
4702 </p>
4703 <div class="variablelist"><table border="0">
4704 <col align="left" valign="top">
4705 <tbody>
4706 <tr>
4707 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4708 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4709 </tr>
4710 <tr>
4711 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4712 <td>number of certificates, a negative value on failure.</td>
4713 </tr>
4714 </tbody>
4715 </table></div>
4716 </div>
4717 <hr>
4718 <div class="refsect2">
4719 <a name="gnutls-x509-crl-get-crt-serial"></a><h3>gnutls_x509_crl_get_crt_serial ()</h3>
4720 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_crt_serial      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4721                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
4722                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *serial</code></em>,
4723                                                          <em class="parameter"><code><span class="type">size_t</span> *serial_size</code></em>,
4724                                                          <em class="parameter"><code><span class="type">time_t</span> *t</code></em>);</pre>
4725 <p>
4726 This function will retrieve the serial number of the specified, by
4727 the index, revoked certificate.
4728 </p>
4729 <div class="variablelist"><table border="0">
4730 <col align="left" valign="top">
4731 <tbody>
4732 <tr>
4733 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4734 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4735 </tr>
4736 <tr>
4737 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
4738 <td>the index of the certificate to extract (starting from 0)</td>
4739 </tr>
4740 <tr>
4741 <td><p><span class="term"><em class="parameter"><code>serial</code></em> :</span></p></td>
4742 <td>where the serial number will be copied</td>
4743 </tr>
4744 <tr>
4745 <td><p><span class="term"><em class="parameter"><code>serial_size</code></em> :</span></p></td>
4746 <td>initially holds the size of serial</td>
4747 </tr>
4748 <tr>
4749 <td><p><span class="term"><em class="parameter"><code>t</code></em> :</span></p></td>
4750 <td>if non null, will hold the time this certificate was revoked</td>
4751 </tr>
4752 <tr>
4753 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4754 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4755 negative error value. and a negative value on error.</td>
4756 </tr>
4757 </tbody>
4758 </table></div>
4759 </div>
4760 <hr>
4761 <div class="refsect2">
4762 <a name="gnutls-x509-crl-get-certificate-count"></a><h3>gnutls_x509_crl_get_certificate_count</h3>
4763 <pre class="programlisting">#define gnutls_x509_crl_get_certificate_count gnutls_x509_crl_get_crt_count
4764 </pre>
4765 <p>
4766 </p>
4767 </div>
4768 <hr>
4769 <div class="refsect2">
4770 <a name="gnutls-x509-crl-get-certificate"></a><h3>gnutls_x509_crl_get_certificate</h3>
4771 <pre class="programlisting">#define gnutls_x509_crl_get_certificate gnutls_x509_crl_get_crt_serial
4772 </pre>
4773 <p>
4774 </p>
4775 </div>
4776 <hr>
4777 <div class="refsect2">
4778 <a name="gnutls-x509-crl-check-issuer"></a><h3>gnutls_x509_crl_check_issuer ()</h3>
4779 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_check_issuer        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4780                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>);</pre>
4781 <p>
4782 This function will check if the given CRL was issued by the given
4783 issuer certificate.  It will return true (1) if the given CRL was
4784 issued by the given issuer, and false (0) if not.
4785 </p>
4786 <div class="variablelist"><table border="0">
4787 <col align="left" valign="top">
4788 <tbody>
4789 <tr>
4790 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4791 <td>is the CRL to be checked</td>
4792 </tr>
4793 <tr>
4794 <td><p><span class="term"><em class="parameter"><code>issuer</code></em> :</span></p></td>
4795 <td>is the certificate of a possible issuer</td>
4796 </tr>
4797 <tr>
4798 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4799 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4800 negative error value.</td>
4801 </tr>
4802 </tbody>
4803 </table></div>
4804 </div>
4805 <hr>
4806 <div class="refsect2">
4807 <a name="gnutls-x509-crl-set-version"></a><h3>gnutls_x509_crl_set_version ()</h3>
4808 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4809                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);</pre>
4810 <p>
4811 This function will set the version of the CRL. This
4812 must be one for CRL version 1, and so on. The CRLs generated
4813 by gnutls should have a version number of 2.
4814 </p>
4815 <div class="variablelist"><table border="0">
4816 <col align="left" valign="top">
4817 <tbody>
4818 <tr>
4819 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4820 <td>should contain a gnutls_x509_crl_t structure</td>
4821 </tr>
4822 <tr>
4823 <td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
4824 <td>holds the version number. For CRLv1 crls must be 1.</td>
4825 </tr>
4826 <tr>
4827 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4828 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4829 negative error value.</td>
4830 </tr>
4831 </tbody>
4832 </table></div>
4833 </div>
4834 <hr>
4835 <div class="refsect2">
4836 <a name="gnutls-x509-crl-set-this-update"></a><h3>gnutls_x509_crl_set_this_update ()</h3>
4837 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_this_update     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4838                                                          <em class="parameter"><code><span class="type">time_t</span> act_time</code></em>);</pre>
4839 <p>
4840 This function will set the time this CRL was issued.
4841 </p>
4842 <div class="variablelist"><table border="0">
4843 <col align="left" valign="top">
4844 <tbody>
4845 <tr>
4846 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4847 <td>should contain a gnutls_x509_crl_t structure</td>
4848 </tr>
4849 <tr>
4850 <td><p><span class="term"><em class="parameter"><code>act_time</code></em> :</span></p></td>
4851 <td>The actual time</td>
4852 </tr>
4853 <tr>
4854 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4855 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4856 negative error value.</td>
4857 </tr>
4858 </tbody>
4859 </table></div>
4860 </div>
4861 <hr>
4862 <div class="refsect2">
4863 <a name="gnutls-x509-crl-set-next-update"></a><h3>gnutls_x509_crl_set_next_update ()</h3>
4864 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_next_update     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4865                                                          <em class="parameter"><code><span class="type">time_t</span> exp_time</code></em>);</pre>
4866 <p>
4867 This function will set the time this CRL will be updated.
4868 </p>
4869 <div class="variablelist"><table border="0">
4870 <col align="left" valign="top">
4871 <tbody>
4872 <tr>
4873 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4874 <td>should contain a gnutls_x509_crl_t structure</td>
4875 </tr>
4876 <tr>
4877 <td><p><span class="term"><em class="parameter"><code>exp_time</code></em> :</span></p></td>
4878 <td>The actual time</td>
4879 </tr>
4880 <tr>
4881 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4882 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4883 negative error value.</td>
4884 </tr>
4885 </tbody>
4886 </table></div>
4887 </div>
4888 <hr>
4889 <div class="refsect2">
4890 <a name="gnutls-x509-crl-set-crt-serial"></a><h3>gnutls_x509_crl_set_crt_serial ()</h3>
4891 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_crt_serial      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4892                                                          <em class="parameter"><code>const <span class="type">void</span> *serial</code></em>,
4893                                                          <em class="parameter"><code><span class="type">size_t</span> serial_size</code></em>,
4894                                                          <em class="parameter"><code><span class="type">time_t</span> revocation_time</code></em>);</pre>
4895 <p>
4896 This function will set a revoked certificate's serial number to the CRL.
4897 </p>
4898 <div class="variablelist"><table border="0">
4899 <col align="left" valign="top">
4900 <tbody>
4901 <tr>
4902 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4903 <td>should contain a gnutls_x509_crl_t structure</td>
4904 </tr>
4905 <tr>
4906 <td><p><span class="term"><em class="parameter"><code>serial</code></em> :</span></p></td>
4907 <td>The revoked certificate's serial number</td>
4908 </tr>
4909 <tr>
4910 <td><p><span class="term"><em class="parameter"><code>serial_size</code></em> :</span></p></td>
4911 <td>Holds the size of the serial field.</td>
4912 </tr>
4913 <tr>
4914 <td><p><span class="term"><em class="parameter"><code>revocation_time</code></em> :</span></p></td>
4915 <td>The time this certificate was revoked</td>
4916 </tr>
4917 <tr>
4918 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4919 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4920 negative error value.</td>
4921 </tr>
4922 </tbody>
4923 </table></div>
4924 </div>
4925 <hr>
4926 <div class="refsect2">
4927 <a name="gnutls-x509-crl-set-crt"></a><h3>gnutls_x509_crl_set_crt ()</h3>
4928 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_crt             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4929                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
4930                                                          <em class="parameter"><code><span class="type">time_t</span> revocation_time</code></em>);</pre>
4931 <p>
4932 This function will set a revoked certificate's serial number to the CRL.
4933 </p>
4934 <div class="variablelist"><table border="0">
4935 <col align="left" valign="top">
4936 <tbody>
4937 <tr>
4938 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4939 <td>should contain a gnutls_x509_crl_t structure</td>
4940 </tr>
4941 <tr>
4942 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
4943 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> with the revoked certificate</td>
4944 </tr>
4945 <tr>
4946 <td><p><span class="term"><em class="parameter"><code>revocation_time</code></em> :</span></p></td>
4947 <td>The time this certificate was revoked</td>
4948 </tr>
4949 <tr>
4950 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4951 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4952 negative error value.</td>
4953 </tr>
4954 </tbody>
4955 </table></div>
4956 </div>
4957 <hr>
4958 <div class="refsect2">
4959 <a name="gnutls-x509-crl-get-authority-key-id"></a><h3>gnutls_x509_crl_get_authority_key_id ()</h3>
4960 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_authority_key_id
4961                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
4962                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
4963                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
4964                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
4965 <p>
4966 This function will return the CRL authority's key identifier.  This
4967 is obtained by the X.509 Authority Key identifier extension field
4968 (2.5.29.35).  Note that this function only returns the
4969 keyIdentifier field of the extension.
4970 </p>
4971 <div class="variablelist"><table border="0">
4972 <col align="left" valign="top">
4973 <tbody>
4974 <tr>
4975 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
4976 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
4977 </tr>
4978 <tr>
4979 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
4980 <td>The place where the identifier will be copied</td>
4981 </tr>
4982 <tr>
4983 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
4984 <td>Holds the size of the result field.</td>
4985 </tr>
4986 <tr>
4987 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
4988 <td>will be non zero if the extension is marked as critical
4989 (may be null)</td>
4990 </tr>
4991 <tr>
4992 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
4993 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
4994 negative value in case of an error.</td>
4995 </tr>
4996 </tbody>
4997 </table></div>
4998 <p class="since">Since 2.8.0</p>
4999 </div>
5000 <hr>
5001 <div class="refsect2">
5002 <a name="gnutls-x509-crl-get-number"></a><h3>gnutls_x509_crl_get_number ()</h3>
5003 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_number          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5004                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
5005                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
5006                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
5007 <p>
5008 This function will return the CRL number extension.  This is
5009 obtained by the CRL Number extension field (2.5.29.20).
5010 </p>
5011 <div class="variablelist"><table border="0">
5012 <col align="left" valign="top">
5013 <tbody>
5014 <tr>
5015 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5016 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
5017 </tr>
5018 <tr>
5019 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
5020 <td>The place where the number will be copied</td>
5021 </tr>
5022 <tr>
5023 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
5024 <td>Holds the size of the result field.</td>
5025 </tr>
5026 <tr>
5027 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
5028 <td>will be non zero if the extension is marked as critical
5029 (may be null)</td>
5030 </tr>
5031 <tr>
5032 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5033 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5034 negative value in case of an error.</td>
5035 </tr>
5036 </tbody>
5037 </table></div>
5038 <p class="since">Since 2.8.0</p>
5039 </div>
5040 <hr>
5041 <div class="refsect2">
5042 <a name="gnutls-x509-crl-get-extension-oid"></a><h3>gnutls_x509_crl_get_extension_oid ()</h3>
5043 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_extension_oid   (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5044                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
5045                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
5046                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
5047 <p>
5048 This function will return the requested extension OID in the CRL.
5049 The extension OID will be stored as a string in the provided
5050 buffer.
5051 </p>
5052 <div class="variablelist"><table border="0">
5053 <col align="left" valign="top">
5054 <tbody>
5055 <tr>
5056 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5057 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
5058 </tr>
5059 <tr>
5060 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5061 <td>Specifies which extension OID to send, use zero to get the first one.</td>
5062 </tr>
5063 <tr>
5064 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
5065 <td>a pointer to a structure to hold the OID (may be null)</td>
5066 </tr>
5067 <tr>
5068 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
5069 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
5070 </td>
5071 </tr>
5072 <tr>
5073 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5074 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5075 negative value in case of an error.  If your have reached the
5076 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
5077 will be returned.</td>
5078 </tr>
5079 </tbody>
5080 </table></div>
5081 <p class="since">Since 2.8.0</p>
5082 </div>
5083 <hr>
5084 <div class="refsect2">
5085 <a name="gnutls-x509-crl-get-extension-info"></a><h3>gnutls_x509_crl_get_extension_info ()</h3>
5086 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_extension_info  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5087                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
5088                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
5089                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
5090                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
5091 <p>
5092 This function will return the requested extension OID in the CRL,
5093 and the critical flag for it.  The extension OID will be stored as
5094 a string in the provided buffer.  Use
5095 <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-data" title="gnutls_x509_crl_get_extension_data ()"><code class="function">gnutls_x509_crl_get_extension_data()</code></a> to extract the data.
5096 </p>
5097 <p>
5098 If the buffer provided is not long enough to hold the output, then
5099 *<em class="parameter"><code>sizeof_oid</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be
5100 returned.
5101 </p>
5102 <div class="variablelist"><table border="0">
5103 <col align="left" valign="top">
5104 <tbody>
5105 <tr>
5106 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5107 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
5108 </tr>
5109 <tr>
5110 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5111 <td>Specifies which extension OID to send, use zero to get the first one.</td>
5112 </tr>
5113 <tr>
5114 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
5115 <td>a pointer to a structure to hold the OID</td>
5116 </tr>
5117 <tr>
5118 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
5119 <td>initially holds the maximum size of <em class="parameter"><code>oid</code></em>, on return
5120 holds actual size of <em class="parameter"><code>oid</code></em>.</td>
5121 </tr>
5122 <tr>
5123 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
5124 <td>output variable with critical flag, may be NULL.</td>
5125 </tr>
5126 <tr>
5127 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5128 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5129 negative value in case of an error.  If your have reached the
5130 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
5131 will be returned.</td>
5132 </tr>
5133 </tbody>
5134 </table></div>
5135 <p class="since">Since 2.8.0</p>
5136 </div>
5137 <hr>
5138 <div class="refsect2">
5139 <a name="gnutls-x509-crl-get-extension-data"></a><h3>gnutls_x509_crl_get_extension_data ()</h3>
5140 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_get_extension_data  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5141                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
5142                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
5143                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);</pre>
5144 <p>
5145 This function will return the requested extension data in the CRL.
5146 The extension data will be stored as a string in the provided
5147 buffer.
5148 </p>
5149 <p>
5150 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-info" title="gnutls_x509_crl_get_extension_info ()"><code class="function">gnutls_x509_crl_get_extension_info()</code></a> to extract the OID and
5151 critical flag.  Use <a class="link" href="gnutls-x509.html#gnutls-x509-crl-get-extension-info" title="gnutls_x509_crl_get_extension_info ()"><code class="function">gnutls_x509_crl_get_extension_info()</code></a> instead,
5152 if you want to get data indexed by the extension OID rather than
5153 sequence.
5154 </p>
5155 <div class="variablelist"><table border="0">
5156 <col align="left" valign="top">
5157 <tbody>
5158 <tr>
5159 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5160 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> structure</td>
5161 </tr>
5162 <tr>
5163 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5164 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
5165 </tr>
5166 <tr>
5167 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
5168 <td>a pointer to a structure to hold the data (may be null)</td>
5169 </tr>
5170 <tr>
5171 <td><p><span class="term"><em class="parameter"><code>sizeof_data</code></em> :</span></p></td>
5172 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
5173 </td>
5174 </tr>
5175 <tr>
5176 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5177 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5178 negative value in case of an error.  If your have reached the
5179 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
5180 will be returned.</td>
5181 </tr>
5182 </tbody>
5183 </table></div>
5184 <p class="since">Since 2.8.0</p>
5185 </div>
5186 <hr>
5187 <div class="refsect2">
5188 <a name="gnutls-x509-crl-set-authority-key-id"></a><h3>gnutls_x509_crl_set_authority_key_id ()</h3>
5189 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_authority_key_id
5190                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5191                                                          <em class="parameter"><code>const <span class="type">void</span> *id</code></em>,
5192                                                          <em class="parameter"><code><span class="type">size_t</span> id_size</code></em>);</pre>
5193 <p>
5194 This function will set the CRL's authority key ID extension.  Only
5195 the keyIdentifier field can be set with this function.
5196 </p>
5197 <div class="variablelist"><table border="0">
5198 <col align="left" valign="top">
5199 <tbody>
5200 <tr>
5201 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5202 <td>a CRL of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a>
5203 </td>
5204 </tr>
5205 <tr>
5206 <td><p><span class="term"><em class="parameter"><code>id</code></em> :</span></p></td>
5207 <td>The key ID</td>
5208 </tr>
5209 <tr>
5210 <td><p><span class="term"><em class="parameter"><code>id_size</code></em> :</span></p></td>
5211 <td>Holds the size of the serial field.</td>
5212 </tr>
5213 <tr>
5214 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5215 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5216 negative error value.</td>
5217 </tr>
5218 </tbody>
5219 </table></div>
5220 <p class="since">Since 2.8.0</p>
5221 </div>
5222 <hr>
5223 <div class="refsect2">
5224 <a name="gnutls-x509-crl-set-number"></a><h3>gnutls_x509_crl_set_number ()</h3>
5225 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_set_number          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5226                                                          <em class="parameter"><code>const <span class="type">void</span> *nr</code></em>,
5227                                                          <em class="parameter"><code><span class="type">size_t</span> nr_size</code></em>);</pre>
5228 <p>
5229 This function will set the CRL's number extension.
5230 </p>
5231 <div class="variablelist"><table border="0">
5232 <col align="left" valign="top">
5233 <tbody>
5234 <tr>
5235 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5236 <td>a CRL of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a>
5237 </td>
5238 </tr>
5239 <tr>
5240 <td><p><span class="term"><em class="parameter"><code>nr</code></em> :</span></p></td>
5241 <td>The CRL number</td>
5242 </tr>
5243 <tr>
5244 <td><p><span class="term"><em class="parameter"><code>nr_size</code></em> :</span></p></td>
5245 <td>Holds the size of the nr field.</td>
5246 </tr>
5247 <tr>
5248 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5249 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5250 negative error value.</td>
5251 </tr>
5252 </tbody>
5253 </table></div>
5254 <p class="since">Since 2.8.0</p>
5255 </div>
5256 <hr>
5257 <div class="refsect2">
5258 <a name="gnutls-pkcs7-int"></a><h3>struct gnutls_pkcs7_int</h3>
5259 <pre class="programlisting">struct gnutls_pkcs7_int;</pre>
5260 <p>
5261 </p>
5262 </div>
5263 <hr>
5264 <div class="refsect2">
5265 <a name="gnutls-pkcs7-t"></a><h3>gnutls_pkcs7_t</h3>
5266 <pre class="programlisting">  typedef struct gnutls_pkcs7_int *gnutls_pkcs7_t;
5267 </pre>
5268 <p>
5269 </p>
5270 </div>
5271 <hr>
5272 <div class="refsect2">
5273 <a name="gnutls-pkcs7-init"></a><h3>gnutls_pkcs7_init ()</h3>
5274 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_init                   (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> *pkcs7</code></em>);</pre>
5275 <p>
5276 This function will initialize a PKCS7 structure. PKCS7 structures
5277 usually contain lists of X.509 Certificates and X.509 Certificate
5278 revocation lists.
5279 </p>
5280 <div class="variablelist"><table border="0">
5281 <col align="left" valign="top">
5282 <tbody>
5283 <tr>
5284 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5285 <td>The structure to be initialized</td>
5286 </tr>
5287 <tr>
5288 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5289 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5290 negative error value.</td>
5291 </tr>
5292 </tbody>
5293 </table></div>
5294 </div>
5295 <hr>
5296 <div class="refsect2">
5297 <a name="gnutls-pkcs7-deinit"></a><h3>gnutls_pkcs7_deinit ()</h3>
5298 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_pkcs7_deinit                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);</pre>
5299 <p>
5300 This function will deinitialize a PKCS7 structure.
5301 </p>
5302 <div class="variablelist"><table border="0">
5303 <col align="left" valign="top">
5304 <tbody><tr>
5305 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5306 <td>The structure to be initialized</td>
5307 </tr></tbody>
5308 </table></div>
5309 </div>
5310 <hr>
5311 <div class="refsect2">
5312 <a name="gnutls-pkcs7-import"></a><h3>gnutls_pkcs7_import ()</h3>
5313 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_import                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5314                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
5315                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);</pre>
5316 <p>
5317 This function will convert the given DER or PEM encoded PKCS7 to
5318 the native <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> format.  The output will be stored in
5319 <em class="parameter"><code>pkcs7</code></em>.
5320 </p>
5321 <p>
5322 If the PKCS7 is PEM encoded it should have a header of "PKCS7".
5323 </p>
5324 <div class="variablelist"><table border="0">
5325 <col align="left" valign="top">
5326 <tbody>
5327 <tr>
5328 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5329 <td>The structure to store the parsed PKCS7.</td>
5330 </tr>
5331 <tr>
5332 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
5333 <td>The DER or PEM encoded PKCS7.</td>
5334 </tr>
5335 <tr>
5336 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
5337 <td>One of DER or PEM</td>
5338 </tr>
5339 <tr>
5340 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5341 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5342 negative error value.</td>
5343 </tr>
5344 </tbody>
5345 </table></div>
5346 </div>
5347 <hr>
5348 <div class="refsect2">
5349 <a name="gnutls-pkcs7-export"></a><h3>gnutls_pkcs7_export ()</h3>
5350 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_export                 (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5351                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
5352                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
5353                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
5354 <p>
5355 This function will export the pkcs7 structure to DER or PEM format.
5356 </p>
5357 <p>
5358 If the buffer provided is not long enough to hold the output, then
5359 *<em class="parameter"><code>output_data_size</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a>
5360 will be returned.
5361 </p>
5362 <p>
5363 If the structure is PEM encoded, it will have a header
5364 of "BEGIN PKCS7".
5365 </p>
5366 <div class="variablelist"><table border="0">
5367 <col align="left" valign="top">
5368 <tbody>
5369 <tr>
5370 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5371 <td>Holds the pkcs7 structure</td>
5372 </tr>
5373 <tr>
5374 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
5375 <td>the format of output params. One of PEM or DER.</td>
5376 </tr>
5377 <tr>
5378 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
5379 <td>will contain a structure PEM or DER encoded</td>
5380 </tr>
5381 <tr>
5382 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
5383 <td>holds the size of output_data (and will be
5384 replaced by the actual size of parameters)</td>
5385 </tr>
5386 <tr>
5387 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5388 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5389 negative error value.</td>
5390 </tr>
5391 </tbody>
5392 </table></div>
5393 </div>
5394 <hr>
5395 <div class="refsect2">
5396 <a name="gnutls-pkcs7-get-crt-count"></a><h3>gnutls_pkcs7_get_crt_count ()</h3>
5397 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_get_crt_count          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);</pre>
5398 <p>
5399 This function will return the number of certifcates in the PKCS7
5400 or RFC2630 certificate set.
5401 </p>
5402 <div class="variablelist"><table border="0">
5403 <col align="left" valign="top">
5404 <tbody>
5405 <tr>
5406 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5407 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5408 </tr>
5409 <tr>
5410 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5411 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5412 negative error value.</td>
5413 </tr>
5414 </tbody>
5415 </table></div>
5416 </div>
5417 <hr>
5418 <div class="refsect2">
5419 <a name="gnutls-pkcs7-get-crt-raw"></a><h3>gnutls_pkcs7_get_crt_raw ()</h3>
5420 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_get_crt_raw            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5421                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
5422                                                          <em class="parameter"><code><span class="type">void</span> *certificate</code></em>,
5423                                                          <em class="parameter"><code><span class="type">size_t</span> *certificate_size</code></em>);</pre>
5424 <p>
5425 This function will return a certificate of the PKCS7 or RFC2630
5426 certificate set.
5427 </p>
5428 <p>
5429 After the last certificate has been read
5430 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be returned.
5431 </p>
5432 <div class="variablelist"><table border="0">
5433 <col align="left" valign="top">
5434 <tbody>
5435 <tr>
5436 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5437 <td>should contain a gnutls_pkcs7_t structure</td>
5438 </tr>
5439 <tr>
5440 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5441 <td>contains the index of the certificate to extract</td>
5442 </tr>
5443 <tr>
5444 <td><p><span class="term"><em class="parameter"><code>certificate</code></em> :</span></p></td>
5445 <td>the contents of the certificate will be copied
5446 there (may be null)</td>
5447 </tr>
5448 <tr>
5449 <td><p><span class="term"><em class="parameter"><code>certificate_size</code></em> :</span></p></td>
5450 <td>should hold the size of the certificate</td>
5451 </tr>
5452 <tr>
5453 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5454 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5455 negative error value.  If the provided buffer is not long enough,
5456 then <em class="parameter"><code>certificate_size</code></em> is updated and
5457 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> is returned.</td>
5458 </tr>
5459 </tbody>
5460 </table></div>
5461 </div>
5462 <hr>
5463 <div class="refsect2">
5464 <a name="gnutls-pkcs7-set-crt-raw"></a><h3>gnutls_pkcs7_set_crt_raw ()</h3>
5465 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_set_crt_raw            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5466                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *crt</code></em>);</pre>
5467 <p>
5468 This function will add a certificate to the PKCS7 or RFC2630
5469 certificate set.
5470 </p>
5471 <div class="variablelist"><table border="0">
5472 <col align="left" valign="top">
5473 <tbody>
5474 <tr>
5475 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5476 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5477 </tr>
5478 <tr>
5479 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
5480 <td>the DER encoded certificate to be added</td>
5481 </tr>
5482 <tr>
5483 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5484 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5485 negative error value.</td>
5486 </tr>
5487 </tbody>
5488 </table></div>
5489 </div>
5490 <hr>
5491 <div class="refsect2">
5492 <a name="gnutls-pkcs7-set-crt"></a><h3>gnutls_pkcs7_set_crt ()</h3>
5493 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_set_crt                (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5494                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>);</pre>
5495 <p>
5496 This function will add a parsed certificate to the PKCS7 or
5497 RFC2630 certificate set.  This is a wrapper function over
5498 <a class="link" href="gnutls-x509.html#gnutls-pkcs7-set-crt-raw" title="gnutls_pkcs7_set_crt_raw ()"><code class="function">gnutls_pkcs7_set_crt_raw()</code></a> .
5499 </p>
5500 <div class="variablelist"><table border="0">
5501 <col align="left" valign="top">
5502 <tbody>
5503 <tr>
5504 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5505 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5506 </tr>
5507 <tr>
5508 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
5509 <td>the certificate to be copied.</td>
5510 </tr>
5511 <tr>
5512 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5513 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5514 negative error value.</td>
5515 </tr>
5516 </tbody>
5517 </table></div>
5518 </div>
5519 <hr>
5520 <div class="refsect2">
5521 <a name="gnutls-pkcs7-delete-crt"></a><h3>gnutls_pkcs7_delete_crt ()</h3>
5522 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_delete_crt             (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5523                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>);</pre>
5524 <p>
5525 This function will delete a certificate from a PKCS7 or RFC2630
5526 certificate set.  Index starts from 0. Returns 0 on success.
5527 </p>
5528 <div class="variablelist"><table border="0">
5529 <col align="left" valign="top">
5530 <tbody>
5531 <tr>
5532 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5533 <td>should contain a gnutls_pkcs7_t structure</td>
5534 </tr>
5535 <tr>
5536 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5537 <td>the index of the certificate to delete</td>
5538 </tr>
5539 <tr>
5540 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5541 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5542 negative error value.</td>
5543 </tr>
5544 </tbody>
5545 </table></div>
5546 </div>
5547 <hr>
5548 <div class="refsect2">
5549 <a name="gnutls-pkcs7-get-crl-raw"></a><h3>gnutls_pkcs7_get_crl_raw ()</h3>
5550 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_get_crl_raw            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5551                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
5552                                                          <em class="parameter"><code><span class="type">void</span> *crl</code></em>,
5553                                                          <em class="parameter"><code><span class="type">size_t</span> *crl_size</code></em>);</pre>
5554 <p>
5555 This function will return a crl of the PKCS7 or RFC2630 crl set.
5556 </p>
5557 <div class="variablelist"><table border="0">
5558 <col align="left" valign="top">
5559 <tbody>
5560 <tr>
5561 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5562 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5563 </tr>
5564 <tr>
5565 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5566 <td>contains the index of the crl to extract</td>
5567 </tr>
5568 <tr>
5569 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5570 <td>the contents of the crl will be copied there (may be null)</td>
5571 </tr>
5572 <tr>
5573 <td><p><span class="term"><em class="parameter"><code>crl_size</code></em> :</span></p></td>
5574 <td>should hold the size of the crl</td>
5575 </tr>
5576 <tr>
5577 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5578 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5579 negative error value.  If the provided buffer is not long enough,
5580 then <em class="parameter"><code>crl_size</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> is
5581 returned.  After the last crl has been read
5582 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be returned.</td>
5583 </tr>
5584 </tbody>
5585 </table></div>
5586 </div>
5587 <hr>
5588 <div class="refsect2">
5589 <a name="gnutls-pkcs7-get-crl-count"></a><h3>gnutls_pkcs7_get_crl_count ()</h3>
5590 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_get_crl_count          (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>);</pre>
5591 <p>
5592 This function will return the number of certifcates in the PKCS7
5593 or RFC2630 crl set.
5594 </p>
5595 <div class="variablelist"><table border="0">
5596 <col align="left" valign="top">
5597 <tbody>
5598 <tr>
5599 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5600 <td>should contain a gnutls_pkcs7_t structure</td>
5601 </tr>
5602 <tr>
5603 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5604 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5605 negative error value.</td>
5606 </tr>
5607 </tbody>
5608 </table></div>
5609 </div>
5610 <hr>
5611 <div class="refsect2">
5612 <a name="gnutls-pkcs7-set-crl-raw"></a><h3>gnutls_pkcs7_set_crl_raw ()</h3>
5613 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_set_crl_raw            (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5614                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *crl</code></em>);</pre>
5615 <p>
5616 This function will add a crl to the PKCS7 or RFC2630 crl set.
5617 </p>
5618 <div class="variablelist"><table border="0">
5619 <col align="left" valign="top">
5620 <tbody>
5621 <tr>
5622 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5623 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5624 </tr>
5625 <tr>
5626 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5627 <td>the DER encoded crl to be added</td>
5628 </tr>
5629 <tr>
5630 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5631 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5632 negative error value.</td>
5633 </tr>
5634 </tbody>
5635 </table></div>
5636 </div>
5637 <hr>
5638 <div class="refsect2">
5639 <a name="gnutls-pkcs7-set-crl"></a><h3>gnutls_pkcs7_set_crl ()</h3>
5640 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_set_crl                (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5641                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>);</pre>
5642 <p>
5643 This function will add a parsed CRL to the PKCS7 or RFC2630 crl
5644 set.
5645 </p>
5646 <div class="variablelist"><table border="0">
5647 <col align="left" valign="top">
5648 <tbody>
5649 <tr>
5650 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5651 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5652 </tr>
5653 <tr>
5654 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5655 <td>the DER encoded crl to be added</td>
5656 </tr>
5657 <tr>
5658 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5659 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5660 negative error value.</td>
5661 </tr>
5662 </tbody>
5663 </table></div>
5664 </div>
5665 <hr>
5666 <div class="refsect2">
5667 <a name="gnutls-pkcs7-delete-crl"></a><h3>gnutls_pkcs7_delete_crl ()</h3>
5668 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_pkcs7_delete_crl             (<em class="parameter"><code><a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> pkcs7</code></em>,
5669                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>);</pre>
5670 <p>
5671 This function will delete a crl from a PKCS7 or RFC2630 crl set.
5672 Index starts from 0. Returns 0 on success.
5673 </p>
5674 <div class="variablelist"><table border="0">
5675 <col align="left" valign="top">
5676 <tbody>
5677 <tr>
5678 <td><p><span class="term"><em class="parameter"><code>pkcs7</code></em> :</span></p></td>
5679 <td>should contain a <a class="link" href="gnutls-x509.html#gnutls-pkcs7-t" title="gnutls_pkcs7_t"><span class="type">gnutls_pkcs7_t</span></a> structure</td>
5680 </tr>
5681 <tr>
5682 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
5683 <td>the index of the crl to delete</td>
5684 </tr>
5685 <tr>
5686 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5687 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5688 negative error value.</td>
5689 </tr>
5690 </tbody>
5691 </table></div>
5692 </div>
5693 <hr>
5694 <div class="refsect2">
5695 <a name="gnutls-certificate-verify-flags"></a><h3>enum gnutls_certificate_verify_flags</h3>
5696 <pre class="programlisting">typedef enum {
5697     GNUTLS_VERIFY_DISABLE_CA_SIGN = 1,
5698     GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT = 2,
5699     GNUTLS_VERIFY_DO_NOT_ALLOW_SAME = 4,
5700     GNUTLS_VERIFY_ALLOW_ANY_X509_V1_CA_CRT = 8,
5701     GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2 = 16,
5702     GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5 = 32,
5703     GNUTLS_VERIFY_DISABLE_TIME_CHECKS = 64,
5704     GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS = 128,
5705     GNUTLS_VERIFY_DO_NOT_ALLOW_X509_V1_CA_CRT = 256
5706 } gnutls_certificate_verify_flags;
5707 </pre>
5708 <p>
5709 Enumeration of different certificate verify flags.
5710 </p>
5711 <div class="variablelist"><table border="0">
5712 <col align="left" valign="top">
5713 <tbody>
5714 <tr>
5715 <td><p><a name="GNUTLS-VERIFY-DISABLE-CA-SIGN:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_DISABLE_CA_SIGN</code></span></p></td>
5716 <td>If set a signer does not have to be
5717   a certificate authority. This flag should normaly be disabled,
5718   unless you know what this means.
5719 </td>
5720 </tr>
5721 <tr>
5722 <td><p><a name="GNUTLS-VERIFY-ALLOW-X509-V1-CA-CRT:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT</code></span></p></td>
5723 <td>Allow trusted CA
5724   certificates that have version 1.  This is the default.
5725 </td>
5726 </tr>
5727 <tr>
5728 <td><p><a name="GNUTLS-VERIFY-DO-NOT-ALLOW-SAME:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_DO_NOT_ALLOW_SAME</code></span></p></td>
5729 <td>If a certificate is not signed by
5730   anyone trusted but exists in the trusted CA list do not treat it
5731   as trusted.
5732 </td>
5733 </tr>
5734 <tr>
5735 <td><p><a name="GNUTLS-VERIFY-ALLOW-ANY-X509-V1-CA-CRT:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_ALLOW_ANY_X509_V1_CA_CRT</code></span></p></td>
5736 <td>Allow CA certificates that
5737   have version 1 (both root and intermediate). This might be
5738   dangerous since those haven't the basicConstraints
5739   extension. Must be used in combination with
5740   <a class="link" href="gnutls-x509.html#GNUTLS-VERIFY-ALLOW-X509-V1-CA-CRT:CAPS"><code class="literal">GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT</code></a>.
5741 </td>
5742 </tr>
5743 <tr>
5744 <td><p><a name="GNUTLS-VERIFY-ALLOW-SIGN-RSA-MD2:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2</code></span></p></td>
5745 <td>Allow certificates to be signed
5746   using the broken MD2 algorithm.
5747 </td>
5748 </tr>
5749 <tr>
5750 <td><p><a name="GNUTLS-VERIFY-ALLOW-SIGN-RSA-MD5:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5</code></span></p></td>
5751 <td>Allow certificates to be signed
5752   using the broken MD5 algorithm.
5753 </td>
5754 </tr>
5755 <tr>
5756 <td><p><a name="GNUTLS-VERIFY-DISABLE-TIME-CHECKS:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_DISABLE_TIME_CHECKS</code></span></p></td>
5757 <td>Disable checking of activation
5758   and expiration validity periods of certificate chains. Don't set
5759   this unless you understand the security implications.
5760 </td>
5761 </tr>
5762 <tr>
5763 <td><p><a name="GNUTLS-VERIFY-DISABLE-TRUSTED-TIME-CHECKS:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_DISABLE_TRUSTED_TIME_CHECKS</code></span></p></td>
5764 <td>If set a signer in the trusted
5765   list is never checked for expiration or activation.
5766 </td>
5767 </tr>
5768 <tr>
5769 <td><p><a name="GNUTLS-VERIFY-DO-NOT-ALLOW-X509-V1-CA-CRT:CAPS"></a><span class="term"><code class="literal">GNUTLS_VERIFY_DO_NOT_ALLOW_X509_V1_CA_CRT</code></span></p></td>
5770 <td>Do not allow trusted CA
5771   certificates that have version 1.  This option is to be used
5772   to deprecate all V1 certificates.
5773 </td>
5774 </tr>
5775 </tbody>
5776 </table></div>
5777 </div>
5778 <hr>
5779 <div class="refsect2">
5780 <a name="gnutls-x509-crt-check-issuer"></a><h3>gnutls_x509_crt_check_issuer ()</h3>
5781 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_check_issuer        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
5782                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> issuer</code></em>);</pre>
5783 <p>
5784 This function will check if the given certificate was issued by the
5785 given issuer.
5786 </p>
5787 <div class="variablelist"><table border="0">
5788 <col align="left" valign="top">
5789 <tbody>
5790 <tr>
5791 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
5792 <td>is the certificate to be checked</td>
5793 </tr>
5794 <tr>
5795 <td><p><span class="term"><em class="parameter"><code>issuer</code></em> :</span></p></td>
5796 <td>is the certificate of a possible issuer</td>
5797 </tr>
5798 <tr>
5799 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5800 <td>It will return true (1) if the given certificate is issued
5801 by the given issuer, and false (0) if not.  A negative value is
5802 returned in case of an error.</td>
5803 </tr>
5804 </tbody>
5805 </table></div>
5806 </div>
5807 <hr>
5808 <div class="refsect2">
5809 <a name="gnutls-x509-crt-list-verify"></a><h3>gnutls_x509_crt_list_verify ()</h3>
5810 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_list_verify         (<em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *cert_list</code></em>,
5811                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> cert_list_length</code></em>,
5812                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
5813                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
5814                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *CRL_list</code></em>,
5815                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CRL_list_length</code></em>,
5816                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
5817                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);</pre>
5818 <p>
5819 This function will try to verify the given certificate list and
5820 return its status.  If no flags are specified (0), this function
5821 will use the basicConstraints (2.5.29.19) PKIX extension. This
5822 means that only a certificate authority is allowed to sign a
5823 certificate.
5824 </p>
5825 <p>
5826 You must also check the peer's name in order to check if the verified
5827 certificate belongs to the actual peer.
5828 </p>
5829 <p>
5830 The certificate verification output will be put in <em class="parameter"><code>verify</code></em> and will
5831 be one or more of the gnutls_certificate_status_t enumerated
5832 elements bitwise or'd.  For a more detailed verification status use
5833 <a class="link" href="gnutls-x509.html#gnutls-x509-crt-verify" title="gnutls_x509_crt_verify ()"><code class="function">gnutls_x509_crt_verify()</code></a> per list element.
5834 </p>
5835 <p>
5836 GNUTLS_CERT_INVALID: the certificate chain is not valid.
5837 </p>
5838 <p>
5839 GNUTLS_CERT_REVOKED: a certificate in the chain has been revoked.
5840 </p>
5841 <div class="variablelist"><table border="0">
5842 <col align="left" valign="top">
5843 <tbody>
5844 <tr>
5845 <td><p><span class="term"><em class="parameter"><code>cert_list</code></em> :</span></p></td>
5846 <td>is the certificate list to be verified</td>
5847 </tr>
5848 <tr>
5849 <td><p><span class="term"><em class="parameter"><code>cert_list_length</code></em> :</span></p></td>
5850 <td>holds the number of certificate in cert_list</td>
5851 </tr>
5852 <tr>
5853 <td><p><span class="term"><em class="parameter"><code>CA_list</code></em> :</span></p></td>
5854 <td>is the CA list which will be used in verification</td>
5855 </tr>
5856 <tr>
5857 <td><p><span class="term"><em class="parameter"><code>CA_list_length</code></em> :</span></p></td>
5858 <td>holds the number of CA certificate in CA_list</td>
5859 </tr>
5860 <tr>
5861 <td><p><span class="term"><em class="parameter"><code>CRL_list</code></em> :</span></p></td>
5862 <td>holds a list of CRLs.</td>
5863 </tr>
5864 <tr>
5865 <td><p><span class="term"><em class="parameter"><code>CRL_list_length</code></em> :</span></p></td>
5866 <td>the length of CRL list.</td>
5867 </tr>
5868 <tr>
5869 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
5870 <td>Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.</td>
5871 </tr>
5872 <tr>
5873 <td><p><span class="term"><em class="parameter"><code>verify</code></em> :</span></p></td>
5874 <td>will hold the certificate verification output.</td>
5875 </tr>
5876 <tr>
5877 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5878 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5879 negative error value.</td>
5880 </tr>
5881 </tbody>
5882 </table></div>
5883 </div>
5884 <hr>
5885 <div class="refsect2">
5886 <a name="gnutls-x509-crt-verify"></a><h3>gnutls_x509_crt_verify ()</h3>
5887 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_verify              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
5888                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
5889                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
5890                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
5891                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);</pre>
5892 <p>
5893 This function will try to verify the given certificate and return
5894 its status.
5895 </p>
5896 <div class="variablelist"><table border="0">
5897 <col align="left" valign="top">
5898 <tbody>
5899 <tr>
5900 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
5901 <td>is the certificate to be verified</td>
5902 </tr>
5903 <tr>
5904 <td><p><span class="term"><em class="parameter"><code>CA_list</code></em> :</span></p></td>
5905 <td>is one certificate that is considered to be trusted one</td>
5906 </tr>
5907 <tr>
5908 <td><p><span class="term"><em class="parameter"><code>CA_list_length</code></em> :</span></p></td>
5909 <td>holds the number of CA certificate in CA_list</td>
5910 </tr>
5911 <tr>
5912 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
5913 <td>Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.</td>
5914 </tr>
5915 <tr>
5916 <td><p><span class="term"><em class="parameter"><code>verify</code></em> :</span></p></td>
5917 <td>will hold the certificate verification output.</td>
5918 </tr>
5919 <tr>
5920 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5921 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5922 negative error value.</td>
5923 </tr>
5924 </tbody>
5925 </table></div>
5926 </div>
5927 <hr>
5928 <div class="refsect2">
5929 <a name="gnutls-x509-crl-verify"></a><h3>gnutls_x509_crl_verify ()</h3>
5930 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crl_verify              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> crl</code></em>,
5931                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> *CA_list</code></em>,
5932                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> CA_list_length</code></em>,
5933                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
5934                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *verify</code></em>);</pre>
5935 <p>
5936 This function will try to verify the given crl and return its status.
5937 See <a class="link" href="gnutls-x509.html#gnutls-x509-crt-list-verify" title="gnutls_x509_crt_list_verify ()"><code class="function">gnutls_x509_crt_list_verify()</code></a> for a detailed description of
5938 return values.
5939 </p>
5940 <div class="variablelist"><table border="0">
5941 <col align="left" valign="top">
5942 <tbody>
5943 <tr>
5944 <td><p><span class="term"><em class="parameter"><code>crl</code></em> :</span></p></td>
5945 <td>is the crl to be verified</td>
5946 </tr>
5947 <tr>
5948 <td><p><span class="term"><em class="parameter"><code>CA_list</code></em> :</span></p></td>
5949 <td>is a certificate list that is considered to be trusted one</td>
5950 </tr>
5951 <tr>
5952 <td><p><span class="term"><em class="parameter"><code>CA_list_length</code></em> :</span></p></td>
5953 <td>holds the number of CA certificates in CA_list</td>
5954 </tr>
5955 <tr>
5956 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
5957 <td>Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.</td>
5958 </tr>
5959 <tr>
5960 <td><p><span class="term"><em class="parameter"><code>verify</code></em> :</span></p></td>
5961 <td>will hold the crl verification output.</td>
5962 </tr>
5963 <tr>
5964 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5965 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
5966 negative error value.</td>
5967 </tr>
5968 </tbody>
5969 </table></div>
5970 </div>
5971 <hr>
5972 <div class="refsect2">
5973 <a name="gnutls-x509-crt-check-revocation"></a><h3>gnutls_x509_crt_check_revocation ()</h3>
5974 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_check_revocation    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
5975                                                          <em class="parameter"><code>const <a class="link" href="gnutls-gnutls.html#gnutls-x509-crl-t" title="gnutls_x509_crl_t"><span class="type">gnutls_x509_crl_t</span></a> *crl_list</code></em>,
5976                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> crl_list_length</code></em>);</pre>
5977 <p>
5978 This function will return check if the given certificate is
5979 revoked.  It is assumed that the CRLs have been verified before.
5980 </p>
5981 <div class="variablelist"><table border="0">
5982 <col align="left" valign="top">
5983 <tbody>
5984 <tr>
5985 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
5986 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
5987 </tr>
5988 <tr>
5989 <td><p><span class="term"><em class="parameter"><code>crl_list</code></em> :</span></p></td>
5990 <td>should contain a list of gnutls_x509_crl_t structures</td>
5991 </tr>
5992 <tr>
5993 <td><p><span class="term"><em class="parameter"><code>crl_list_length</code></em> :</span></p></td>
5994 <td>the length of the crl_list</td>
5995 </tr>
5996 <tr>
5997 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
5998 <td>0 if the certificate is NOT revoked, and 1 if it is.  A
5999 negative value is returned on error.</td>
6000 </tr>
6001 </tbody>
6002 </table></div>
6003 </div>
6004 <hr>
6005 <div class="refsect2">
6006 <a name="gnutls-x509-crt-get-fingerprint"></a><h3>gnutls_x509_crt_get_fingerprint ()</h3>
6007 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_fingerprint     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
6008                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-digest-algorithm-t" title="enum gnutls_digest_algorithm_t"><span class="type">gnutls_digest_algorithm_t</span></a> algo</code></em>,
6009                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
6010                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
6011 <p>
6012 This function will calculate and copy the certificate's fingerprint
6013 in the provided buffer.
6014 </p>
6015 <p>
6016 If the buffer is null then only the size will be filled.
6017 </p>
6018 <div class="variablelist"><table border="0">
6019 <col align="left" valign="top">
6020 <tbody>
6021 <tr>
6022 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
6023 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
6024 </tr>
6025 <tr>
6026 <td><p><span class="term"><em class="parameter"><code>algo</code></em> :</span></p></td>
6027 <td>is a digest algorithm</td>
6028 </tr>
6029 <tr>
6030 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
6031 <td>a pointer to a structure to hold the fingerprint (may be null)</td>
6032 </tr>
6033 <tr>
6034 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
6035 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
6036 </td>
6037 </tr>
6038 <tr>
6039 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6040 <td>
6041 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
6042 not long enough, and in that case the *sizeof_buf will be updated
6043 with the required size.  On success 0 is returned.</td>
6044 </tr>
6045 </tbody>
6046 </table></div>
6047 </div>
6048 <hr>
6049 <div class="refsect2">
6050 <a name="gnutls-x509-crt-get-key-purpose-oid"></a><h3>gnutls_x509_crt_get_key_purpose_oid ()</h3>
6051 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_get_key_purpose_oid (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
6052                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
6053                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
6054                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
6055                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
6056 <p>
6057 This function will extract the key purpose OIDs of the Certificate
6058 specified by the given index.  These are stored in the Extended Key
6059 Usage extension (2.5.29.37) See the GNUTLS_KP_* definitions for
6060 human readable names.
6061 </p>
6062 <p>
6063 If <em class="parameter"><code>oid</code></em> is null then only the size will be filled.
6064 </p>
6065 <div class="variablelist"><table border="0">
6066 <col align="left" valign="top">
6067 <tbody>
6068 <tr>
6069 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
6070 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> structure</td>
6071 </tr>
6072 <tr>
6073 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
6074 <td>This specifies which OID to return. Use zero to get the first one.</td>
6075 </tr>
6076 <tr>
6077 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
6078 <td>a pointer to a buffer to hold the OID (may be null)</td>
6079 </tr>
6080 <tr>
6081 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
6082 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
6083 </td>
6084 </tr>
6085 <tr>
6086 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
6087 <td>output flag to indicate criticality of extension</td>
6088 </tr>
6089 <tr>
6090 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6091 <td>
6092 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
6093 not long enough, and in that case the *sizeof_oid will be updated
6094 with the required size.  On success 0 is returned.</td>
6095 </tr>
6096 </tbody>
6097 </table></div>
6098 </div>
6099 <hr>
6100 <div class="refsect2">
6101 <a name="gnutls-x509-crt-set-key-purpose-oid"></a><h3>gnutls_x509_crt_set_key_purpose_oid ()</h3>
6102 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_key_purpose_oid (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> cert</code></em>,
6103                                                          <em class="parameter"><code>const <span class="type">void</span> *oid</code></em>,
6104                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);</pre>
6105 <p>
6106 This function will set the key purpose OIDs of the Certificate.
6107 These are stored in the Extended Key Usage extension (2.5.29.37)
6108 See the GNUTLS_KP_* definitions for human readable names.
6109 </p>
6110 <p>
6111 Subsequent calls to this function will append OIDs to the OID list.
6112 </p>
6113 <div class="variablelist"><table border="0">
6114 <col align="left" valign="top">
6115 <tbody>
6116 <tr>
6117 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
6118 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
6119 </td>
6120 </tr>
6121 <tr>
6122 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
6123 <td>a pointer to a null terminated string that holds the OID</td>
6124 </tr>
6125 <tr>
6126 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
6127 <td>Whether this extension will be critical or not</td>
6128 </tr>
6129 <tr>
6130 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6131 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> (zero) is returned,
6132 otherwise an error code is returned.</td>
6133 </tr>
6134 </tbody>
6135 </table></div>
6136 </div>
6137 <hr>
6138 <div class="refsect2">
6139 <a name="gnutls-pkcs-encrypt-flags-t"></a><h3>enum gnutls_pkcs_encrypt_flags_t</h3>
6140 <pre class="programlisting">typedef enum {
6141     GNUTLS_PKCS_PLAIN = 1,
6142     GNUTLS_PKCS8_PLAIN = GNUTLS_PKCS_PLAIN,
6143     GNUTLS_PKCS_USE_PKCS12_3DES = 2,
6144     GNUTLS_PKCS8_USE_PKCS12_3DES = GNUTLS_PKCS_USE_PKCS12_3DES,
6145     GNUTLS_PKCS_USE_PKCS12_ARCFOUR = 4,
6146     GNUTLS_PKCS8_USE_PKCS12_ARCFOUR = GNUTLS_PKCS_USE_PKCS12_ARCFOUR,
6147     GNUTLS_PKCS_USE_PKCS12_RC2_40 = 8,
6148     GNUTLS_PKCS8_USE_PKCS12_RC2_40 = GNUTLS_PKCS_USE_PKCS12_RC2_40,
6149     GNUTLS_PKCS_USE_PBES2_3DES = 16,
6150     GNUTLS_PKCS_USE_PBES2_AES_128 = 32,
6151     GNUTLS_PKCS_USE_PBES2_AES_192 = 64,
6152     GNUTLS_PKCS_USE_PBES2_AES_256 = 128
6153 } gnutls_pkcs_encrypt_flags_t;
6154 </pre>
6155 <p>
6156 Enumeration of different PKCS encryption flags.
6157 </p>
6158 <div class="variablelist"><table border="0">
6159 <col align="left" valign="top">
6160 <tbody>
6161 <tr>
6162 <td><p><a name="GNUTLS-PKCS-PLAIN:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_PLAIN</code></span></p></td>
6163 <td>Unencrypted private key.
6164 </td>
6165 </tr>
6166 <tr>
6167 <td><p><a name="GNUTLS-PKCS8-PLAIN:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS8_PLAIN</code></span></p></td>
6168 <td>Same as <a class="link" href="gnutls-x509.html#GNUTLS-PKCS-PLAIN:CAPS"><code class="literal">GNUTLS_PKCS_PLAIN</code></a>.
6169 </td>
6170 </tr>
6171 <tr>
6172 <td><p><a name="GNUTLS-PKCS-USE-PKCS12-3DES:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PKCS12_3DES</code></span></p></td>
6173 <td>PKCS-12 3DES.
6174 </td>
6175 </tr>
6176 <tr>
6177 <td><p><a name="GNUTLS-PKCS8-USE-PKCS12-3DES:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS8_USE_PKCS12_3DES</code></span></p></td>
6178 <td>Same as <a class="link" href="gnutls-x509.html#GNUTLS-PKCS-USE-PKCS12-3DES:CAPS"><code class="literal">GNUTLS_PKCS_USE_PKCS12_3DES</code></a>.
6179 </td>
6180 </tr>
6181 <tr>
6182 <td><p><a name="GNUTLS-PKCS-USE-PKCS12-ARCFOUR:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PKCS12_ARCFOUR</code></span></p></td>
6183 <td>PKCS-12 ARCFOUR.
6184 </td>
6185 </tr>
6186 <tr>
6187 <td><p><a name="GNUTLS-PKCS8-USE-PKCS12-ARCFOUR:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS8_USE_PKCS12_ARCFOUR</code></span></p></td>
6188 <td>Same as <a class="link" href="gnutls-x509.html#GNUTLS-PKCS-USE-PKCS12-ARCFOUR:CAPS"><code class="literal">GNUTLS_PKCS_USE_PKCS12_ARCFOUR</code></a>.
6189 </td>
6190 </tr>
6191 <tr>
6192 <td><p><a name="GNUTLS-PKCS-USE-PKCS12-RC2-40:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PKCS12_RC2_40</code></span></p></td>
6193 <td>PKCS-12 RC2-40.
6194 </td>
6195 </tr>
6196 <tr>
6197 <td><p><a name="GNUTLS-PKCS8-USE-PKCS12-RC2-40:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS8_USE_PKCS12_RC2_40</code></span></p></td>
6198 <td>Same as <a class="link" href="gnutls-x509.html#GNUTLS-PKCS-USE-PKCS12-RC2-40:CAPS"><code class="literal">GNUTLS_PKCS_USE_PKCS12_RC2_40</code></a>.
6199 </td>
6200 </tr>
6201 <tr>
6202 <td><p><a name="GNUTLS-PKCS-USE-PBES2-3DES:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PBES2_3DES</code></span></p></td>
6203 <td>PBES2 3DES.
6204 </td>
6205 </tr>
6206 <tr>
6207 <td><p><a name="GNUTLS-PKCS-USE-PBES2-AES-128:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PBES2_AES_128</code></span></p></td>
6208 <td>PBES2 AES-128.
6209 </td>
6210 </tr>
6211 <tr>
6212 <td><p><a name="GNUTLS-PKCS-USE-PBES2-AES-192:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PBES2_AES_192</code></span></p></td>
6213 <td>PBES2 AES-192.
6214 </td>
6215 </tr>
6216 <tr>
6217 <td><p><a name="GNUTLS-PKCS-USE-PBES2-AES-256:CAPS"></a><span class="term"><code class="literal">GNUTLS_PKCS_USE_PBES2_AES_256</code></span></p></td>
6218 <td>PBES2 AES-256.
6219 </td>
6220 </tr>
6221 </tbody>
6222 </table></div>
6223 </div>
6224 <hr>
6225 <div class="refsect2">
6226 <a name="gnutls-x509-privkey-init"></a><h3>gnutls_x509_privkey_init ()</h3>
6227 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_init            (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> *key</code></em>);</pre>
6228 <p>
6229 This function will initialize an private key structure.
6230 </p>
6231 <div class="variablelist"><table border="0">
6232 <col align="left" valign="top">
6233 <tbody>
6234 <tr>
6235 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6236 <td>The structure to be initialized</td>
6237 </tr>
6238 <tr>
6239 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6240 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6241 negative error value.</td>
6242 </tr>
6243 </tbody>
6244 </table></div>
6245 </div>
6246 <hr>
6247 <div class="refsect2">
6248 <a name="gnutls-x509-privkey-deinit"></a><h3>gnutls_x509_privkey_deinit ()</h3>
6249 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_x509_privkey_deinit          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
6250 <p>
6251 This function will deinitialize a private key structure.
6252 </p>
6253 <div class="variablelist"><table border="0">
6254 <col align="left" valign="top">
6255 <tbody><tr>
6256 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6257 <td>The structure to be deinitialized</td>
6258 </tr></tbody>
6259 </table></div>
6260 </div>
6261 <hr>
6262 <div class="refsect2">
6263 <a name="gnutls-x509-privkey-sec-param"></a><h3>gnutls_x509_privkey_sec_param ()</h3>
6264 <pre class="programlisting"><a class="link" href="gnutls-gnutls.html#gnutls-sec-param-t" title="enum gnutls_sec_param_t"><span class="returnvalue">gnutls_sec_param_t</span></a>  gnutls_x509_privkey_sec_param       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
6265 <p>
6266 This function will return the security parameter appropriate with
6267 this private key.
6268 </p>
6269 <div class="variablelist"><table border="0">
6270 <col align="left" valign="top">
6271 <tbody>
6272 <tr>
6273 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6274 <td>a key structure</td>
6275 </tr>
6276 <tr>
6277 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6278 <td>On success, a valid security parameter is returned otherwise
6279 <a class="link" href="gnutls-gnutls.html#GNUTLS-SEC-PARAM-UNKNOWN:CAPS"><code class="literal">GNUTLS_SEC_PARAM_UNKNOWN</code></a> is returned.</td>
6280 </tr>
6281 </tbody>
6282 </table></div>
6283 </div>
6284 <hr>
6285 <div class="refsect2">
6286 <a name="gnutls-x509-privkey-cpy"></a><h3>gnutls_x509_privkey_cpy ()</h3>
6287 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_cpy             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> dst</code></em>,
6288                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> src</code></em>);</pre>
6289 <p>
6290 This function will copy a private key from source to destination
6291 key. Destination has to be initialized.
6292 </p>
6293 <div class="variablelist"><table border="0">
6294 <col align="left" valign="top">
6295 <tbody>
6296 <tr>
6297 <td><p><span class="term"><em class="parameter"><code>dst</code></em> :</span></p></td>
6298 <td>The destination key, which should be initialized.</td>
6299 </tr>
6300 <tr>
6301 <td><p><span class="term"><em class="parameter"><code>src</code></em> :</span></p></td>
6302 <td>The source key</td>
6303 </tr>
6304 <tr>
6305 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6306 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6307 negative error value.</td>
6308 </tr>
6309 </tbody>
6310 </table></div>
6311 </div>
6312 <hr>
6313 <div class="refsect2">
6314 <a name="gnutls-x509-privkey-import"></a><h3>gnutls_x509_privkey_import ()</h3>
6315 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_import          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6316                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
6317                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);</pre>
6318 <p>
6319 This function will convert the given DER or PEM encoded key to the
6320 native <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> format. The output will be stored in
6321 <em class="parameter"><code>key</code></em> .
6322 </p>
6323 <p>
6324 If the key is PEM encoded it should have a header of "RSA PRIVATE
6325 KEY", or "DSA PRIVATE KEY".
6326 </p>
6327 <div class="variablelist"><table border="0">
6328 <col align="left" valign="top">
6329 <tbody>
6330 <tr>
6331 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6332 <td>The structure to store the parsed key</td>
6333 </tr>
6334 <tr>
6335 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
6336 <td>The DER or PEM encoded certificate.</td>
6337 </tr>
6338 <tr>
6339 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
6340 <td>One of DER or PEM</td>
6341 </tr>
6342 <tr>
6343 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6344 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6345 negative error value.</td>
6346 </tr>
6347 </tbody>
6348 </table></div>
6349 </div>
6350 <hr>
6351 <div class="refsect2">
6352 <a name="gnutls-x509-privkey-import-pkcs8"></a><h3>gnutls_x509_privkey_import_pkcs8 ()</h3>
6353 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_import_pkcs8    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6354                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
6355                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
6356                                                          <em class="parameter"><code>const <span class="type">char</span> *password</code></em>,
6357                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
6358 <p>
6359 This function will convert the given DER or PEM encoded PKCS8 2.0
6360 encrypted key to the native gnutls_x509_privkey_t format. The
6361 output will be stored in <em class="parameter"><code>key</code></em>.  Both RSA and DSA keys can be
6362 imported, and flags can only be used to indicate an unencrypted
6363 key.
6364 </p>
6365 <p>
6366 The <em class="parameter"><code>password</code></em> can be either ASCII or UTF-8 in the default PBES2
6367 encryption schemas, or ASCII for the PKCS12 schemas.
6368 </p>
6369 <p>
6370 If the Certificate is PEM encoded it should have a header of
6371 "ENCRYPTED PRIVATE KEY", or "PRIVATE KEY". You only need to
6372 specify the flags if the key is DER encoded, since in that case
6373 the encryption status cannot be auto-detected.
6374 </p>
6375 <div class="variablelist"><table border="0">
6376 <col align="left" valign="top">
6377 <tbody>
6378 <tr>
6379 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6380 <td>The structure to store the parsed key</td>
6381 </tr>
6382 <tr>
6383 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
6384 <td>The DER or PEM encoded key.</td>
6385 </tr>
6386 <tr>
6387 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
6388 <td>One of DER or PEM</td>
6389 </tr>
6390 <tr>
6391 <td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
6392 <td>the password to decrypt the key (if it is encrypted).</td>
6393 </tr>
6394 <tr>
6395 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
6396 <td>0 if encrypted or GNUTLS_PKCS_PLAIN if not encrypted.</td>
6397 </tr>
6398 <tr>
6399 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6400 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6401 negative error value.</td>
6402 </tr>
6403 </tbody>
6404 </table></div>
6405 </div>
6406 <hr>
6407 <div class="refsect2">
6408 <a name="gnutls-x509-privkey-import-rsa-raw"></a><h3>gnutls_x509_privkey_import_rsa_raw ()</h3>
6409 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_import_rsa_raw  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6410                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
6411                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>,
6412                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *d</code></em>,
6413                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
6414                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
6415                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *u</code></em>);</pre>
6416 <p>
6417 This function will convert the given RSA raw parameters to the
6418 native <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> format.  The output will be stored in
6419 <em class="parameter"><code>key</code></em>.
6420 </p>
6421 <div class="variablelist"><table border="0">
6422 <col align="left" valign="top">
6423 <tbody>
6424 <tr>
6425 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6426 <td>The structure to store the parsed key</td>
6427 </tr>
6428 <tr>
6429 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
6430 <td>holds the modulus</td>
6431 </tr>
6432 <tr>
6433 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
6434 <td>holds the public exponent</td>
6435 </tr>
6436 <tr>
6437 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
6438 <td>holds the private exponent</td>
6439 </tr>
6440 <tr>
6441 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6442 <td>holds the first prime (p)</td>
6443 </tr>
6444 <tr>
6445 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6446 <td>holds the second prime (q)</td>
6447 </tr>
6448 <tr>
6449 <td><p><span class="term"><em class="parameter"><code>u</code></em> :</span></p></td>
6450 <td>holds the coefficient</td>
6451 </tr>
6452 <tr>
6453 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6454 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6455 negative error value.</td>
6456 </tr>
6457 </tbody>
6458 </table></div>
6459 </div>
6460 <hr>
6461 <div class="refsect2">
6462 <a name="gnutls-x509-privkey-import-rsa-raw2"></a><h3>gnutls_x509_privkey_import_rsa_raw2 ()</h3>
6463 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_import_rsa_raw2 (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6464                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
6465                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>,
6466                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *d</code></em>,
6467                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
6468                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
6469                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *u</code></em>,
6470                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e1</code></em>,
6471                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e2</code></em>);</pre>
6472 <p>
6473 This function will convert the given RSA raw parameters to the
6474 native <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> format.  The output will be stored in
6475 <em class="parameter"><code>key</code></em>.
6476 </p>
6477 <div class="variablelist"><table border="0">
6478 <col align="left" valign="top">
6479 <tbody>
6480 <tr>
6481 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6482 <td>The structure to store the parsed key</td>
6483 </tr>
6484 <tr>
6485 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
6486 <td>holds the modulus</td>
6487 </tr>
6488 <tr>
6489 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
6490 <td>holds the public exponent</td>
6491 </tr>
6492 <tr>
6493 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
6494 <td>holds the private exponent</td>
6495 </tr>
6496 <tr>
6497 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6498 <td>holds the first prime (p)</td>
6499 </tr>
6500 <tr>
6501 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6502 <td>holds the second prime (q)</td>
6503 </tr>
6504 <tr>
6505 <td><p><span class="term"><em class="parameter"><code>u</code></em> :</span></p></td>
6506 <td>holds the coefficient</td>
6507 </tr>
6508 <tr>
6509 <td><p><span class="term"><em class="parameter"><code>e1</code></em> :</span></p></td>
6510 <td>holds e1 = d mod (p-1)</td>
6511 </tr>
6512 <tr>
6513 <td><p><span class="term"><em class="parameter"><code>e2</code></em> :</span></p></td>
6514 <td>holds e2 = d mod (q-1)</td>
6515 </tr>
6516 <tr>
6517 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6518 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6519 negative error value.</td>
6520 </tr>
6521 </tbody>
6522 </table></div>
6523 </div>
6524 <hr>
6525 <div class="refsect2">
6526 <a name="gnutls-x509-privkey-fix"></a><h3>gnutls_x509_privkey_fix ()</h3>
6527 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_fix             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
6528 <p>
6529 This function will recalculate the secondary parameters in a key.
6530 In RSA keys, this can be the coefficient and exponent1,2.
6531 </p>
6532 <div class="variablelist"><table border="0">
6533 <col align="left" valign="top">
6534 <tbody>
6535 <tr>
6536 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6537 <td>Holds the key</td>
6538 </tr>
6539 <tr>
6540 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6541 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6542 negative error value.</td>
6543 </tr>
6544 </tbody>
6545 </table></div>
6546 </div>
6547 <hr>
6548 <div class="refsect2">
6549 <a name="gnutls-x509-privkey-export-dsa-raw"></a><h3>gnutls_x509_privkey_export_dsa_raw ()</h3>
6550 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_export_dsa_raw  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6551                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
6552                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
6553                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *g</code></em>,
6554                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *y</code></em>,
6555                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *x</code></em>);</pre>
6556 <p>
6557 This function will export the DSA private key's parameters found
6558 in the given structure. The new parameters will be allocated using
6559 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
6560 </p>
6561 <div class="variablelist"><table border="0">
6562 <col align="left" valign="top">
6563 <tbody>
6564 <tr>
6565 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6566 <td>a structure that holds the DSA parameters</td>
6567 </tr>
6568 <tr>
6569 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6570 <td>will hold the p</td>
6571 </tr>
6572 <tr>
6573 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6574 <td>will hold the q</td>
6575 </tr>
6576 <tr>
6577 <td><p><span class="term"><em class="parameter"><code>g</code></em> :</span></p></td>
6578 <td>will hold the g</td>
6579 </tr>
6580 <tr>
6581 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
6582 <td>will hold the y</td>
6583 </tr>
6584 <tr>
6585 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
6586 <td>will hold the x</td>
6587 </tr>
6588 <tr>
6589 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6590 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6591 negative error value.</td>
6592 </tr>
6593 </tbody>
6594 </table></div>
6595 </div>
6596 <hr>
6597 <div class="refsect2">
6598 <a name="gnutls-x509-privkey-import-dsa-raw"></a><h3>gnutls_x509_privkey_import_dsa_raw ()</h3>
6599 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_import_dsa_raw  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6600                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *p</code></em>,
6601                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *q</code></em>,
6602                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *g</code></em>,
6603                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *y</code></em>,
6604                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *x</code></em>);</pre>
6605 <p>
6606 This function will convert the given DSA raw parameters to the
6607 native <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> format.  The output will be stored
6608 in <em class="parameter"><code>key</code></em>.
6609 </p>
6610 <div class="variablelist"><table border="0">
6611 <col align="left" valign="top">
6612 <tbody>
6613 <tr>
6614 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6615 <td>The structure to store the parsed key</td>
6616 </tr>
6617 <tr>
6618 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6619 <td>holds the p</td>
6620 </tr>
6621 <tr>
6622 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6623 <td>holds the q</td>
6624 </tr>
6625 <tr>
6626 <td><p><span class="term"><em class="parameter"><code>g</code></em> :</span></p></td>
6627 <td>holds the g</td>
6628 </tr>
6629 <tr>
6630 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
6631 <td>holds the y</td>
6632 </tr>
6633 <tr>
6634 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
6635 <td>holds the x</td>
6636 </tr>
6637 <tr>
6638 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6639 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6640 negative error value.</td>
6641 </tr>
6642 </tbody>
6643 </table></div>
6644 </div>
6645 <hr>
6646 <div class="refsect2">
6647 <a name="gnutls-x509-privkey-get-pk-algorithm"></a><h3>gnutls_x509_privkey_get_pk_algorithm ()</h3>
6648 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_get_pk_algorithm
6649                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
6650 <p>
6651 This function will return the public key algorithm of a private
6652 key.
6653 </p>
6654 <div class="variablelist"><table border="0">
6655 <col align="left" valign="top">
6656 <tbody>
6657 <tr>
6658 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6659 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> structure</td>
6660 </tr>
6661 <tr>
6662 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6663 <td>a member of the <a class="link" href="gnutls-gnutls.html#gnutls-pk-algorithm-t" title="enum gnutls_pk_algorithm_t"><span class="type">gnutls_pk_algorithm_t</span></a> enumeration on
6664 success, or a negative value on error.</td>
6665 </tr>
6666 </tbody>
6667 </table></div>
6668 </div>
6669 <hr>
6670 <div class="refsect2">
6671 <a name="gnutls-x509-privkey-get-key-id"></a><h3>gnutls_x509_privkey_get_key_id ()</h3>
6672 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_get_key_id      (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6673                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
6674                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
6675                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
6676 <p>
6677 This function will return a unique ID the depends on the public key
6678 parameters. This ID can be used in checking whether a certificate
6679 corresponds to the given key.
6680 </p>
6681 <p>
6682 If the buffer provided is not long enough to hold the output, then
6683 *<em class="parameter"><code>output_data_size</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will
6684 be returned.  The output will normally be a SHA-1 hash output,
6685 which is 20 bytes.
6686 </p>
6687 <div class="variablelist"><table border="0">
6688 <col align="left" valign="top">
6689 <tbody>
6690 <tr>
6691 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6692 <td>Holds the key</td>
6693 </tr>
6694 <tr>
6695 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
6696 <td>should be 0 for now</td>
6697 </tr>
6698 <tr>
6699 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
6700 <td>will contain the key ID</td>
6701 </tr>
6702 <tr>
6703 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
6704 <td>holds the size of output_data (and will be
6705 replaced by the actual size of parameters)</td>
6706 </tr>
6707 <tr>
6708 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6709 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6710 negative error value.</td>
6711 </tr>
6712 </tbody>
6713 </table></div>
6714 </div>
6715 <hr>
6716 <div class="refsect2">
6717 <a name="gnutls-x509-privkey-generate"></a><h3>gnutls_x509_privkey_generate ()</h3>
6718 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_generate        (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6719                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-pk-algorithm-t" title="enum gnutls_pk_algorithm_t"><span class="type">gnutls_pk_algorithm_t</span></a> algo</code></em>,
6720                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> bits</code></em>,
6721                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
6722 <p>
6723 This function will generate a random private key. Note that this
6724 function must be called on an empty private key.
6725 </p>
6726 <p>
6727 Do not set the number of bits directly, use <a class="link" href="gnutls-gnutls.html#gnutls-sec-param-to-pk-bits" title="gnutls_sec_param_to_pk_bits ()"><code class="function">gnutls_sec_param_to_pk_bits()</code></a>.
6728 </p>
6729 <div class="variablelist"><table border="0">
6730 <col align="left" valign="top">
6731 <tbody>
6732 <tr>
6733 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6734 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> structure</td>
6735 </tr>
6736 <tr>
6737 <td><p><span class="term"><em class="parameter"><code>algo</code></em> :</span></p></td>
6738 <td>is one of RSA or DSA.</td>
6739 </tr>
6740 <tr>
6741 <td><p><span class="term"><em class="parameter"><code>bits</code></em> :</span></p></td>
6742 <td>the size of the modulus</td>
6743 </tr>
6744 <tr>
6745 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
6746 <td>unused for now.  Must be 0.</td>
6747 </tr>
6748 <tr>
6749 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6750 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6751 negative error value.</td>
6752 </tr>
6753 </tbody>
6754 </table></div>
6755 </div>
6756 <hr>
6757 <div class="refsect2">
6758 <a name="gnutls-x509-privkey-export"></a><h3>gnutls_x509_privkey_export ()</h3>
6759 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_export          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6760                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
6761                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
6762                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
6763 <p>
6764 This function will export the private key to a PKCS1 structure for
6765 RSA keys, or an integer sequence for DSA keys.  The DSA keys are in
6766 the same format with the parameters used by openssl.
6767 </p>
6768 <p>
6769 If the buffer provided is not long enough to hold the output, then
6770 *<em class="parameter"><code>output_data_size</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a>
6771 will be returned.
6772 </p>
6773 <p>
6774 If the structure is PEM encoded, it will have a header
6775 of "BEGIN RSA PRIVATE KEY".
6776 </p>
6777 <div class="variablelist"><table border="0">
6778 <col align="left" valign="top">
6779 <tbody>
6780 <tr>
6781 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6782 <td>Holds the key</td>
6783 </tr>
6784 <tr>
6785 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
6786 <td>the format of output params. One of PEM or DER.</td>
6787 </tr>
6788 <tr>
6789 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
6790 <td>will contain a private key PEM or DER encoded</td>
6791 </tr>
6792 <tr>
6793 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
6794 <td>holds the size of output_data (and will be
6795 replaced by the actual size of parameters)</td>
6796 </tr>
6797 <tr>
6798 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6799 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6800 negative error value.</td>
6801 </tr>
6802 </tbody>
6803 </table></div>
6804 </div>
6805 <hr>
6806 <div class="refsect2">
6807 <a name="gnutls-x509-privkey-export-pkcs8"></a><h3>gnutls_x509_privkey_export_pkcs8 ()</h3>
6808 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_export_pkcs8    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6809                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
6810                                                          <em class="parameter"><code>const <span class="type">char</span> *password</code></em>,
6811                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
6812                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
6813                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
6814 <p>
6815 This function will export the private key to a PKCS8 structure.
6816 Both RSA and DSA keys can be exported. For DSA keys we use
6817 PKCS <span class="type">11</span> definitions. If the flags do not specify the encryption
6818 cipher, then the default 3DES (PBES2) will be used.
6819 </p>
6820 <p>
6821 The <em class="parameter"><code>password</code></em> can be either ASCII or UTF-8 in the default PBES2
6822 encryption schemas, or ASCII for the PKCS12 schemas.
6823 </p>
6824 <p>
6825 If the buffer provided is not long enough to hold the output, then
6826 *output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
6827 be returned.
6828 </p>
6829 <p>
6830 If the structure is PEM encoded, it will have a header
6831 of "BEGIN ENCRYPTED PRIVATE KEY" or "BEGIN PRIVATE KEY" if
6832 encryption is not used.
6833 </p>
6834 <div class="variablelist"><table border="0">
6835 <col align="left" valign="top">
6836 <tbody>
6837 <tr>
6838 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6839 <td>Holds the key</td>
6840 </tr>
6841 <tr>
6842 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
6843 <td>the format of output params. One of PEM or DER.</td>
6844 </tr>
6845 <tr>
6846 <td><p><span class="term"><em class="parameter"><code>password</code></em> :</span></p></td>
6847 <td>the password that will be used to encrypt the key.</td>
6848 </tr>
6849 <tr>
6850 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
6851 <td>an ORed sequence of gnutls_pkcs_encrypt_flags_t</td>
6852 </tr>
6853 <tr>
6854 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
6855 <td>will contain a private key PEM or DER encoded</td>
6856 </tr>
6857 <tr>
6858 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
6859 <td>holds the size of output_data (and will be
6860 replaced by the actual size of parameters)</td>
6861 </tr>
6862 <tr>
6863 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6864 <td>In case of failure a negative value will be
6865 returned, and 0 on success.</td>
6866 </tr>
6867 </tbody>
6868 </table></div>
6869 </div>
6870 <hr>
6871 <div class="refsect2">
6872 <a name="gnutls-x509-privkey-export-rsa-raw2"></a><h3>gnutls_x509_privkey_export_rsa_raw2 ()</h3>
6873 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_export_rsa_raw2 (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6874                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
6875                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>,
6876                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *d</code></em>,
6877                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
6878                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
6879                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *u</code></em>,
6880                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e1</code></em>,
6881                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e2</code></em>);</pre>
6882 <p>
6883 This function will export the RSA private key's parameters found
6884 in the given structure. The new parameters will be allocated using
6885 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
6886 </p>
6887 <div class="variablelist"><table border="0">
6888 <col align="left" valign="top">
6889 <tbody>
6890 <tr>
6891 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6892 <td>a structure that holds the rsa parameters</td>
6893 </tr>
6894 <tr>
6895 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
6896 <td>will hold the modulus</td>
6897 </tr>
6898 <tr>
6899 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
6900 <td>will hold the public exponent</td>
6901 </tr>
6902 <tr>
6903 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
6904 <td>will hold the private exponent</td>
6905 </tr>
6906 <tr>
6907 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6908 <td>will hold the first prime (p)</td>
6909 </tr>
6910 <tr>
6911 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6912 <td>will hold the second prime (q)</td>
6913 </tr>
6914 <tr>
6915 <td><p><span class="term"><em class="parameter"><code>u</code></em> :</span></p></td>
6916 <td>will hold the coefficient</td>
6917 </tr>
6918 <tr>
6919 <td><p><span class="term"><em class="parameter"><code>e1</code></em> :</span></p></td>
6920 <td>will hold e1 = d mod (p-1)</td>
6921 </tr>
6922 <tr>
6923 <td><p><span class="term"><em class="parameter"><code>e2</code></em> :</span></p></td>
6924 <td>will hold e2 = d mod (q-1)</td>
6925 </tr>
6926 <tr>
6927 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6928 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6929 negative error value.</td>
6930 </tr>
6931 </tbody>
6932 </table></div>
6933 </div>
6934 <hr>
6935 <div class="refsect2">
6936 <a name="gnutls-x509-privkey-export-rsa-raw"></a><h3>gnutls_x509_privkey_export_rsa_raw ()</h3>
6937 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_privkey_export_rsa_raw  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>,
6938                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
6939                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>,
6940                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *d</code></em>,
6941                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *p</code></em>,
6942                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *q</code></em>,
6943                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *u</code></em>);</pre>
6944 <p>
6945 This function will export the RSA private key's parameters found
6946 in the given structure. The new parameters will be allocated using
6947 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
6948 </p>
6949 <div class="variablelist"><table border="0">
6950 <col align="left" valign="top">
6951 <tbody>
6952 <tr>
6953 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
6954 <td>a structure that holds the rsa parameters</td>
6955 </tr>
6956 <tr>
6957 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
6958 <td>will hold the modulus</td>
6959 </tr>
6960 <tr>
6961 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
6962 <td>will hold the public exponent</td>
6963 </tr>
6964 <tr>
6965 <td><p><span class="term"><em class="parameter"><code>d</code></em> :</span></p></td>
6966 <td>will hold the private exponent</td>
6967 </tr>
6968 <tr>
6969 <td><p><span class="term"><em class="parameter"><code>p</code></em> :</span></p></td>
6970 <td>will hold the first prime (p)</td>
6971 </tr>
6972 <tr>
6973 <td><p><span class="term"><em class="parameter"><code>q</code></em> :</span></p></td>
6974 <td>will hold the second prime (q)</td>
6975 </tr>
6976 <tr>
6977 <td><p><span class="term"><em class="parameter"><code>u</code></em> :</span></p></td>
6978 <td>will hold the coefficient</td>
6979 </tr>
6980 <tr>
6981 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
6982 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
6983 negative error value.</td>
6984 </tr>
6985 </tbody>
6986 </table></div>
6987 </div>
6988 <hr>
6989 <div class="refsect2">
6990 <a name="gnutls-x509-crq-print"></a><h3>gnutls_x509_crq_print ()</h3>
6991 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_print               (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
6992                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-certificate-print-formats-t" title="enum gnutls_certificate_print_formats_t"><span class="type">gnutls_certificate_print_formats_t</span></a> format</code></em>,
6993                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *out</code></em>);</pre>
6994 <p>
6995 This function will pretty print a certificate request, suitable for
6996 display to a human.
6997 </p>
6998 <p>
6999 The output <em class="parameter"><code>out</code></em> needs to be deallocate using <a class="link" href="gnutls-gnutls.html#gnutls-free" title="gnutls_free"><code class="function">gnutls_free()</code></a>.
7000 </p>
7001 <div class="variablelist"><table border="0">
7002 <col align="left" valign="top">
7003 <tbody>
7004 <tr>
7005 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7006 <td>The structure to be printed</td>
7007 </tr>
7008 <tr>
7009 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
7010 <td>Indicate the format to use</td>
7011 </tr>
7012 <tr>
7013 <td><p><span class="term"><em class="parameter"><code>out</code></em> :</span></p></td>
7014 <td>Newly allocated datum with zero terminated string.</td>
7015 </tr>
7016 <tr>
7017 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7018 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7019 negative error value.</td>
7020 </tr>
7021 </tbody>
7022 </table></div>
7023 <p class="since">Since 2.8.0</p>
7024 </div>
7025 <hr>
7026 <div class="refsect2">
7027 <a name="gnutls-x509-crq-init"></a><h3>gnutls_x509_crq_init ()</h3>
7028 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_init                (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> *crq</code></em>);</pre>
7029 <p>
7030 This function will initialize a PKCS<span class="type">10</span> certificate request
7031 structure.
7032 </p>
7033 <div class="variablelist"><table border="0">
7034 <col align="left" valign="top">
7035 <tbody>
7036 <tr>
7037 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7038 <td>The structure to be initialized</td>
7039 </tr>
7040 <tr>
7041 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7042 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7043 negative error value.</td>
7044 </tr>
7045 </tbody>
7046 </table></div>
7047 </div>
7048 <hr>
7049 <div class="refsect2">
7050 <a name="gnutls-x509-crq-deinit"></a><h3>gnutls_x509_crq_deinit ()</h3>
7051 <pre class="programlisting"><span class="returnvalue">void</span>                gnutls_x509_crq_deinit              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);</pre>
7052 <p>
7053 This function will deinitialize a PKCS<span class="type">10</span> certificate request
7054 structure.
7055 </p>
7056 <div class="variablelist"><table border="0">
7057 <col align="left" valign="top">
7058 <tbody><tr>
7059 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7060 <td>The structure to be initialized</td>
7061 </tr></tbody>
7062 </table></div>
7063 </div>
7064 <hr>
7065 <div class="refsect2">
7066 <a name="gnutls-x509-crq-import"></a><h3>gnutls_x509_crq_import ()</h3>
7067 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_import              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7068                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *data</code></em>,
7069                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>);</pre>
7070 <p>
7071 This function will convert the given DER or PEM encoded certificate
7072 request to a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure.  The output will be
7073 stored in <em class="parameter"><code>crq</code></em>.
7074 </p>
7075 <p>
7076 If the Certificate is PEM encoded it should have a header of "NEW
7077 CERTIFICATE REQUEST".
7078 </p>
7079 <div class="variablelist"><table border="0">
7080 <col align="left" valign="top">
7081 <tbody>
7082 <tr>
7083 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7084 <td>The structure to store the parsed certificate request.</td>
7085 </tr>
7086 <tr>
7087 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
7088 <td>The DER or PEM encoded certificate.</td>
7089 </tr>
7090 <tr>
7091 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
7092 <td>One of DER or PEM</td>
7093 </tr>
7094 <tr>
7095 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7096 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7097 negative error value.</td>
7098 </tr>
7099 </tbody>
7100 </table></div>
7101 </div>
7102 <hr>
7103 <div class="refsect2">
7104 <a name="gnutls-x509-crq-get-dn"></a><h3>gnutls_x509_crq_get_dn ()</h3>
7105 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_dn              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7106                                                          <em class="parameter"><code><span class="type">char</span> *buf</code></em>,
7107                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
7108 <p>
7109 This function will copy the name of the Certificate request subject
7110 to the provided buffer.  The name will be in the form
7111 "C=xxxx,O=yyyy,CN=zzzz" as described in RFC 2253. The output string
7112 <em class="parameter"><code>buf</code></em> will be ASCII or UTF-8 encoded, depending on the certificate
7113 data.
7114 </p>
7115 <div class="variablelist"><table border="0">
7116 <col align="left" valign="top">
7117 <tbody>
7118 <tr>
7119 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7120 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7121 </tr>
7122 <tr>
7123 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
7124 <td>a pointer to a structure to hold the name (may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</td>
7125 </tr>
7126 <tr>
7127 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
7128 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
7129 </td>
7130 </tr>
7131 <tr>
7132 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7133 <td>
7134 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is not
7135 long enough, and in that case the *<em class="parameter"><code>sizeof_buf</code></em> will be updated with
7136 the required size.  On success 0 is returned.</td>
7137 </tr>
7138 </tbody>
7139 </table></div>
7140 </div>
7141 <hr>
7142 <div class="refsect2">
7143 <a name="gnutls-x509-crq-get-dn-oid"></a><h3>gnutls_x509_crq_get_dn_oid ()</h3>
7144 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_dn_oid          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7145                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7146                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
7147                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
7148 <p>
7149 This function will extract the requested OID of the name of the
7150 certificate request subject, specified by the given index.
7151 </p>
7152 <div class="variablelist"><table border="0">
7153 <col align="left" valign="top">
7154 <tbody>
7155 <tr>
7156 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7157 <td>should contain a gnutls_x509_crq_t structure</td>
7158 </tr>
7159 <tr>
7160 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7161 <td>Specifies which DN OID to send. Use zero to get the first one.</td>
7162 </tr>
7163 <tr>
7164 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7165 <td>a pointer to a structure to hold the name (may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</td>
7166 </tr>
7167 <tr>
7168 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
7169 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
7170 </td>
7171 </tr>
7172 <tr>
7173 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7174 <td>
7175 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
7176 not long enough, and in that case the *<em class="parameter"><code>sizeof_oid</code></em> will be
7177 updated with the required size.  On success 0 is returned.</td>
7178 </tr>
7179 </tbody>
7180 </table></div>
7181 </div>
7182 <hr>
7183 <div class="refsect2">
7184 <a name="gnutls-x509-crq-get-dn-by-oid"></a><h3>gnutls_x509_crq_get_dn_by_oid ()</h3>
7185 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_dn_by_oid       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7186                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
7187                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7188                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
7189                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
7190                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
7191 <p>
7192 This function will extract the part of the name of the Certificate
7193 request subject, specified by the given OID. The output will be
7194 encoded as described in RFC2253. The output string will be ASCII
7195 or UTF-8 encoded, depending on the certificate data.
7196 </p>
7197 <p>
7198 Some helper macros with popular OIDs can be found in gnutls/x509.h
7199 If raw flag is zero, this function will only return known OIDs as
7200 text. Other OIDs will be DER encoded, as described in RFC2253 --
7201 in hex format with a '#' prefix.  You can check about known OIDs
7202 using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>.
7203 </p>
7204 <div class="variablelist"><table border="0">
7205 <col align="left" valign="top">
7206 <tbody>
7207 <tr>
7208 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7209 <td>should contain a gnutls_x509_crq_t structure</td>
7210 </tr>
7211 <tr>
7212 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7213 <td>holds an Object Identified in null terminated string</td>
7214 </tr>
7215 <tr>
7216 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7217 <td>In case multiple same OIDs exist in the RDN, this specifies
7218 which to send. Use zero to get the first one.</td>
7219 </tr>
7220 <tr>
7221 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
7222 <td>If non zero returns the raw DER data of the DN part.</td>
7223 </tr>
7224 <tr>
7225 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
7226 <td>a pointer to a structure to hold the name (may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</td>
7227 </tr>
7228 <tr>
7229 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
7230 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
7231 </td>
7232 </tr>
7233 <tr>
7234 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7235 <td>
7236 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
7237 not long enough, and in that case the *<em class="parameter"><code>sizeof_buf</code></em> will be
7238 updated with the required size.  On success 0 is returned.</td>
7239 </tr>
7240 </tbody>
7241 </table></div>
7242 </div>
7243 <hr>
7244 <div class="refsect2">
7245 <a name="gnutls-x509-crq-set-dn-by-oid"></a><h3>gnutls_x509_crq_set_dn_by_oid ()</h3>
7246 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_dn_by_oid       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7247                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
7248                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> raw_flag</code></em>,
7249                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
7250                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> sizeof_data</code></em>);</pre>
7251 <p>
7252 This function will set the part of the name of the Certificate
7253 request subject, specified by the given OID.  The input string
7254 should be ASCII or UTF-8 encoded.
7255 </p>
7256 <p>
7257 Some helper macros with popular OIDs can be found in gnutls/x509.h
7258 With this function you can only set the known OIDs.  You can test
7259 for known OIDs using <a class="link" href="gnutls-x509.html#gnutls-x509-dn-oid-known" title="gnutls_x509_dn_oid_known ()"><code class="function">gnutls_x509_dn_oid_known()</code></a>.  For OIDs that are
7260 not known (by gnutls) you should properly DER encode your data, and
7261 call this function with raw_flag set.
7262 </p>
7263 <div class="variablelist"><table border="0">
7264 <col align="left" valign="top">
7265 <tbody>
7266 <tr>
7267 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7268 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7269 </tr>
7270 <tr>
7271 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7272 <td>holds an Object Identifier in a zero-terminated string</td>
7273 </tr>
7274 <tr>
7275 <td><p><span class="term"><em class="parameter"><code>raw_flag</code></em> :</span></p></td>
7276 <td>must be 0, or 1 if the data are DER encoded</td>
7277 </tr>
7278 <tr>
7279 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
7280 <td>a pointer to the input data</td>
7281 </tr>
7282 <tr>
7283 <td><p><span class="term"><em class="parameter"><code>sizeof_data</code></em> :</span></p></td>
7284 <td>holds the size of <em class="parameter"><code>data</code></em>
7285 </td>
7286 </tr>
7287 <tr>
7288 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7289 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7290 negative error value.</td>
7291 </tr>
7292 </tbody>
7293 </table></div>
7294 </div>
7295 <hr>
7296 <div class="refsect2">
7297 <a name="gnutls-x509-crq-set-version"></a><h3>gnutls_x509_crq_set_version ()</h3>
7298 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7299                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> version</code></em>);</pre>
7300 <p>
7301 This function will set the version of the certificate request.  For
7302 version 1 requests this must be one.
7303 </p>
7304 <div class="variablelist"><table border="0">
7305 <col align="left" valign="top">
7306 <tbody>
7307 <tr>
7308 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7309 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7310 </tr>
7311 <tr>
7312 <td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
7313 <td>holds the version number, for v1 Requests must be 1</td>
7314 </tr>
7315 <tr>
7316 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7317 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7318 negative error value.</td>
7319 </tr>
7320 </tbody>
7321 </table></div>
7322 </div>
7323 <hr>
7324 <div class="refsect2">
7325 <a name="gnutls-x509-crq-get-version"></a><h3>gnutls_x509_crq_get_version ()</h3>
7326 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_version         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);</pre>
7327 <p>
7328 This function will return the version of the specified Certificate
7329 request.
7330 </p>
7331 <div class="variablelist"><table border="0">
7332 <col align="left" valign="top">
7333 <tbody>
7334 <tr>
7335 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7336 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7337 </tr>
7338 <tr>
7339 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7340 <td>version of certificate request, or a negative value on
7341 error.</td>
7342 </tr>
7343 </tbody>
7344 </table></div>
7345 </div>
7346 <hr>
7347 <div class="refsect2">
7348 <a name="gnutls-x509-crq-set-key"></a><h3>gnutls_x509_crq_set_key ()</h3>
7349 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_key             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7350                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-privkey-t" title="gnutls_x509_privkey_t"><span class="type">gnutls_x509_privkey_t</span></a> key</code></em>);</pre>
7351 <p>
7352 This function will set the public parameters from the given private
7353 key to the request.  Only RSA keys are currently supported.
7354 </p>
7355 <div class="variablelist"><table border="0">
7356 <col align="left" valign="top">
7357 <tbody>
7358 <tr>
7359 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7360 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7361 </tr>
7362 <tr>
7363 <td><p><span class="term"><em class="parameter"><code>key</code></em> :</span></p></td>
7364 <td>holds a private key</td>
7365 </tr>
7366 <tr>
7367 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7368 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7369 negative error value.</td>
7370 </tr>
7371 </tbody>
7372 </table></div>
7373 </div>
7374 <hr>
7375 <div class="refsect2">
7376 <a name="gnutls-x509-crq-set-challenge-password"></a><h3>gnutls_x509_crq_set_challenge_password ()</h3>
7377 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_challenge_password
7378                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7379                                                          <em class="parameter"><code>const <span class="type">char</span> *pass</code></em>);</pre>
7380 <p>
7381 This function will set a challenge password to be used when
7382 revoking the request.
7383 </p>
7384 <div class="variablelist"><table border="0">
7385 <col align="left" valign="top">
7386 <tbody>
7387 <tr>
7388 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7389 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7390 </tr>
7391 <tr>
7392 <td><p><span class="term"><em class="parameter"><code>pass</code></em> :</span></p></td>
7393 <td>holds a zero-terminated password</td>
7394 </tr>
7395 <tr>
7396 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7397 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7398 negative error value.</td>
7399 </tr>
7400 </tbody>
7401 </table></div>
7402 </div>
7403 <hr>
7404 <div class="refsect2">
7405 <a name="gnutls-x509-crq-get-challenge-password"></a><h3>gnutls_x509_crq_get_challenge_password ()</h3>
7406 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_challenge_password
7407                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7408                                                          <em class="parameter"><code><span class="type">char</span> *pass</code></em>,
7409                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_pass</code></em>);</pre>
7410 <p>
7411 This function will return the challenge password in the request.
7412 The challenge password is intended to be used for requesting a
7413 revocation of the certificate.
7414 </p>
7415 <div class="variablelist"><table border="0">
7416 <col align="left" valign="top">
7417 <tbody>
7418 <tr>
7419 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7420 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7421 </tr>
7422 <tr>
7423 <td><p><span class="term"><em class="parameter"><code>pass</code></em> :</span></p></td>
7424 <td>will hold a zero-terminated password string</td>
7425 </tr>
7426 <tr>
7427 <td><p><span class="term"><em class="parameter"><code>sizeof_pass</code></em> :</span></p></td>
7428 <td>Initially holds the size of <em class="parameter"><code>pass</code></em>.</td>
7429 </tr>
7430 <tr>
7431 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7432 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7433 negative error value.</td>
7434 </tr>
7435 </tbody>
7436 </table></div>
7437 </div>
7438 <hr>
7439 <div class="refsect2">
7440 <a name="gnutls-x509-crq-set-attribute-by-oid"></a><h3>gnutls_x509_crq_set_attribute_by_oid ()</h3>
7441 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_attribute_by_oid
7442                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7443                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
7444                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
7445                                                          <em class="parameter"><code><span class="type">size_t</span> sizeof_buf</code></em>);</pre>
7446 <p>
7447 This function will set the attribute in the certificate request
7448 specified by the given Object ID.  The attribute must be be DER
7449 encoded.
7450 </p>
7451 <div class="variablelist"><table border="0">
7452 <col align="left" valign="top">
7453 <tbody>
7454 <tr>
7455 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7456 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7457 </tr>
7458 <tr>
7459 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7460 <td>holds an Object Identified in zero-terminated string</td>
7461 </tr>
7462 <tr>
7463 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
7464 <td>a pointer to a structure that holds the attribute data</td>
7465 </tr>
7466 <tr>
7467 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
7468 <td>holds the size of <em class="parameter"><code>buf</code></em>
7469 </td>
7470 </tr>
7471 <tr>
7472 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7473 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7474 negative error value.</td>
7475 </tr>
7476 </tbody>
7477 </table></div>
7478 </div>
7479 <hr>
7480 <div class="refsect2">
7481 <a name="gnutls-x509-crq-get-attribute-by-oid"></a><h3>gnutls_x509_crq_get_attribute_by_oid ()</h3>
7482 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_attribute_by_oid
7483                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7484                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
7485                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7486                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
7487                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>);</pre>
7488 <p>
7489 This function will return the attribute in the certificate request
7490 specified by the given Object ID.  The attribute will be DER
7491 encoded.
7492 </p>
7493 <div class="variablelist"><table border="0">
7494 <col align="left" valign="top">
7495 <tbody>
7496 <tr>
7497 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7498 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7499 </tr>
7500 <tr>
7501 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7502 <td>holds an Object Identified in zero-terminated string</td>
7503 </tr>
7504 <tr>
7505 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7506 <td>In case multiple same OIDs exist in the attribute list, this
7507 specifies which to send, use zero to get the first one</td>
7508 </tr>
7509 <tr>
7510 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
7511 <td>a pointer to a structure to hold the attribute data (may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</td>
7512 </tr>
7513 <tr>
7514 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
7515 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
7516 </td>
7517 </tr>
7518 <tr>
7519 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7520 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7521 negative error value.</td>
7522 </tr>
7523 </tbody>
7524 </table></div>
7525 </div>
7526 <hr>
7527 <div class="refsect2">
7528 <a name="gnutls-x509-crq-export"></a><h3>gnutls_x509_crq_export ()</h3>
7529 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_export              (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7530                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-fmt-t" title="enum gnutls_x509_crt_fmt_t"><span class="type">gnutls_x509_crt_fmt_t</span></a> format</code></em>,
7531                                                          <em class="parameter"><code><span class="type">void</span> *output_data</code></em>,
7532                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
7533 <p>
7534 This function will export the certificate request to a PEM or DER
7535 encoded PKCS10 structure.
7536 </p>
7537 <p>
7538 If the buffer provided is not long enough to hold the output, then
7539 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be returned and
7540 *<em class="parameter"><code>output_data_size</code></em> will be updated.
7541 </p>
7542 <p>
7543 If the structure is PEM encoded, it will have a header of "BEGIN
7544 NEW CERTIFICATE REQUEST".
7545 </p>
7546 <div class="variablelist"><table border="0">
7547 <col align="left" valign="top">
7548 <tbody>
7549 <tr>
7550 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7551 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7552 </tr>
7553 <tr>
7554 <td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
7555 <td>the format of output params. One of PEM or DER.</td>
7556 </tr>
7557 <tr>
7558 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
7559 <td>will contain a certificate request PEM or DER encoded</td>
7560 </tr>
7561 <tr>
7562 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
7563 <td>holds the size of output_data (and will be
7564 replaced by the actual size of parameters)</td>
7565 </tr>
7566 <tr>
7567 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7568 <td>In case of failure a negative value will be
7569 returned, and 0 on success.</td>
7570 </tr>
7571 </tbody>
7572 </table></div>
7573 </div>
7574 <hr>
7575 <div class="refsect2">
7576 <a name="gnutls-x509-crt-set-crq"></a><h3>gnutls_x509_crt_set_crq ()</h3>
7577 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_crq             (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
7578                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);</pre>
7579 <p>
7580 This function will set the name and public parameters as well as
7581 the extensions from the given certificate request to the certificate. 
7582 Only RSA keys are currently supported.
7583 </p>
7584 <div class="variablelist"><table border="0">
7585 <col align="left" valign="top">
7586 <tbody>
7587 <tr>
7588 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
7589 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
7590 </td>
7591 </tr>
7592 <tr>
7593 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7594 <td>holds a certificate request</td>
7595 </tr>
7596 <tr>
7597 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7598 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7599 negative error value.</td>
7600 </tr>
7601 </tbody>
7602 </table></div>
7603 </div>
7604 <hr>
7605 <div class="refsect2">
7606 <a name="gnutls-x509-crt-set-crq-extensions"></a><h3>gnutls_x509_crt_set_crq_extensions ()</h3>
7607 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crt_set_crq_extensions  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a> crt</code></em>,
7608                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>);</pre>
7609 <p>
7610 This function will set extensions from the given request to the
7611 certificate.
7612 </p>
7613 <div class="variablelist"><table border="0">
7614 <col align="left" valign="top">
7615 <tbody>
7616 <tr>
7617 <td><p><span class="term"><em class="parameter"><code>crt</code></em> :</span></p></td>
7618 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crt-t" title="gnutls_x509_crt_t"><span class="type">gnutls_x509_crt_t</span></a>
7619 </td>
7620 </tr>
7621 <tr>
7622 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7623 <td>holds a certificate request</td>
7624 </tr>
7625 <tr>
7626 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7627 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7628 negative error value.</td>
7629 </tr>
7630 </tbody>
7631 </table></div>
7632 <p class="since">Since 2.8.0</p>
7633 </div>
7634 <hr>
7635 <div class="refsect2">
7636 <a name="gnutls-x509-crq-set-key-rsa-raw"></a><h3>gnutls_x509_crq_set_key_rsa_raw ()</h3>
7637 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_key_rsa_raw     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7638                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *m</code></em>,
7639                                                          <em class="parameter"><code>const <span class="type">gnutls_datum_t</span> *e</code></em>);</pre>
7640 <p>
7641 This function will set the public parameters from the given private
7642 key to the request. Only RSA keys are currently supported.
7643 </p>
7644 <div class="variablelist"><table border="0">
7645 <col align="left" valign="top">
7646 <tbody>
7647 <tr>
7648 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7649 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7650 </tr>
7651 <tr>
7652 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
7653 <td>holds the modulus</td>
7654 </tr>
7655 <tr>
7656 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
7657 <td>holds the public exponent</td>
7658 </tr>
7659 <tr>
7660 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7661 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7662 negative error value.</td>
7663 </tr>
7664 </tbody>
7665 </table></div>
7666 <p class="since">Since 2.6.0</p>
7667 </div>
7668 <hr>
7669 <div class="refsect2">
7670 <a name="gnutls-x509-crq-set-subject-alt-name"></a><h3>gnutls_x509_crq_set_subject_alt_name ()</h3>
7671 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_subject_alt_name
7672                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7673                                                          <em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> nt</code></em>,
7674                                                          <em class="parameter"><code>const <span class="type">void</span> *data</code></em>,
7675                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> data_size</code></em>,
7676                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>);</pre>
7677 <p>
7678 This function will set the subject alternative name certificate
7679 extension.  It can set the following types:
7680 </p>
7681 <p>
7682 &amp;GNUTLS_SAN_DNSNAME: as a text string
7683 </p>
7684 <p>
7685 &amp;GNUTLS_SAN_RFC822NAME: as a text string
7686 </p>
7687 <p>
7688 &amp;GNUTLS_SAN_URI: as a text string
7689 </p>
7690 <p>
7691 &amp;GNUTLS_SAN_IPADDRESS: as a binary IP address (4 or 16 bytes)
7692 </p>
7693 <p>
7694 Other values can be set as binary values with the proper DER encoding.
7695 </p>
7696 <div class="variablelist"><table border="0">
7697 <col align="left" valign="top">
7698 <tbody>
7699 <tr>
7700 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7701 <td>a certificate request of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a>
7702 </td>
7703 </tr>
7704 <tr>
7705 <td><p><span class="term"><em class="parameter"><code>nt</code></em> :</span></p></td>
7706 <td>is one of the <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> enumerations</td>
7707 </tr>
7708 <tr>
7709 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
7710 <td>The data to be set</td>
7711 </tr>
7712 <tr>
7713 <td><p><span class="term"><em class="parameter"><code>data_size</code></em> :</span></p></td>
7714 <td>The size of data to be set</td>
7715 </tr>
7716 <tr>
7717 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
7718 <td>
7719 <a class="link" href="gnutls-x509.html#GNUTLS-FSAN-SET:CAPS" title="GNUTLS_FSAN_SET"><code class="literal">GNUTLS_FSAN_SET</code></a> to clear previous data or
7720 <a class="link" href="gnutls-x509.html#GNUTLS-FSAN-APPEND:CAPS" title="GNUTLS_FSAN_APPEND"><code class="literal">GNUTLS_FSAN_APPEND</code></a> to append.</td>
7721 </tr>
7722 <tr>
7723 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7724 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7725 negative error value.</td>
7726 </tr>
7727 </tbody>
7728 </table></div>
7729 <p class="since">Since 2.8.0</p>
7730 </div>
7731 <hr>
7732 <div class="refsect2">
7733 <a name="gnutls-x509-crq-set-key-usage"></a><h3>gnutls_x509_crq_set_key_usage ()</h3>
7734 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_key_usage       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7735                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> usage</code></em>);</pre>
7736 <p>
7737 This function will set the keyUsage certificate extension.
7738 </p>
7739 <div class="variablelist"><table border="0">
7740 <col align="left" valign="top">
7741 <tbody>
7742 <tr>
7743 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7744 <td>a certificate request of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a>
7745 </td>
7746 </tr>
7747 <tr>
7748 <td><p><span class="term"><em class="parameter"><code>usage</code></em> :</span></p></td>
7749 <td>an ORed sequence of the GNUTLS_KEY_* elements.</td>
7750 </tr>
7751 <tr>
7752 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7753 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7754 negative error value.</td>
7755 </tr>
7756 </tbody>
7757 </table></div>
7758 <p class="since">Since 2.8.0</p>
7759 </div>
7760 <hr>
7761 <div class="refsect2">
7762 <a name="gnutls-x509-crq-set-basic-constraints"></a><h3>gnutls_x509_crq_set_basic_constraints ()</h3>
7763 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_basic_constraints
7764                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7765                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> ca</code></em>,
7766                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> pathLenConstraint</code></em>);</pre>
7767 <p>
7768 This function will set the basicConstraints certificate extension.
7769 </p>
7770 <div class="variablelist"><table border="0">
7771 <col align="left" valign="top">
7772 <tbody>
7773 <tr>
7774 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7775 <td>a certificate request of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a>
7776 </td>
7777 </tr>
7778 <tr>
7779 <td><p><span class="term"><em class="parameter"><code>ca</code></em> :</span></p></td>
7780 <td>true(1) or false(0) depending on the Certificate authority status.</td>
7781 </tr>
7782 <tr>
7783 <td><p><span class="term"><em class="parameter"><code>pathLenConstraint</code></em> :</span></p></td>
7784 <td>non-negative values indicate maximum length of path,
7785 and negative values indicate that the pathLenConstraints field should
7786 not be present.</td>
7787 </tr>
7788 <tr>
7789 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7790 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7791 negative error value.</td>
7792 </tr>
7793 </tbody>
7794 </table></div>
7795 <p class="since">Since 2.8.0</p>
7796 </div>
7797 <hr>
7798 <div class="refsect2">
7799 <a name="gnutls-x509-crq-set-key-purpose-oid"></a><h3>gnutls_x509_crq_set_key_purpose_oid ()</h3>
7800 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_set_key_purpose_oid (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7801                                                          <em class="parameter"><code>const <span class="type">void</span> *oid</code></em>,
7802                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> critical</code></em>);</pre>
7803 <p>
7804 This function will set the key purpose OIDs of the Certificate.
7805 These are stored in the Extended Key Usage extension (2.5.29.37)
7806 See the GNUTLS_KP_* definitions for human readable names.
7807 </p>
7808 <p>
7809 Subsequent calls to this function will append OIDs to the OID list.
7810 </p>
7811 <div class="variablelist"><table border="0">
7812 <col align="left" valign="top">
7813 <tbody>
7814 <tr>
7815 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7816 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a>
7817 </td>
7818 </tr>
7819 <tr>
7820 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7821 <td>a pointer to a zero-terminated string that holds the OID</td>
7822 </tr>
7823 <tr>
7824 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
7825 <td>Whether this extension will be critical or not</td>
7826 </tr>
7827 <tr>
7828 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7829 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7830 negative error value.</td>
7831 </tr>
7832 </tbody>
7833 </table></div>
7834 <p class="since">Since 2.8.0</p>
7835 </div>
7836 <hr>
7837 <div class="refsect2">
7838 <a name="gnutls-x509-crq-get-key-purpose-oid"></a><h3>gnutls_x509_crq_get_key_purpose_oid ()</h3>
7839 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_key_purpose_oid (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7840                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7841                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
7842                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
7843                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
7844 <p>
7845 This function will extract the key purpose OIDs of the Certificate
7846 specified by the given index.  These are stored in the Extended Key
7847 Usage extension (2.5.29.37).  See the GNUTLS_KP_* definitions for
7848 human readable names.
7849 </p>
7850 <div class="variablelist"><table border="0">
7851 <col align="left" valign="top">
7852 <tbody>
7853 <tr>
7854 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7855 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7856 </tr>
7857 <tr>
7858 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7859 <td>This specifies which OID to return, use zero to get the first one</td>
7860 </tr>
7861 <tr>
7862 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7863 <td>a pointer to a buffer to hold the OID (may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>)</td>
7864 </tr>
7865 <tr>
7866 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
7867 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
7868 </td>
7869 </tr>
7870 <tr>
7871 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
7872 <td>output variable with critical flag, may be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
7873 </tr>
7874 <tr>
7875 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7876 <td>
7877 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if the provided buffer is
7878 not long enough, and in that case the *<em class="parameter"><code>sizeof_oid</code></em> will be
7879 updated with the required size.  On success 0 is returned.</td>
7880 </tr>
7881 </tbody>
7882 </table></div>
7883 <p class="since">Since 2.8.0</p>
7884 </div>
7885 <hr>
7886 <div class="refsect2">
7887 <a name="gnutls-x509-crq-get-extension-data"></a><h3>gnutls_x509_crq_get_extension_data ()</h3>
7888 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_extension_data  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7889                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7890                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
7891                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);</pre>
7892 <p>
7893 This function will return the requested extension data in the
7894 certificate.  The extension data will be stored as a string in the
7895 provided buffer.
7896 </p>
7897 <p>
7898 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-info" title="gnutls_x509_crq_get_extension_info ()"><code class="function">gnutls_x509_crq_get_extension_info()</code></a> to extract the OID and
7899 critical flag.  Use <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-by-oid" title="gnutls_x509_crq_get_extension_by_oid ()"><code class="function">gnutls_x509_crq_get_extension_by_oid()</code></a> instead,
7900 if you want to get data indexed by the extension OID rather than
7901 sequence.
7902 </p>
7903 <div class="variablelist"><table border="0">
7904 <col align="left" valign="top">
7905 <tbody>
7906 <tr>
7907 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7908 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7909 </tr>
7910 <tr>
7911 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7912 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
7913 </tr>
7914 <tr>
7915 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
7916 <td>a pointer to a structure to hold the data (may be null)</td>
7917 </tr>
7918 <tr>
7919 <td><p><span class="term"><em class="parameter"><code>sizeof_data</code></em> :</span></p></td>
7920 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
7921 </td>
7922 </tr>
7923 <tr>
7924 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7925 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7926 negative value in case of an error.  If your have reached the
7927 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
7928 will be returned.</td>
7929 </tr>
7930 </tbody>
7931 </table></div>
7932 <p class="since">Since 2.8.0</p>
7933 </div>
7934 <hr>
7935 <div class="refsect2">
7936 <a name="gnutls-x509-crq-get-extension-info"></a><h3>gnutls_x509_crq_get_extension_info ()</h3>
7937 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_extension_info  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7938                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7939                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
7940                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>,
7941                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
7942 <p>
7943 This function will return the requested extension OID in the
7944 certificate, and the critical flag for it.  The extension OID will
7945 be stored as a string in the provided buffer.  Use
7946 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-extension-data" title="gnutls_x509_crq_get_extension_data ()"><code class="function">gnutls_x509_crq_get_extension_data()</code></a> to extract the data.
7947 </p>
7948 <p>
7949 If the buffer provided is not long enough to hold the output, then
7950 *<em class="parameter"><code>sizeof_oid</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be
7951 returned.
7952 </p>
7953 <div class="variablelist"><table border="0">
7954 <col align="left" valign="top">
7955 <tbody>
7956 <tr>
7957 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
7958 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
7959 </tr>
7960 <tr>
7961 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
7962 <td>Specifies which extension OID to send. Use zero to get the first one.</td>
7963 </tr>
7964 <tr>
7965 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
7966 <td>a pointer to a structure to hold the OID</td>
7967 </tr>
7968 <tr>
7969 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
7970 <td>initially holds the maximum size of <em class="parameter"><code>oid</code></em>, on return
7971 holds actual size of <em class="parameter"><code>oid</code></em>.</td>
7972 </tr>
7973 <tr>
7974 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
7975 <td>output variable with critical flag, may be NULL.</td>
7976 </tr>
7977 <tr>
7978 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
7979 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
7980 negative value in case of an error.  If your have reached the
7981 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
7982 will be returned.</td>
7983 </tr>
7984 </tbody>
7985 </table></div>
7986 <p class="since">Since 2.8.0</p>
7987 </div>
7988 <hr>
7989 <div class="refsect2">
7990 <a name="gnutls-x509-crq-get-attribute-data"></a><h3>gnutls_x509_crq_get_attribute_data ()</h3>
7991 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_attribute_data  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
7992                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
7993                                                          <em class="parameter"><code><span class="type">void</span> *data</code></em>,
7994                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_data</code></em>);</pre>
7995 <p>
7996 This function will return the requested attribute data in the
7997 certificate request.  The attribute data will be stored as a string in the
7998 provided buffer.
7999 </p>
8000 <p>
8001 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-info" title="gnutls_x509_crq_get_attribute_info ()"><code class="function">gnutls_x509_crq_get_attribute_info()</code></a> to extract the OID.
8002 Use <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-by-oid" title="gnutls_x509_crq_get_attribute_by_oid ()"><code class="function">gnutls_x509_crq_get_attribute_by_oid()</code></a> instead,
8003 if you want to get data indexed by the attribute OID rather than
8004 sequence.
8005 </p>
8006 <div class="variablelist"><table border="0">
8007 <col align="left" valign="top">
8008 <tbody>
8009 <tr>
8010 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8011 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8012 </tr>
8013 <tr>
8014 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
8015 <td>Specifies which attribute OID to send. Use zero to get the first one.</td>
8016 </tr>
8017 <tr>
8018 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
8019 <td>a pointer to a structure to hold the data (may be null)</td>
8020 </tr>
8021 <tr>
8022 <td><p><span class="term"><em class="parameter"><code>sizeof_data</code></em> :</span></p></td>
8023 <td>initially holds the size of <em class="parameter"><code>oid</code></em>
8024 </td>
8025 </tr>
8026 <tr>
8027 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8028 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
8029 negative value in case of an error.  If your have reached the
8030 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
8031 will be returned.</td>
8032 </tr>
8033 </tbody>
8034 </table></div>
8035 <p class="since">Since 2.8.0</p>
8036 </div>
8037 <hr>
8038 <div class="refsect2">
8039 <a name="gnutls-x509-crq-get-attribute-info"></a><h3>gnutls_x509_crq_get_attribute_info ()</h3>
8040 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_attribute_info  (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8041                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
8042                                                          <em class="parameter"><code><span class="type">void</span> *oid</code></em>,
8043                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_oid</code></em>);</pre>
8044 <p>
8045 This function will return the requested attribute OID in the
8046 certificate, and the critical flag for it.  The attribute OID will
8047 be stored as a string in the provided buffer.  Use
8048 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-attribute-data" title="gnutls_x509_crq_get_attribute_data ()"><code class="function">gnutls_x509_crq_get_attribute_data()</code></a> to extract the data.
8049 </p>
8050 <p>
8051 If the buffer provided is not long enough to hold the output, then
8052 *<em class="parameter"><code>sizeof_oid</code></em> is updated and <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> will be
8053 returned.
8054 </p>
8055 <div class="variablelist"><table border="0">
8056 <col align="left" valign="top">
8057 <tbody>
8058 <tr>
8059 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8060 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8061 </tr>
8062 <tr>
8063 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
8064 <td>Specifies which attribute OID to send. Use zero to get the first one.</td>
8065 </tr>
8066 <tr>
8067 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
8068 <td>a pointer to a structure to hold the OID</td>
8069 </tr>
8070 <tr>
8071 <td><p><span class="term"><em class="parameter"><code>sizeof_oid</code></em> :</span></p></td>
8072 <td>initially holds the maximum size of <em class="parameter"><code>oid</code></em>, on return
8073 holds actual size of <em class="parameter"><code>oid</code></em>.</td>
8074 </tr>
8075 <tr>
8076 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8077 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
8078 negative value in case of an error.  If your have reached the
8079 last extension available <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a>
8080 will be returned.</td>
8081 </tr>
8082 </tbody>
8083 </table></div>
8084 <p class="since">Since 2.8.0</p>
8085 </div>
8086 <hr>
8087 <div class="refsect2">
8088 <a name="gnutls-x509-crq-get-pk-algorithm"></a><h3>gnutls_x509_crq_get_pk_algorithm ()</h3>
8089 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_pk_algorithm    (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8090                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *bits</code></em>);</pre>
8091 <p>
8092 This function will return the public key algorithm of a PKCS<span class="type">10</span>
8093 certificate request.
8094 </p>
8095 <p>
8096 If bits is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, it should have enough size to hold the
8097 parameters size in bits.  For RSA the bits returned is the modulus.
8098 For DSA the bits returned are of the public exponent.
8099 </p>
8100 <div class="variablelist"><table border="0">
8101 <col align="left" valign="top">
8102 <tbody>
8103 <tr>
8104 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8105 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8106 </tr>
8107 <tr>
8108 <td><p><span class="term"><em class="parameter"><code>bits</code></em> :</span></p></td>
8109 <td>if bits is non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> it will hold the size of the parameters' in bits</td>
8110 </tr>
8111 <tr>
8112 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8113 <td>a member of the <a class="link" href="gnutls-gnutls.html#gnutls-pk-algorithm-t" title="enum gnutls_pk_algorithm_t"><span class="type">gnutls_pk_algorithm_t</span></a> enumeration on
8114 success, or a negative value on error.</td>
8115 </tr>
8116 </tbody>
8117 </table></div>
8118 </div>
8119 <hr>
8120 <div class="refsect2">
8121 <a name="gnutls-x509-crq-get-key-id"></a><h3>gnutls_x509_crq_get_key_id ()</h3>
8122 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_key_id          (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8123                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> flags</code></em>,
8124                                                          <em class="parameter"><code>unsigned <span class="type">char</span> *output_data</code></em>,
8125                                                          <em class="parameter"><code><span class="type">size_t</span> *output_data_size</code></em>);</pre>
8126 <p>
8127 This function will return a unique ID the depends on the public key
8128 parameters.  This ID can be used in checking whether a certificate
8129 corresponds to the given private key.
8130 </p>
8131 <p>
8132 If the buffer provided is not long enough to hold the output, then
8133 *<em class="parameter"><code>output_data_size</code></em> is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
8134 be returned.  The output will normally be a SHA-1 hash output,
8135 which is 20 bytes.
8136 </p>
8137 <div class="variablelist"><table border="0">
8138 <col align="left" valign="top">
8139 <tbody>
8140 <tr>
8141 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8142 <td>a certificate of type <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a>
8143 </td>
8144 </tr>
8145 <tr>
8146 <td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
8147 <td>should be 0 for now</td>
8148 </tr>
8149 <tr>
8150 <td><p><span class="term"><em class="parameter"><code>output_data</code></em> :</span></p></td>
8151 <td>will contain the key ID</td>
8152 </tr>
8153 <tr>
8154 <td><p><span class="term"><em class="parameter"><code>output_data_size</code></em> :</span></p></td>
8155 <td>holds the size of output_data (and will be
8156 replaced by the actual size of parameters)</td>
8157 </tr>
8158 <tr>
8159 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8160 <td>In case of failure a negative value will be
8161 returned, and 0 on success.</td>
8162 </tr>
8163 </tbody>
8164 </table></div>
8165 <p class="since">Since 2.8.0</p>
8166 </div>
8167 <hr>
8168 <div class="refsect2">
8169 <a name="gnutls-x509-crq-get-key-rsa-raw"></a><h3>gnutls_x509_crq_get_key_rsa_raw ()</h3>
8170 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_key_rsa_raw     (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8171                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *m</code></em>,
8172                                                          <em class="parameter"><code><span class="type">gnutls_datum_t</span> *e</code></em>);</pre>
8173 <p>
8174 This function will export the RSA public key's parameters found in
8175 the given structure.  The new parameters will be allocated using
8176 <a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a> and will be stored in the appropriate datum.
8177 </p>
8178 <div class="variablelist"><table border="0">
8179 <col align="left" valign="top">
8180 <tbody>
8181 <tr>
8182 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8183 <td>Holds the certificate</td>
8184 </tr>
8185 <tr>
8186 <td><p><span class="term"><em class="parameter"><code>m</code></em> :</span></p></td>
8187 <td>will hold the modulus</td>
8188 </tr>
8189 <tr>
8190 <td><p><span class="term"><em class="parameter"><code>e</code></em> :</span></p></td>
8191 <td>will hold the public exponent</td>
8192 </tr>
8193 <tr>
8194 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8195 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
8196 negative error value.</td>
8197 </tr>
8198 </tbody>
8199 </table></div>
8200 <p class="since">Since 2.8.0</p>
8201 </div>
8202 <hr>
8203 <div class="refsect2">
8204 <a name="gnutls-x509-crq-get-key-usage"></a><h3>gnutls_x509_crq_get_key_usage ()</h3>
8205 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_key_usage       (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8206                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *key_usage</code></em>,
8207                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
8208 <p>
8209 This function will return certificate's key usage, by reading the
8210 keyUsage X.509 extension (2.5.29.15).  The key usage value will
8211 ORed values of the: <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DIGITAL-SIGNATURE:CAPS" title="GNUTLS_KEY_DIGITAL_SIGNATURE"><code class="literal">GNUTLS_KEY_DIGITAL_SIGNATURE</code></a>,
8212 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-NON-REPUDIATION:CAPS" title="GNUTLS_KEY_NON_REPUDIATION"><code class="literal">GNUTLS_KEY_NON_REPUDIATION</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-ENCIPHERMENT:CAPS" title="GNUTLS_KEY_KEY_ENCIPHERMENT"><code class="literal">GNUTLS_KEY_KEY_ENCIPHERMENT</code></a>,
8213 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DATA-ENCIPHERMENT:CAPS" title="GNUTLS_KEY_DATA_ENCIPHERMENT"><code class="literal">GNUTLS_KEY_DATA_ENCIPHERMENT</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-AGREEMENT:CAPS" title="GNUTLS_KEY_KEY_AGREEMENT"><code class="literal">GNUTLS_KEY_KEY_AGREEMENT</code></a>,
8214 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-KEY-CERT-SIGN:CAPS" title="GNUTLS_KEY_KEY_CERT_SIGN"><code class="literal">GNUTLS_KEY_KEY_CERT_SIGN</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-CRL-SIGN:CAPS" title="GNUTLS_KEY_CRL_SIGN"><code class="literal">GNUTLS_KEY_CRL_SIGN</code></a>,
8215 <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-ENCIPHER-ONLY:CAPS" title="GNUTLS_KEY_ENCIPHER_ONLY"><code class="literal">GNUTLS_KEY_ENCIPHER_ONLY</code></a>, <a class="link" href="gnutls-gnutls.html#GNUTLS-KEY-DECIPHER-ONLY:CAPS" title="GNUTLS_KEY_DECIPHER_ONLY"><code class="literal">GNUTLS_KEY_DECIPHER_ONLY</code></a>.
8216 </p>
8217 <div class="variablelist"><table border="0">
8218 <col align="left" valign="top">
8219 <tbody>
8220 <tr>
8221 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8222 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8223 </tr>
8224 <tr>
8225 <td><p><span class="term"><em class="parameter"><code>key_usage</code></em> :</span></p></td>
8226 <td>where the key usage bits will be stored</td>
8227 </tr>
8228 <tr>
8229 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
8230 <td>will be non zero if the extension is marked as critical</td>
8231 </tr>
8232 <tr>
8233 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8234 <td>the certificate key usage, or a negative value in case of
8235 parsing error.  If the certificate does not contain the keyUsage
8236 extension <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be
8237 returned.</td>
8238 </tr>
8239 </tbody>
8240 </table></div>
8241 <p class="since">Since 2.8.0</p>
8242 </div>
8243 <hr>
8244 <div class="refsect2">
8245 <a name="gnutls-x509-crq-get-basic-constraints"></a><h3>gnutls_x509_crq_get_basic_constraints ()</h3>
8246 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_basic_constraints
8247                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8248                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>,
8249                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ca</code></em>,
8250                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *pathlen</code></em>);</pre>
8251 <p>
8252 This function will read the certificate's basic constraints, and
8253 return the certificates CA status.  It reads the basicConstraints
8254 X.509 extension (2.5.29.19).
8255 </p>
8256 <div class="variablelist"><table border="0">
8257 <col align="left" valign="top">
8258 <tbody>
8259 <tr>
8260 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8261 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8262 </tr>
8263 <tr>
8264 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
8265 <td>will be non zero if the extension is marked as critical</td>
8266 </tr>
8267 <tr>
8268 <td><p><span class="term"><em class="parameter"><code>ca</code></em> :</span></p></td>
8269 <td>pointer to output integer indicating CA status, may be NULL,
8270 value is 1 if the certificate CA flag is set, 0 otherwise.</td>
8271 </tr>
8272 <tr>
8273 <td><p><span class="term"><em class="parameter"><code>pathlen</code></em> :</span></p></td>
8274 <td>pointer to output integer indicating path length (may be
8275 NULL), non-negative values indicate a present pathLenConstraint
8276 field and the actual value, -1 indicate that the field is absent.</td>
8277 </tr>
8278 <tr>
8279 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8280 <td>If the certificate is a CA a positive value will be
8281 returned, or zero if the certificate does not have CA flag set.
8282 A negative value may be returned in case of errors.  If the
8283 certificate does not contain the basicConstraints extension
8284 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be returned.</td>
8285 </tr>
8286 </tbody>
8287 </table></div>
8288 <p class="since">Since 2.8.0</p>
8289 </div>
8290 <hr>
8291 <div class="refsect2">
8292 <a name="gnutls-x509-crq-get-subject-alt-name"></a><h3>gnutls_x509_crq_get_subject_alt_name ()</h3>
8293 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_subject_alt_name
8294                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8295                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
8296                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
8297                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>,
8298                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *ret_type</code></em>,
8299                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
8300 <p>
8301 This function will return the alternative names, contained in the
8302 given certificate.  It is the same as
8303 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-subject-alt-name" title="gnutls_x509_crq_get_subject_alt_name ()"><code class="function">gnutls_x509_crq_get_subject_alt_name()</code></a> except for the fact that it
8304 will return the type of the alternative name in <em class="parameter"><code>ret_type</code></em> even if
8305 the function fails for some reason (i.e.  the buffer provided is
8306 not enough).
8307 </p>
8308 <div class="variablelist"><table border="0">
8309 <col align="left" valign="top">
8310 <tbody>
8311 <tr>
8312 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8313 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8314 </tr>
8315 <tr>
8316 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
8317 <td>specifies the sequence number of the alt name, 0 for the
8318 first one, 1 for the second etc.</td>
8319 </tr>
8320 <tr>
8321 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
8322 <td>is the place where the alternative name will be copied to</td>
8323 </tr>
8324 <tr>
8325 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
8326 <td>holds the size of ret.</td>
8327 </tr>
8328 <tr>
8329 <td><p><span class="term"><em class="parameter"><code>ret_type</code></em> :</span></p></td>
8330 <td>holds the <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a> name type</td>
8331 </tr>
8332 <tr>
8333 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
8334 <td>will be non zero if the extension is marked as critical
8335 (may be null)</td>
8336 </tr>
8337 <tr>
8338 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8339 <td>the alternative subject name type on success, one of the
8340 enumerated <a class="link" href="gnutls-gnutls.html#gnutls-x509-subject-alt-name-t" title="enum gnutls_x509_subject_alt_name_t"><span class="type">gnutls_x509_subject_alt_name_t</span></a>.  It will return
8341 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if <em class="parameter"><code>ret_size</code></em> is not large enough to
8342 hold the value.  In that case <em class="parameter"><code>ret_size</code></em> will be updated with the
8343 required size.  If the certificate request does not have an
8344 Alternative name with the specified sequence number then
8345 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
8346 </tr>
8347 </tbody>
8348 </table></div>
8349 <p class="since">Since 2.8.0</p>
8350 </div>
8351 <hr>
8352 <div class="refsect2">
8353 <a name="gnutls-x509-crq-get-subject-alt-othername-oid"></a><h3>gnutls_x509_crq_get_subject_alt_othername_oid ()</h3>
8354 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_subject_alt_othername_oid
8355                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8356                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> seq</code></em>,
8357                                                          <em class="parameter"><code><span class="type">void</span> *ret</code></em>,
8358                                                          <em class="parameter"><code><span class="type">size_t</span> *ret_size</code></em>);</pre>
8359 <p>
8360 This function will extract the type OID of an otherName Subject
8361 Alternative Name, contained in the given certificate, and return
8362 the type as an enumerated element.
8363 </p>
8364 <p>
8365 This function is only useful if
8366 <a class="link" href="gnutls-x509.html#gnutls-x509-crq-get-subject-alt-name" title="gnutls_x509_crq_get_subject_alt_name ()"><code class="function">gnutls_x509_crq_get_subject_alt_name()</code></a> returned
8367 <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a>.
8368 </p>
8369 <div class="variablelist"><table border="0">
8370 <col align="left" valign="top">
8371 <tbody>
8372 <tr>
8373 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8374 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8375 </tr>
8376 <tr>
8377 <td><p><span class="term"><em class="parameter"><code>seq</code></em> :</span></p></td>
8378 <td>specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)</td>
8379 </tr>
8380 <tr>
8381 <td><p><span class="term"><em class="parameter"><code>ret</code></em> :</span></p></td>
8382 <td>is the place where the otherName OID will be copied to</td>
8383 </tr>
8384 <tr>
8385 <td><p><span class="term"><em class="parameter"><code>ret_size</code></em> :</span></p></td>
8386 <td>holds the size of ret.</td>
8387 </tr>
8388 <tr>
8389 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8390 <td>the alternative subject name type on success, one of the
8391 enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs,
8392 it will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
8393 e.g. <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME-XMPP:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME_XMPP</code></a>, and <a class="link" href="gnutls-gnutls.html#GNUTLS-SAN-OTHERNAME:CAPS"><code class="literal">GNUTLS_SAN_OTHERNAME</code></a> for
8394 unknown OIDs.  It will return <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SHORT-MEMORY-BUFFER:CAPS" title="GNUTLS_E_SHORT_MEMORY_BUFFER"><code class="literal">GNUTLS_E_SHORT_MEMORY_BUFFER</code></a> if
8395 <em class="parameter"><code>ret_size</code></em> is not large enough to hold the value.  In that case
8396 <em class="parameter"><code>ret_size</code></em> will be updated with the required size.  If the
8397 certificate does not have an Alternative name with the specified
8398 sequence number and with the otherName type then
8399 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> is returned.</td>
8400 </tr>
8401 </tbody>
8402 </table></div>
8403 <p class="since">Since 2.8.0</p>
8404 </div>
8405 <hr>
8406 <div class="refsect2">
8407 <a name="gnutls-x509-crq-get-extension-by-oid"></a><h3>gnutls_x509_crq_get_extension_by_oid ()</h3>
8408 <pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a>                 gnutls_x509_crq_get_extension_by_oid
8409                                                         (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> crq</code></em>,
8410                                                          <em class="parameter"><code>const <span class="type">char</span> *oid</code></em>,
8411                                                          <em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> indx</code></em>,
8412                                                          <em class="parameter"><code><span class="type">void</span> *buf</code></em>,
8413                                                          <em class="parameter"><code><span class="type">size_t</span> *sizeof_buf</code></em>,
8414                                                          <em class="parameter"><code>unsigned <a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> *critical</code></em>);</pre>
8415 <p>
8416 This function will return the extension specified by the OID in
8417 the certificate.  The extensions will be returned as binary data
8418 DER encoded, in the provided buffer.
8419 </p>
8420 <div class="variablelist"><table border="0">
8421 <col align="left" valign="top">
8422 <tbody>
8423 <tr>
8424 <td><p><span class="term"><em class="parameter"><code>crq</code></em> :</span></p></td>
8425 <td>should contain a <a class="link" href="gnutls-gnutls.html#gnutls-x509-crq-t" title="gnutls_x509_crq_t"><span class="type">gnutls_x509_crq_t</span></a> structure</td>
8426 </tr>
8427 <tr>
8428 <td><p><span class="term"><em class="parameter"><code>oid</code></em> :</span></p></td>
8429 <td>holds an Object Identified in null terminated string</td>
8430 </tr>
8431 <tr>
8432 <td><p><span class="term"><em class="parameter"><code>indx</code></em> :</span></p></td>
8433 <td>In case multiple same OIDs exist in the extensions, this
8434 specifies which to send. Use zero to get the first one.</td>
8435 </tr>
8436 <tr>
8437 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
8438 <td>a pointer to a structure to hold the name (may be null)</td>
8439 </tr>
8440 <tr>
8441 <td><p><span class="term"><em class="parameter"><code>sizeof_buf</code></em> :</span></p></td>
8442 <td>initially holds the size of <em class="parameter"><code>buf</code></em>
8443 </td>
8444 </tr>
8445 <tr>
8446 <td><p><span class="term"><em class="parameter"><code>critical</code></em> :</span></p></td>
8447 <td>will be non zero if the extension is marked as critical</td>
8448 </tr>
8449 <tr>
8450 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
8451 <td>On success, <a class="link" href="gnutls-gnutls.html#GNUTLS-E-SUCCESS:CAPS" title="GNUTLS_E_SUCCESS"><code class="literal">GNUTLS_E_SUCCESS</code></a> is returned, otherwise a
8452 negative value in case of an error.  If the certificate does not
8453 contain the specified extension
8454 <a class="link" href="gnutls-gnutls.html#GNUTLS-E-REQUESTED-DATA-NOT-AVAILABLE:CAPS" title="GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE"><code class="literal">GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code></a> will be returned.</td>
8455 </tr>
8456 </tbody>
8457 </table></div>
8458 <p class="since">Since 2.8.0</p>
8459 </div>
8460 </div>
8461 </div>
8462 <div class="footer">
8463 <hr>
8464           Generated by GTK-Doc V1.18</div>
8465 </body>
8466 </html>