Blob Blame History Raw
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GcrParser: Gcr Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Gcr Library Reference Manual">
<link rel="up" href="storage.html" title="Part V. Storage">
<link rel="prev" href="gcr-GcrImportInteraction.html" title="GcrImportInteraction">
<link rel="next" href="misc.html" title="Part VI. Miscellaneous">
<meta name="generator" content="GTK-Doc V1.27.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GcrParser.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GcrParser.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GcrParser.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
                  <a href="#GcrParser.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="storage.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gcr-GcrImportInteraction.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="misc.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GcrParser"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GcrParser.top_of_page"></a>GcrParser</span></h2>
<p>GcrParser — Parser for certificate and key files</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GcrParser.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GcrParser.html" title="GcrParser"><span class="returnvalue">GcrParser</span></a> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-new" title="gcr_parser_new ()">gcr_parser_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-parse-bytes" title="gcr_parser_parse_bytes ()">gcr_parser_parse_bytes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-parse-data" title="gcr_parser_parse_data ()">gcr_parser_parse_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-parse-stream" title="gcr_parser_parse_stream ()">gcr_parser_parse_stream</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-parse-stream-async" title="gcr_parser_parse_stream_async ()">gcr_parser_parse_stream_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-parse-stream-finish" title="gcr_parser_parse_stream_finish ()">gcr_parser_parse_stream_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-format-enable" title="gcr_parser_format_enable ()">gcr_parser_format_enable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-format-disable" title="gcr_parser_format_disable ()">gcr_parser_format_disable</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-format-supported" title="gcr_parser_format_supported ()">gcr_parser_format_supported</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-add-password" title="gcr_parser_add_password ()">gcr_parser_add_password</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-label" title="gcr_parser_get_parsed_label ()">gcr_parser_get_parsed_label</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-description" title="gcr_parser_get_parsed_description ()">gcr_parser_get_parsed_description</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GckAttributes</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-attributes" title="gcr_parser_get_parsed_attributes ()">gcr_parser_get_parsed_attributes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">guchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-block" title="gcr_parser_get_parsed_block ()">gcr_parser_get_parsed_block</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GBytes</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-bytes" title="gcr_parser_get_parsed_bytes ()">gcr_parser_get_parsed_bytes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="returnvalue">GcrDataFormat</span></a>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-format" title="gcr_parser_get_parsed_format ()">gcr_parser_get_parsed_format</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-filename" title="gcr_parser_get_filename ()">gcr_parser_get_filename</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-set-filename" title="gcr_parser_set_filename ()">gcr_parser_set_filename</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="returnvalue">GcrParsed</span></a> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-ref" title="gcr_parsed_ref ()">gcr_parsed_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-unref" title="gcr_parsed_unref ()">gcr_parsed_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GckAttributes</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-attributes" title="gcr_parsed_get_attributes ()">gcr_parsed_get_attributes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">guchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-data" title="gcr_parsed_get_data ()">gcr_parsed_get_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GBytes</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-bytes" title="gcr_parsed_get_bytes ()">gcr_parsed_get_bytes</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-description" title="gcr_parsed_get_description ()">gcr_parsed_get_description</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="returnvalue">GcrDataFormat</span></a>
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-format" title="gcr_parsed_get_format ()">gcr_parsed_get_format</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-label" title="gcr_parsed_get_label ()">gcr_parsed_get_label</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="returnvalue">GcrParsed</span></a> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parser-get-parsed" title="gcr_parser_get_parsed ()">gcr_parser_get_parsed</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="GcrParser.html#gcr-parsed-get-filename" title="gcr_parsed_get_filename ()">gcr_parsed_get_filename</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GcrParser.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<span class="type">GckAttributes</span> *</td>
<td class="property_name"><a class="link" href="GcrParser.html#GcrParser--parsed-attributes" title="The “parsed-attributes” property">parsed-attributes</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type">
<span class="type">gchar</span> *</td>
<td class="property_name"><a class="link" href="GcrParser.html#GcrParser--parsed-description" title="The “parsed-description” property">parsed-description</a></td>
<td class="property_flags">Read</td>
</tr>
<tr>
<td class="property_type">
<span class="type">gchar</span> *</td>
<td class="property_name"><a class="link" href="GcrParser.html#GcrParser--parsed-label" title="The “parsed-label” property">parsed-label</a></td>
<td class="property_flags">Read</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GcrParser.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signals_return">
<col width="300px" class="signals_name">
<col width="200px" class="signals_flags">
</colgroup>
<tbody>
<tr>
<td class="signal_type"><span class="returnvalue">gboolean</span></td>
<td class="signal_name"><a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal">authenticate</a></td>
<td class="signal_flags">Run Last</td>
</tr>
<tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal">parsed</a></td>
<td class="signal_flags">Run First</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GcrParser.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="GcrParser.html#GCR-DATA-ERROR:CAPS" title="GCR_DATA_ERROR">GCR_DATA_ERROR</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GcrParser.html#GcrDataError" title="enum GcrDataError">GcrDataError</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat">GcrDataFormat</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GcrParser.html#GcrParser-struct" title="struct GcrParser">GcrParser</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GcrParser.html#GcrParserClass" title="struct GcrParserClass">GcrParserClass</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed">GcrParsed</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GcrParser.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GcrParser
</pre>
</div>
<div class="refsect1">
<a name="GcrParser.description"></a><h2>Description</h2>
<p>A <a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> can parse various certificate and key files such as OpenSSL
PEM files, DER encoded certifictes, PKCS#8 keys and so on. Each various
format is identified by a value in the <a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="type">GcrDataFormat</span></a> enumeration.</p>
<p>In order to parse data, a new parser is created with <a class="link" href="GcrParser.html#gcr-parser-new" title="gcr_parser_new ()"><code class="function">gcr_parser_new()</code></a> and
then the <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> and <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signals should be
connected to. Data is then fed to the parser via <a class="link" href="GcrParser.html#gcr-parser-parse-data" title="gcr_parser_parse_data ()"><code class="function">gcr_parser_parse_data()</code></a>
or <a class="link" href="GcrParser.html#gcr-parser-parse-stream" title="gcr_parser_parse_stream ()"><code class="function">gcr_parser_parse_stream()</code></a>.</p>
<p>During the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal the attributes that make up the currently
parsed item can be retrieved using the <a class="link" href="GcrParser.html#gcr-parser-get-parsed-attributes" title="gcr_parser_get_parsed_attributes ()"><code class="function">gcr_parser_get_parsed_attributes()</code></a>
function.</p>
</div>
<div class="refsect1">
<a name="GcrParser.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gcr-parser-new"></a><h3>gcr_parser_new ()</h3>
<pre class="programlisting"><a class="link" href="GcrParser.html" title="GcrParser"><span class="returnvalue">GcrParser</span></a> *
gcr_parser_new (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Create a new <a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a></p>
<div class="refsect3">
<a name="gcr-parser-new.returns"></a><h4>Returns</h4>
<p>a newly allocated <a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-parse-bytes"></a><h3>gcr_parser_parse_bytes ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gcr_parser_parse_bytes (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                        <em class="parameter"><code><span class="type">GBytes</span> *data</code></em>,
                        <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Parse the data. The <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> and <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> signals
may fire during the parsing.</p>
<div class="refsect3">
<a name="gcr-parser-parse-bytes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data to parse</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>A location to raise an error on failure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-parse-bytes.returns"></a><h4>Returns</h4>
<p> Whether the data was parsed successfully or not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-parse-data"></a><h3>gcr_parser_parse_data ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gcr_parser_parse_data (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                       <em class="parameter"><code>const <span class="type">guchar</span> *data</code></em>,
                       <em class="parameter"><code><span class="type">gsize</span> n_data</code></em>,
                       <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Parse the data. The <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> and <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> signals
may fire during the parsing.</p>
<p>A copy of the data will be made. Use <a class="link" href="GcrParser.html#gcr-parser-parse-bytes" title="gcr_parser_parse_bytes ()"><code class="function">gcr_parser_parse_bytes()</code></a> to avoid this.</p>
<div class="refsect3">
<a name="gcr-parser-parse-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data to parse. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_data]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>n_data</p></td>
<td class="parameter_description"><p>The length of the data</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>A location to raise an error on failure.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-parse-data.returns"></a><h4>Returns</h4>
<p> Whether the data was parsed successfully or not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-parse-stream"></a><h3>gcr_parser_parse_stream ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gcr_parser_parse_stream (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                         <em class="parameter"><code><span class="type">GInputStream</span> *input</code></em>,
                         <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                         <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Parse items from the data in a <span class="type">GInputStream</span>. This function may block while
reading from the input stream. Use <a class="link" href="GcrParser.html#gcr-parser-parse-stream-async" title="gcr_parser_parse_stream_async ()"><code class="function">gcr_parser_parse_stream_async()</code></a> for
a non-blocking variant.</p>
<p>The <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> and <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> signals
may fire during the parsing.</p>
<div class="refsect3">
<a name="gcr-parser-parse-stream.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>input</p></td>
<td class="parameter_description"><p>The input stream</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>An optional cancellation object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>A location to raise an error on failure</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-parse-stream.returns"></a><h4>Returns</h4>
<p> Whether the parsing completed successfully or not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-parse-stream-async"></a><h3>gcr_parser_parse_stream_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parser_parse_stream_async (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                               <em class="parameter"><code><span class="type">GInputStream</span> *input</code></em>,
                               <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
                               <em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
                               <em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Parse items from the data in a <span class="type">GInputStream</span>. This function completes
asyncronously and doesn't block.</p>
<p>The <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> and <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> signals
may fire during the parsing.</p>
<div class="refsect3">
<a name="gcr-parser-parse-stream-async.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>input</p></td>
<td class="parameter_description"><p>The input stream</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>An optional cancellation object</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>Called when the operation result is ready.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>Data to pass to callback</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-parse-stream-finish"></a><h3>gcr_parser_parse_stream_finish ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gcr_parser_parse_stream_finish (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                                <em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
                                <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Complete an operation to parse a stream.</p>
<div class="refsect3">
<a name="gcr-parser-parse-stream-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>The operation result</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>A location to raise an error on failure</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-parse-stream-finish.returns"></a><h4>Returns</h4>
<p> Whether the parsing completed successfully or not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-format-enable"></a><h3>gcr_parser_format_enable ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parser_format_enable (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                          <em class="parameter"><code><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="type">GcrDataFormat</span></a> format</code></em>);</pre>
<p>Enable parsing of the given format. Use <a class="link" href="GcrParser.html#GCR-FORMAT-ALL:CAPS"><code class="literal">GCR_FORMAT_ALL</code></a> to enable all the formats.</p>
<div class="refsect3">
<a name="gcr-parser-format-enable.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>The format identifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-format-disable"></a><h3>gcr_parser_format_disable ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parser_format_disable (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                           <em class="parameter"><code><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="type">GcrDataFormat</span></a> format</code></em>);</pre>
<p>Disable parsing of the given format. Use <a class="link" href="GcrParser.html#GCR-FORMAT-ALL:CAPS"><code class="literal">GCR_FORMAT_ALL</code></a> to disable all the formats.</p>
<div class="refsect3">
<a name="gcr-parser-format-disable.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>The format identifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-format-supported"></a><h3>gcr_parser_format_supported ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gcr_parser_format_supported (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                             <em class="parameter"><code><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="type">GcrDataFormat</span></a> format</code></em>);</pre>
<p>Check whether the given format is supported by the parser.</p>
<div class="refsect3">
<a name="gcr-parser-format-supported.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>format</p></td>
<td class="parameter_description"><p>The format identifier</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-format-supported.returns"></a><h4>Returns</h4>
<p> Whether the format is supported.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-add-password"></a><h3>gcr_parser_add_password ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parser_add_password (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                         <em class="parameter"><code>const <span class="type">gchar</span> *password</code></em>);</pre>
<p>Add a password to the set of passwords to try when parsing locked or encrypted
items. This is usually called from the <a class="link" href="GcrParser.html#GcrParser-authenticate" title="The “authenticate” signal"><span class="type">“authenticate”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-add-password.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>password</p></td>
<td class="parameter_description"><p>a password to try. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-label"></a><h3>gcr_parser_get_parsed_label ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parser_get_parsed_label (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the label of the currently parsed item. This is generally only valid
during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-label.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-label.returns"></a><h4>Returns</h4>
<p>the label of the currently parsed item. The value is
owned by the parser and should not be freed. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-description"></a><h3>gcr_parser_get_parsed_description ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parser_get_parsed_description (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get a description for the type of the currently parsed item. This is generally
only valid during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-description.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-description.returns"></a><h4>Returns</h4>
<p>the description for the current item; this is owned by
the parser and should not be freed. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-attributes"></a><h3>gcr_parser_get_parsed_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">GckAttributes</span> *
gcr_parser_get_parsed_attributes (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the attributes which make up the currently parsed item. This is generally
only valid during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-attributes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>The parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-attributes.returns"></a><h4>Returns</h4>
<p>the attributes for the current item,
which are owned by the parser and should not be freed. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-block"></a><h3>gcr_parser_get_parsed_block ()</h3>
<pre class="programlisting">const <span class="returnvalue">guchar</span> *
gcr_parser_get_parsed_block (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                             <em class="parameter"><code><span class="type">gsize</span> *n_block</code></em>);</pre>
<p>Get the raw data block that represents this parsed object. This is only
valid during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-block.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_block</p></td>
<td class="parameter_description"><p>a location to place the size of the block</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-block.returns"></a><h4>Returns</h4>
<p>the raw data
block of the currently parsed item; the value is owned by the parser
and should not be freed. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_block][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-bytes"></a><h3>gcr_parser_get_parsed_bytes ()</h3>
<pre class="programlisting"><span class="returnvalue">GBytes</span> *
gcr_parser_get_parsed_bytes (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the raw data block that represents this parsed object. This is only
valid during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-bytes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-bytes.returns"></a><h4>Returns</h4>
<p>the raw data block of the currently parsed item. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed-format"></a><h3>gcr_parser_get_parsed_format ()</h3>
<pre class="programlisting"><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="returnvalue">GcrDataFormat</span></a>
gcr_parser_get_parsed_format (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the format of the raw data block that represents this parsed object.
This corresponds with the data returned from <a class="link" href="GcrParser.html#gcr-parser-get-parsed-block" title="gcr_parser_get_parsed_block ()"><code class="function">gcr_parser_get_parsed_block()</code></a>.</p>
<p>This is only valid during the <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed-format.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed-format.returns"></a><h4>Returns</h4>
<p> the data format of the currently parsed item</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-filename"></a><h3>gcr_parser_get_filename ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parser_get_filename (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the filename of the parser item.</p>
<div class="refsect3">
<a name="gcr-parser-get-filename.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-filename.returns"></a><h4>Returns</h4>
<p> the filename set on the parser, or <code class="literal">NULL</code></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-set-filename"></a><h3>gcr_parser_set_filename ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parser_set_filename (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>,
                         <em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>);</pre>
<p>Sets the filename of the parser item.</p>
<div class="refsect3">
<a name="gcr-parser-set-filename.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser item</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>a string of the filename of the parser item. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-ref"></a><h3>gcr_parsed_ref ()</h3>
<pre class="programlisting"><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="returnvalue">GcrParsed</span></a> *
gcr_parsed_ref (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Add a reference to a parsed item. An item may not be shared across threads
until it has been referenced at least once.</p>
<div class="refsect3">
<a name="gcr-parsed-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-ref.returns"></a><h4>Returns</h4>
<p>the parsed item. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-unref"></a><h3>gcr_parsed_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gcr_parsed_unref (<em class="parameter"><code><span class="type">gpointer</span> parsed</code></em>);</pre>
<p>Unreferences a parsed item which was referenced with <a class="link" href="GcrParser.html#gcr-parsed-ref" title="gcr_parsed_ref ()"><code class="function">gcr_parsed_ref()</code></a></p>
<div class="refsect3">
<a name="gcr-parsed-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-attributes"></a><h3>gcr_parsed_get_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">GckAttributes</span> *
gcr_parsed_get_attributes (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the attributes which make up the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-attributes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-attributes.returns"></a><h4>Returns</h4>
<p>the attributes for the item; these
are owned by the parsed item and should not be freed. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-data"></a><h3>gcr_parsed_get_data ()</h3>
<pre class="programlisting">const <span class="returnvalue">guchar</span> *
gcr_parsed_get_data (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>,
                     <em class="parameter"><code><span class="type">gsize</span> *n_data</code></em>);</pre>
<p>Get the raw data block for the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_data</p></td>
<td class="parameter_description"><p>location to store size of returned data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-data.returns"></a><h4>Returns</h4>
<p>the raw data of
the parsed item, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=n_data][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-bytes"></a><h3>gcr_parsed_get_bytes ()</h3>
<pre class="programlisting"><span class="returnvalue">GBytes</span> *
gcr_parsed_get_bytes (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the raw data block for the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-bytes.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-bytes.returns"></a><h4>Returns</h4>
<p>the raw data of the parsed item, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-description"></a><h3>gcr_parsed_get_description ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parsed_get_description (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the descirption for a parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-description.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-description.returns"></a><h4>Returns</h4>
<p>the description. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-format"></a><h3>gcr_parsed_get_format ()</h3>
<pre class="programlisting"><a class="link" href="GcrParser.html#GcrDataFormat" title="enum GcrDataFormat"><span class="returnvalue">GcrDataFormat</span></a>
gcr_parsed_get_format (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the format of the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-format.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-format.returns"></a><h4>Returns</h4>
<p> the data format of the item</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-label"></a><h3>gcr_parsed_get_label ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parsed_get_label (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the label for the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-label.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-label.returns"></a><h4>Returns</h4>
<p>the label for the item. </p>
<p><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parser-get-parsed"></a><h3>gcr_parser_get_parsed ()</h3>
<pre class="programlisting"><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="returnvalue">GcrParsed</span></a> *
gcr_parser_get_parsed (<em class="parameter"><code><a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self</code></em>);</pre>
<p>Get the currently parsed item</p>
<div class="refsect3">
<a name="gcr-parser-get-parsed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>a parser</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parser-get-parsed.returns"></a><h4>Returns</h4>
<p>the currently parsed item. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gcr-parsed-get-filename"></a><h3>gcr_parsed_get_filename ()</h3>
<pre class="programlisting">const <span class="returnvalue">gchar</span> *
gcr_parsed_get_filename (<em class="parameter"><code><a class="link" href="GcrParser.html#GcrParsed" title="GcrParsed"><span class="type">GcrParsed</span></a> *parsed</code></em>);</pre>
<p>Get the filename of the parsed item.</p>
<div class="refsect3">
<a name="gcr-parsed-get-filename.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>parsed</p></td>
<td class="parameter_description"><p>a parsed item</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gcr-parsed-get-filename.returns"></a><h4>Returns</h4>
<p>the filename of
the parsed item, or <code class="literal">NULL</code>. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GcrParser.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GCR-DATA-ERROR:CAPS"></a><h3>GCR_DATA_ERROR</h3>
<pre class="programlisting">#define             GCR_DATA_ERROR                    (gcr_data_error_get_domain ())
</pre>
<p>A domain for data errors with codes from <a class="link" href="GcrParser.html#GcrDataError" title="enum GcrDataError"><span class="type">GcrDataError</span></a></p>
</div>
<hr>
<div class="refsect2">
<a name="GcrDataError"></a><h3>enum GcrDataError</h3>
<p>Values responding to error codes for parsing and serializing data.</p>
<div class="refsect3">
<a name="GcrDataError.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GCR-ERROR-FAILURE:CAPS"></a>GCR_ERROR_FAILURE</p></td>
<td class="enum_member_description">
<p>Failed to parse or serialize the data</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-ERROR-UNRECOGNIZED:CAPS"></a>GCR_ERROR_UNRECOGNIZED</p></td>
<td class="enum_member_description">
<p>The data was unrecognized or unsupported</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-ERROR-CANCELLED:CAPS"></a>GCR_ERROR_CANCELLED</p></td>
<td class="enum_member_description">
<p>The operation was cancelled</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-ERROR-LOCKED:CAPS"></a>GCR_ERROR_LOCKED</p></td>
<td class="enum_member_description">
<p>The data was encrypted or locked and could not be unlocked.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GcrDataFormat"></a><h3>enum GcrDataFormat</h3>
<p>The various format identifiers.</p>
<div class="refsect3">
<a name="GcrDataFormat.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-ALL:CAPS"></a>GCR_FORMAT_ALL</p></td>
<td class="enum_member_description">
<p>Represents all the formats, when enabling or disabling</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-INVALID:CAPS"></a>GCR_FORMAT_INVALID</p></td>
<td class="enum_member_description">
<p>Not a valid format</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PRIVATE-KEY:CAPS"></a>GCR_FORMAT_DER_PRIVATE_KEY</p></td>
<td class="enum_member_description">
<p>DER encoded private key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PRIVATE-KEY-RSA:CAPS"></a>GCR_FORMAT_DER_PRIVATE_KEY_RSA</p></td>
<td class="enum_member_description">
<p>DER encoded RSA private key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PRIVATE-KEY-DSA:CAPS"></a>GCR_FORMAT_DER_PRIVATE_KEY_DSA</p></td>
<td class="enum_member_description">
<p>DER encoded DSA private key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PRIVATE-KEY-EC:CAPS"></a>GCR_FORMAT_DER_PRIVATE_KEY_EC</p></td>
<td class="enum_member_description">
<p>DER encoded EC private key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-SUBJECT-PUBLIC-KEY:CAPS"></a>GCR_FORMAT_DER_SUBJECT_PUBLIC_KEY</p></td>
<td class="enum_member_description">
<p>DER encoded SubjectPublicKeyInfo</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-CERTIFICATE-X509:CAPS"></a>GCR_FORMAT_DER_CERTIFICATE_X509</p></td>
<td class="enum_member_description">
<p>DER encoded X.509 certificate</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS7:CAPS"></a>GCR_FORMAT_DER_PKCS7</p></td>
<td class="enum_member_description">
<p>DER encoded PKCS#7 container file which can contain certificates</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS8:CAPS"></a>GCR_FORMAT_DER_PKCS8</p></td>
<td class="enum_member_description">
<p>DER encoded PKCS#8 file which can contain a key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS8-PLAIN:CAPS"></a>GCR_FORMAT_DER_PKCS8_PLAIN</p></td>
<td class="enum_member_description">
<p>Unencrypted DER encoded PKCS#8 file which can contain a key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS8-ENCRYPTED:CAPS"></a>GCR_FORMAT_DER_PKCS8_ENCRYPTED</p></td>
<td class="enum_member_description">
<p>Encrypted DER encoded PKCS#8 file which can contain a key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS10:CAPS"></a>GCR_FORMAT_DER_PKCS10</p></td>
<td class="enum_member_description">
<p>DER encoded PKCS#10 certificate request file</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-SPKAC:CAPS"></a>GCR_FORMAT_DER_SPKAC</p></td>
<td class="enum_member_description">
<p>DER encoded SPKAC as generated by HTML5 keygen element</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-BASE64-SPKAC:CAPS"></a>GCR_FORMAT_BASE64_SPKAC</p></td>
<td class="enum_member_description">
<p>OpenSSL style SPKAC data</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-DER-PKCS12:CAPS"></a>GCR_FORMAT_DER_PKCS12</p></td>
<td class="enum_member_description">
<p>DER encoded PKCS#12 file which can contain certificates and/or keys</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-OPENSSH-PUBLIC:CAPS"></a>GCR_FORMAT_OPENSSH_PUBLIC</p></td>
<td class="enum_member_description">
<p>OpenSSH v1 or v2 public key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-OPENPGP-PACKET:CAPS"></a>GCR_FORMAT_OPENPGP_PACKET</p></td>
<td class="enum_member_description">
<p>OpenPGP key packet(s)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-OPENPGP-ARMOR:CAPS"></a>GCR_FORMAT_OPENPGP_ARMOR</p></td>
<td class="enum_member_description">
<p>OpenPGP public or private key armor encoded data</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM:CAPS"></a>GCR_FORMAT_PEM</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with unspecified contents</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PRIVATE-KEY-RSA:CAPS"></a>GCR_FORMAT_PEM_PRIVATE_KEY_RSA</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with a private RSA key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PRIVATE-KEY-DSA:CAPS"></a>GCR_FORMAT_PEM_PRIVATE_KEY_DSA</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with a private DSA key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-CERTIFICATE-X509:CAPS"></a>GCR_FORMAT_PEM_CERTIFICATE_X509</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with an X.509 certificate</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PKCS7:CAPS"></a>GCR_FORMAT_PEM_PKCS7</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file containing PKCS#7</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PKCS8-PLAIN:CAPS"></a>GCR_FORMAT_PEM_PKCS8_PLAIN</p></td>
<td class="enum_member_description">
<p>Unencrypted OpenSSL style PEM file containing PKCS#8</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PKCS8-ENCRYPTED:CAPS"></a>GCR_FORMAT_PEM_PKCS8_ENCRYPTED</p></td>
<td class="enum_member_description">
<p>Encrypted OpenSSL style PEM file containing PKCS#8</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PKCS12:CAPS"></a>GCR_FORMAT_PEM_PKCS12</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file containing PKCS#12</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PRIVATE-KEY:CAPS"></a>GCR_FORMAT_PEM_PRIVATE_KEY</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with a private key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PKCS10:CAPS"></a>GCR_FORMAT_PEM_PKCS10</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file containing PKCS#10</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PRIVATE-KEY-EC:CAPS"></a>GCR_FORMAT_PEM_PRIVATE_KEY_EC</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file with a private EC key</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GCR-FORMAT-PEM-PUBLIC-KEY:CAPS"></a>GCR_FORMAT_PEM_PUBLIC_KEY</p></td>
<td class="enum_member_description">
<p>An OpenSSL style PEM file containing a SubjectPublicKeyInfo</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GcrParser-struct"></a><h3>struct GcrParser</h3>
<pre class="programlisting">struct GcrParser;</pre>
<p>A parser for parsing various types of files or data.</p>
</div>
<hr>
<div class="refsect2">
<a name="GcrParserClass"></a><h3>struct GcrParserClass</h3>
<pre class="programlisting">struct GcrParserClass {
	GObjectClass parent_class;

	/* signals --------------------------------------------------------- */

	/* A callback for each password needed */
	gboolean (*authenticate) (GcrParser *self, gint count);

	void     (*parsed) (GcrParser *self);
};
</pre>
<p>The class for <a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a></p>
<div class="refsect3">
<a name="GcrParserClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GcrParserClass.authenticate"></a>authenticate</code></em> ()</p></td>
<td class="struct_member_description"><p>The default handler for the authenticate signal.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GcrParserClass.parsed"></a>parsed</code></em> ()</p></td>
<td class="struct_member_description"><p>The default handler for the parsed signal.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GcrParsed"></a><h3>GcrParsed</h3>
<pre class="programlisting">typedef struct _GcrParsed GcrParsed;</pre>
<p>A parsed item parsed by a <a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a>.</p>
</div>
</div>
<div class="refsect1">
<a name="GcrParser.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GcrParser--parsed-attributes"></a><h3>The <code class="literal">“parsed-attributes”</code> property</h3>
<pre class="programlisting">  “parsed-attributes”        <span class="type">GckAttributes</span> *</pre>
<p>Get the attributes that make up the currently parsed item. This is
generally only valid during a <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<p>Flags: Read</p>
</div>
<hr>
<div class="refsect2">
<a name="GcrParser--parsed-description"></a><h3>The <code class="literal">“parsed-description”</code> property</h3>
<pre class="programlisting">  “parsed-description”       <span class="type">gchar</span> *</pre>
<p>The description of the type of the currently parsed item. This is generally
only valid during a <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<p>Flags: Read</p>
<p>Default value: ""</p>
</div>
<hr>
<div class="refsect2">
<a name="GcrParser--parsed-label"></a><h3>The <code class="literal">“parsed-label”</code> property</h3>
<pre class="programlisting">  “parsed-label”             <span class="type">gchar</span> *</pre>
<p>The label of the currently parsed item. This is generally
only valid during a <a class="link" href="GcrParser.html#GcrParser-parsed" title="The “parsed” signal"><span class="type">“parsed”</span></a> signal.</p>
<p>Flags: Read</p>
<p>Default value: ""</p>
</div>
</div>
<div class="refsect1">
<a name="GcrParser.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GcrParser-authenticate"></a><h3>The <code class="literal">“authenticate”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
user_function (<a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self,
               <span class="type">gint</span>       count,
               <span class="type">gpointer</span>   user_data)</pre>
<p>This signal is emitted when an item needs to be unlocked or decrypted before
it can be parsed. The <em class="parameter"><code>count</code></em>
 argument specifies the number of times
the signal has been emitted for a given item. This can be used to
display a message saying the previous password was incorrect.</p>
<p>Typically the <a class="link" href="GcrParser.html#gcr-parser-add-password" title="gcr_parser_add_password ()"><code class="function">gcr_parser_add_password()</code></a> function is called in
response to this signal.</p>
<p>If <code class="literal">FALSE</code> is returned, then the authentication was not handled. If
no handlers return <code class="literal">TRUE</code> then the item is not parsed and an error
with the code <a class="link" href="GcrParser.html#GCR-ERROR-CANCELLED:CAPS"><code class="literal">GCR_ERROR_CANCELLED</code></a> will be raised.</p>
<div class="refsect3">
<a name="GcrParser-authenticate.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>count</p></td>
<td class="parameter_description"><p>the number of times this item has been authenticated</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GcrParser-authenticate.returns"></a><h4>Returns</h4>
<p> Whether the authentication was handled.</p>
</div>
<p>Flags: Run Last</p>
</div>
<hr>
<div class="refsect2">
<a name="GcrParser-parsed"></a><h3>The <code class="literal">“parsed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GcrParser.html" title="GcrParser"><span class="type">GcrParser</span></a> *self,
               <span class="type">gpointer</span>   user_data)</pre>
<p>This signal is emitted when an item is sucessfully parsed. To access
the information about the item use the <a class="link" href="GcrParser.html#gcr-parser-get-parsed-label" title="gcr_parser_get_parsed_label ()"><code class="function">gcr_parser_get_parsed_label()</code></a>,
<a class="link" href="GcrParser.html#gcr-parser-get-parsed-attributes" title="gcr_parser_get_parsed_attributes ()"><code class="function">gcr_parser_get_parsed_attributes()</code></a> and <a class="link" href="GcrParser.html#gcr-parser-get-parsed-description" title="gcr_parser_get_parsed_description ()"><code class="function">gcr_parser_get_parsed_description()</code></a>
functions.</p>
<div class="refsect3">
<a name="GcrParser-parsed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>self</p></td>
<td class="parameter_description"><p>the parser</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run First</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27.1</div>
</body>
</html>