Update to version 2.33.1
[profile/ivi/glib2.git] / docs / reference / gio / html / GTlsCertificate.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>GTlsCertificate</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="GIO Reference Manual">
8 <link rel="up" href="tls.html" title="TLS (SSL) support">
9 <link rel="prev" href="gio-TLS-Overview.html" title="TLS Overview">
10 <link rel="next" href="GTlsConnection.html" title="GTlsConnection">
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="gio-TLS-Overview.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="tls.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">GIO Reference Manual</th>
21 <td><a accesskey="n" href="GTlsConnection.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="#GTlsCertificate.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#GTlsCertificate.description" class="shortcut">Description</a>
27                    | 
28                   <a href="#GTlsCertificate.object-hierarchy" class="shortcut">Object Hierarchy</a>
29                    | 
30                   <a href="#GTlsCertificate.properties" class="shortcut">Properties</a>
31 </td></tr>
32 </table>
33 <div class="refentry">
34 <a name="GTlsCertificate"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
36 <td valign="top">
37 <h2><span class="refentrytitle"><a name="GTlsCertificate.top_of_page"></a>GTlsCertificate</span></h2>
38 <p>GTlsCertificate — TLS certificate</p>
39 </td>
40 <td valign="top" align="right"></td>
41 </tr></table></div>
42 <div class="refsynopsisdiv">
43 <a name="GTlsCertificate.synopsis"></a><h2>Synopsis</h2>
44 <pre class="synopsis">                    <a class="link" href="GTlsCertificate.html#GTlsCertificate-struct" title="GTlsCertificate">GTlsCertificate</a>;
45 <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   <a class="link" href="GTlsCertificate.html#g-tls-certificate-new-from-pem" title="g_tls_certificate_new_from_pem ()">g_tls_certificate_new_from_pem</a>      (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>,
46                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>,
47                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
48 <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   <a class="link" href="GTlsCertificate.html#g-tls-certificate-new-from-file" title="g_tls_certificate_new_from_file ()">g_tls_certificate_new_from_file</a>     (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file</code></em>,
49                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
50 <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   <a class="link" href="GTlsCertificate.html#g-tls-certificate-new-from-files" title="g_tls_certificate_new_from_files ()">g_tls_certificate_new_from_files</a>    (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *cert_file</code></em>,
51                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key_file</code></em>,
52                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
53 <a href="./../glib/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="GTlsCertificate.html#g-tls-certificate-list-new-from-file" title="g_tls_certificate_list_new_from_file ()">g_tls_certificate_list_new_from_file</a>
54                                                         (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file</code></em>,
55                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
56 <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   <a class="link" href="GTlsCertificate.html#g-tls-certificate-get-issuer" title="g_tls_certificate_get_issuer ()">g_tls_certificate_get_issuer</a>        (<em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *cert</code></em>);
57 <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a> <a class="link" href="GTlsCertificate.html#g-tls-certificate-verify" title="g_tls_certificate_verify ()">g_tls_certificate_verify</a>           (<em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *cert</code></em>,
58                                                          <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *identity</code></em>,
59                                                          <em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *trusted_ca</code></em>);
60 </pre>
61 </div>
62 <div class="refsect1">
63 <a name="GTlsCertificate.object-hierarchy"></a><h2>Object Hierarchy</h2>
64 <pre class="synopsis">
65   <a href="./../gobject/gobject/gobject-The-Base-Object-Type.html#GObject">GObject</a>
66    +----GTlsCertificate
67 </pre>
68 </div>
69 <div class="refsect1">
70 <a name="GTlsCertificate.properties"></a><h2>Properties</h2>
71 <pre class="synopsis">
72   "<a class="link" href="GTlsCertificate.html#GTlsCertificate--certificate" title='The "certificate" property'>certificate</a>"              <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>*           : Read / Write / Construct Only
73   "<a class="link" href="GTlsCertificate.html#GTlsCertificate--certificate-pem" title='The "certificate-pem" property'>certificate-pem</a>"          <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
74   "<a class="link" href="GTlsCertificate.html#GTlsCertificate--issuer" title='The "issuer" property'>issuer</a>"                   <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a>*      : Read / Write / Construct Only
75   "<a class="link" href="GTlsCertificate.html#GTlsCertificate--private-key" title='The "private-key" property'>private-key</a>"              <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>*           : Write / Construct Only
76   "<a class="link" href="GTlsCertificate.html#GTlsCertificate--private-key-pem" title='The "private-key-pem" property'>private-key-pem</a>"          <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Write / Construct Only
77 </pre>
78 </div>
79 <div class="refsect1">
80 <a name="GTlsCertificate.description"></a><h2>Description</h2>
81 <p>
82 A certificate used for TLS authentication and encryption.
83 This can represent either a public key only (eg, the certificate
84 received by a client from a server), or the combination of
85 a public key and a private key (which is needed when acting as a
86 <a class="link" href="GTlsServerConnection.html" title="GTlsServerConnection"><span class="type">GTlsServerConnection</span></a>).
87 </p>
88 </div>
89 <div class="refsect1">
90 <a name="GTlsCertificate.details"></a><h2>Details</h2>
91 <div class="refsect2">
92 <a name="GTlsCertificate-struct"></a><h3>GTlsCertificate</h3>
93 <pre class="programlisting">typedef struct _GTlsCertificate GTlsCertificate;</pre>
94 <p>
95 Abstract base class for TLS certificate types.
96 </p>
97 <p class="since">Since 2.28</p>
98 </div>
99 <hr>
100 <div class="refsect2">
101 <a name="g-tls-certificate-new-from-pem"></a><h3>g_tls_certificate_new_from_pem ()</h3>
102 <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   g_tls_certificate_new_from_pem      (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *data</code></em>,
103                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Basic-Types.html#gssize"><span class="type">gssize</span></a> length</code></em>,
104                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
105 <p>
106 Creates a new <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> from the PEM-encoded data in <em class="parameter"><code>data</code></em>.
107 If <em class="parameter"><code>data</code></em> includes both a certificate and a private key, then the
108 returned certificate will include the private key data as well. (See
109 the <a class="link" href="GTlsCertificate.html#GTlsCertificate--private-key-pem" title='The "private-key-pem" property'><span class="type">"private-key-pem"</span></a> property for information about
110 supported formats.)
111 </p>
112 <p>
113 If <em class="parameter"><code>data</code></em> includes multiple certificates, only the first one will be
114 parsed.
115 </p>
116 <div class="variablelist"><table border="0">
117 <col align="left" valign="top">
118 <tbody>
119 <tr>
120 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
121 <td>PEM-encoded certificate data</td>
122 </tr>
123 <tr>
124 <td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
125 <td>the length of <em class="parameter"><code>data</code></em>, or -1 if it's 0-terminated.</td>
126 </tr>
127 <tr>
128 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
129 <td>
130 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
131 </tr>
132 <tr>
133 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
134 <td>the new certificate, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>data</code></em> is invalid</td>
135 </tr>
136 </tbody>
137 </table></div>
138 <p class="since">Since 2.28</p>
139 </div>
140 <hr>
141 <div class="refsect2">
142 <a name="g-tls-certificate-new-from-file"></a><h3>g_tls_certificate_new_from_file ()</h3>
143 <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   g_tls_certificate_new_from_file     (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file</code></em>,
144                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
145 <p>
146 Creates a <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> from the PEM-encoded data in <em class="parameter"><code>file</code></em>. If
147 <em class="parameter"><code>file</code></em> cannot be read or parsed, the function will return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and
148 set <em class="parameter"><code>error</code></em>. Otherwise, this behaves like
149 <a class="link" href="GTlsCertificate.html#g-tls-certificate-new-from-pem" title="g_tls_certificate_new_from_pem ()"><code class="function">g_tls_certificate_new_from_pem()</code></a>.
150 </p>
151 <div class="variablelist"><table border="0">
152 <col align="left" valign="top">
153 <tbody>
154 <tr>
155 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
156 <td>file containing a PEM-encoded certificate to import</td>
157 </tr>
158 <tr>
159 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
160 <td>
161 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
162 </tr>
163 <tr>
164 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
165 <td>the new certificate, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error</td>
166 </tr>
167 </tbody>
168 </table></div>
169 <p class="since">Since 2.28</p>
170 </div>
171 <hr>
172 <div class="refsect2">
173 <a name="g-tls-certificate-new-from-files"></a><h3>g_tls_certificate_new_from_files ()</h3>
174 <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   g_tls_certificate_new_from_files    (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *cert_file</code></em>,
175                                                          <em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *key_file</code></em>,
176                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
177 <p>
178 Creates a <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> from the PEM-encoded data in <em class="parameter"><code>cert_file</code></em>
179 and <em class="parameter"><code>key_file</code></em>. If either file cannot be read or parsed, the
180 function will return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and set <em class="parameter"><code>error</code></em>. Otherwise, this behaves
181 like <a class="link" href="GTlsCertificate.html#g-tls-certificate-new-from-pem" title="g_tls_certificate_new_from_pem ()"><code class="function">g_tls_certificate_new_from_pem()</code></a>.
182 </p>
183 <div class="variablelist"><table border="0">
184 <col align="left" valign="top">
185 <tbody>
186 <tr>
187 <td><p><span class="term"><em class="parameter"><code>cert_file</code></em> :</span></p></td>
188 <td>file containing a PEM-encoded certificate to import</td>
189 </tr>
190 <tr>
191 <td><p><span class="term"><em class="parameter"><code>key_file</code></em> :</span></p></td>
192 <td>file containing a PEM-encoded private key to import</td>
193 </tr>
194 <tr>
195 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
196 <td>
197 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
198 </tr>
199 <tr>
200 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
201 <td>the new certificate, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> on error</td>
202 </tr>
203 </tbody>
204 </table></div>
205 <p class="since">Since 2.28</p>
206 </div>
207 <hr>
208 <div class="refsect2">
209 <a name="g-tls-certificate-list-new-from-file"></a><h3>g_tls_certificate_list_new_from_file ()</h3>
210 <pre class="programlisting"><a href="./../glib/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             g_tls_certificate_list_new_from_file
211                                                         (<em class="parameter"><code>const <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *file</code></em>,
212                                                          <em class="parameter"><code><a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
213 <p>
214 Creates one or more <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a>s from the PEM-encoded
215 data in <em class="parameter"><code>file</code></em>. If <em class="parameter"><code>file</code></em> cannot be read or parsed, the function will
216 return <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> and set <em class="parameter"><code>error</code></em>. If <em class="parameter"><code>file</code></em> does not contain any
217 PEM-encoded certificates, this will return an empty list and not
218 set <em class="parameter"><code>error</code></em>.
219 </p>
220 <div class="variablelist"><table border="0">
221 <col align="left" valign="top">
222 <tbody>
223 <tr>
224 <td><p><span class="term"><em class="parameter"><code>file</code></em> :</span></p></td>
225 <td>file containing PEM-encoded certificates to import</td>
226 </tr>
227 <tr>
228 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
229 <td>
230 <a href="./../glib/glib/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for error reporting, or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to ignore.</td>
231 </tr>
232 <tr>
233 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
234 <td>a
235 <a href="./../glib/glib/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> containing <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> objects. You must free the list
236 and its contents when you are done with it. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> Gio.TlsCertificate][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
237 </td>
238 </tr>
239 </tbody>
240 </table></div>
241 <p class="since">Since 2.28</p>
242 </div>
243 <hr>
244 <div class="refsect2">
245 <a name="g-tls-certificate-get-issuer"></a><h3>g_tls_certificate_get_issuer ()</h3>
246 <pre class="programlisting"><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="returnvalue">GTlsCertificate</span></a> *   g_tls_certificate_get_issuer        (<em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *cert</code></em>);</pre>
247 <p>
248 Gets the <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> representing <em class="parameter"><code>cert</code></em>'s issuer, if known
249 </p>
250 <div class="variablelist"><table border="0">
251 <col align="left" valign="top">
252 <tbody>
253 <tr>
254 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
255 <td>a <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a>
256 </td>
257 </tr>
258 <tr>
259 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
260 <td>The certificate of <em class="parameter"><code>cert</code></em>'s issuer,
261 or <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>cert</code></em> is self-signed or signed with an unknown
262 certificate. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
263 </td>
264 </tr>
265 </tbody>
266 </table></div>
267 <p class="since">Since 2.28</p>
268 </div>
269 <hr>
270 <div class="refsect2">
271 <a name="g-tls-certificate-verify"></a><h3>g_tls_certificate_verify ()</h3>
272 <pre class="programlisting"><a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags"><span class="returnvalue">GTlsCertificateFlags</span></a> g_tls_certificate_verify           (<em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *cert</code></em>,
273                                                          <em class="parameter"><code><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> *identity</code></em>,
274                                                          <em class="parameter"><code><a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> *trusted_ca</code></em>);</pre>
275 <p>
276 This verifies <em class="parameter"><code>cert</code></em> and returns a set of <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a>
277 indicating any problems found with it. This can be used to verify a
278 certificate outside the context of making a connection, or to
279 check a certificate against a CA that is not part of the system
280 CA database.
281 </p>
282 <p>
283 If <em class="parameter"><code>identity</code></em> is not <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <em class="parameter"><code>cert</code></em>'s name(s) will be compared against
284 it, and <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-BAD-IDENTITY:CAPS"><code class="literal">G_TLS_CERTIFICATE_BAD_IDENTITY</code></a> will be set in the return
285 value if it does not match. If <em class="parameter"><code>identity</code></em> is <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, that bit will
286 never be set in the return value.
287 </p>
288 <p>
289 If <em class="parameter"><code>trusted_ca</code></em> is not <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, then <em class="parameter"><code>cert</code></em> (or one of the certificates
290 in its chain) must be signed by it, or else
291 <a class="link" href="gio-TLS-Overview.html#G-TLS-CERTIFICATE-UNKNOWN-CA:CAPS"><code class="literal">G_TLS_CERTIFICATE_UNKNOWN_CA</code></a> will be set in the return value. If
292 <em class="parameter"><code>trusted_ca</code></em> is <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, that bit will never be set in the return
293 value.
294 </p>
295 <p>
296 (All other <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> values will always be set or unset
297 as appropriate.)
298 </p>
299 <div class="variablelist"><table border="0">
300 <col align="left" valign="top">
301 <tbody>
302 <tr>
303 <td><p><span class="term"><em class="parameter"><code>cert</code></em> :</span></p></td>
304 <td>a <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a>
305 </td>
306 </tr>
307 <tr>
308 <td><p><span class="term"><em class="parameter"><code>identity</code></em> :</span></p></td>
309 <td>the expected peer identity. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
310 </td>
311 </tr>
312 <tr>
313 <td><p><span class="term"><em class="parameter"><code>trusted_ca</code></em> :</span></p></td>
314 <td>the certificate of a trusted authority. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
315 </td>
316 </tr>
317 <tr>
318 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
319 <td>the appropriate <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a>
320 </td>
321 </tr>
322 </tbody>
323 </table></div>
324 <p class="since">Since 2.28</p>
325 </div>
326 </div>
327 <div class="refsect1">
328 <a name="GTlsCertificate.property-details"></a><h2>Property Details</h2>
329 <div class="refsect2">
330 <a name="GTlsCertificate--certificate"></a><h3>The <code class="literal">"certificate"</code> property</h3>
331 <pre class="programlisting">  "certificate"              <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>*           : Read / Write / Construct Only</pre>
332 <p>
333 The DER (binary) encoded representation of the certificate's
334 public key. This property and the
335 <a class="link" href="GTlsCertificate.html#GTlsCertificate--certificate-pem" title='The "certificate-pem" property'><span class="type">"certificate-pem"</span></a> property represent the same
336 data, just in different forms.
337 </p>
338 <p class="since">Since 2.28</p>
339 </div>
340 <hr>
341 <div class="refsect2">
342 <a name="GTlsCertificate--certificate-pem"></a><h3>The <code class="literal">"certificate-pem"</code> property</h3>
343 <pre class="programlisting">  "certificate-pem"          <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
344 <p>
345 The PEM (ASCII) encoded representation of the certificate's
346 public key. This property and the <a class="link" href="GTlsCertificate.html#GTlsCertificate--certificate" title='The "certificate" property'><span class="type">"certificate"</span></a>
347 property represent the same data, just in different forms.
348 </p>
349 <p>Default value: NULL</p>
350 <p class="since">Since 2.28</p>
351 </div>
352 <hr>
353 <div class="refsect2">
354 <a name="GTlsCertificate--issuer"></a><h3>The <code class="literal">"issuer"</code> property</h3>
355 <pre class="programlisting">  "issuer"                   <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a>*      : Read / Write / Construct Only</pre>
356 <p>
357 A <a class="link" href="GTlsCertificate.html" title="GTlsCertificate"><span class="type">GTlsCertificate</span></a> representing the entity that issued this
358 certificate. If <a href="./../glib/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, this means that the certificate is either
359 self-signed, or else the certificate of the issuer is not
360 available.
361 </p>
362 <p class="since">Since 2.28</p>
363 </div>
364 <hr>
365 <div class="refsect2">
366 <a name="GTlsCertificate--private-key"></a><h3>The <code class="literal">"private-key"</code> property</h3>
367 <pre class="programlisting">  "private-key"              <a href="./../glib/glib/glib-Byte-Arrays.html#GByteArray"><span class="type">GByteArray</span></a>*           : Write / Construct Only</pre>
368 <p>
369 The DER (binary) encoded representation of the certificate's
370 private key, in either PKCS#1 format or unencrypted PKCS#8
371 format. This property (or the <a class="link" href="GTlsCertificate.html#GTlsCertificate--private-key-pem" title='The "private-key-pem" property'><span class="type">"private-key-pem"</span></a>
372 property) can be set when constructing a key (eg, from a file),
373 but cannot be read.
374 </p>
375 <p>
376 PKCS#8 format is supported since 2.32; earlier releases only
377 support PKCS#1. You can use the <code class="literal">openssl rsa</code>
378 tool to convert PKCS#8 keys to PKCS#1.
379 </p>
380 <p class="since">Since 2.28</p>
381 </div>
382 <hr>
383 <div class="refsect2">
384 <a name="GTlsCertificate--private-key-pem"></a><h3>The <code class="literal">"private-key-pem"</code> property</h3>
385 <pre class="programlisting">  "private-key-pem"          <a href="./../glib/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Write / Construct Only</pre>
386 <p>
387 The PEM (ASCII) encoded representation of the certificate's
388 private key in either PKCS#1 format ("<code class="literal">BEGIN RSA PRIVATE
389 KEY</code>") or unencrypted PKCS#8 format ("<code class="literal">BEGIN
390 PRIVATE KEY</code>"). This property (or the
391 <a class="link" href="GTlsCertificate.html#GTlsCertificate--private-key" title='The "private-key" property'><span class="type">"private-key"</span></a> property) can be set when
392 constructing a key (eg, from a file), but cannot be read.
393 </p>
394 <p>
395 PKCS#8 format is supported since 2.32; earlier releases only
396 support PKCS#1. You can use the <code class="literal">openssl rsa</code>
397 tool to convert PKCS#8 keys to PKCS#1.
398 </p>
399 <p>Default value: NULL</p>
400 <p class="since">Since 2.28</p>
401 </div>
402 </div>
403 <div class="refsect1">
404 <a name="GTlsCertificate.see-also"></a><h2>See Also</h2>
405 <a class="link" href="GTlsConnection.html" title="GTlsConnection"><span class="type">GTlsConnection</span></a>
406 </div>
407 </div>
408 <div class="footer">
409 <hr>
410           Generated by GTK-Doc V1.18</div>
411 </body>
412 </html>