1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
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">
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">
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>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#GTlsCertificate.synopsis" class="shortcut">Top</a>
26 <a href="#GTlsCertificate.description" class="shortcut">Description</a>
28 <a href="#GTlsCertificate.object-hierarchy" class="shortcut">Object Hierarchy</a>
30 <a href="#GTlsCertificate.properties" class="shortcut">Properties</a>
33 <div class="refentry">
34 <a name="GTlsCertificate"></a><div class="titlepage"></div>
35 <div class="refnamediv"><table width="100%"><tr>
37 <h2><span class="refentrytitle"><a name="GTlsCertificate.top_of_page"></a>GTlsCertificate</span></h2>
38 <p>GTlsCertificate — TLS certificate</p>
40 <td valign="top" align="right"></td>
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" title="enum 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>);
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>
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
79 <div class="refsect1">
80 <a name="GTlsCertificate.description"></a><h2>Description</h2>
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>).
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>
95 Abstract base class for TLS certificate types.
97 <p class="since">Since 2.28</p>
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>
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
113 If <em class="parameter"><code>data</code></em> includes multiple certificates, only the first one will be
116 <div class="variablelist"><table border="0">
117 <col align="left" valign="top">
120 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
121 <td>PEM-encoded certificate data</td>
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>
128 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></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>
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>
138 <p class="since">Since 2.28</p>
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>
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>.
151 <div class="variablelist"><table border="0">
152 <col align="left" valign="top">
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>
159 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></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>
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>
169 <p class="since">Since 2.28</p>
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>
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>.
183 <div class="variablelist"><table border="0">
184 <col align="left" valign="top">
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>
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>
195 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></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>
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>
205 <p class="since">Since 2.28</p>
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>
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>.
220 <div class="variablelist"><table border="0">
221 <col align="left" valign="top">
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>
228 <td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></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>
233 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
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>
241 <p class="since">Since 2.28</p>
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>
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
250 <div class="variablelist"><table border="0">
251 <col align="left" valign="top">
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>
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>
267 <p class="since">Since 2.28</p>
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" title="enum 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>
276 This verifies <em class="parameter"><code>cert</code></em> and returns a set of <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum 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
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.
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
296 (All other <a class="link" href="gio-TLS-Overview.html#GTlsCertificateFlags" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a> values will always be set or unset
299 <div class="variablelist"><table border="0">
300 <col align="left" valign="top">
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>
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>
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>
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" title="enum GTlsCertificateFlags"><span class="type">GTlsCertificateFlags</span></a>
324 <p class="since">Since 2.28</p>
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>
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.
338 <p class="since">Since 2.28</p>
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>
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.
349 <p>Default value: NULL</p>
350 <p class="since">Since 2.28</p>
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>
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
362 <p class="since">Since 2.28</p>
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>
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),
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.
380 <p class="since">Since 2.28</p>
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>
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.
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.
399 <p>Default value: NULL</p>
400 <p class="since">Since 2.28</p>
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>
410 Generated by GTK-Doc V1.18</div>