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>GckAttribute: Gck Library Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="Gck Library Reference Manual">
<link rel="up" href="reference.html" title="PKCS#11 GObject Bindings">
<link rel="prev" href="GckObject.html" title="GckObject">
<link rel="next" href="GckAttributes.html" title="GckAttributes">
<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="#gck-GckAttribute.description" class="shortcut">Description</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="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GckObject.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GckAttributes.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gck-GckAttribute"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gck-GckAttribute.top_of_page"></a>GckAttribute</span></h2>
<p>GckAttribute — A PKCS11 attribute.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gck-GckAttribute.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">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-is-invalid" title="gck_attribute_is_invalid ()">gck_attribute_is_invalid</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="gck-GckAttribute.html#gck-attribute-get-boolean" title="gck_attribute_get_boolean ()">gck_attribute_get_boolean</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gulong</span>
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-get-ulong" title="gck_attribute_get_ulong ()">gck_attribute_get_ulong</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gchar</span> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-get-string" title="gck_attribute_get_string ()">gck_attribute_get_string</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="gck-GckAttribute.html#gck-attribute-get-date" title="gck_attribute_get_date ()">gck_attribute_get_date</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="gck-GckAttribute.html#gck-attribute-get-data" title="gck_attribute_get_data ()">gck_attribute_get_data</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="gck-GckAttribute.html#gck-attribute-dump" title="gck_attribute_dump ()">gck_attribute_dump</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="gck-GckAttribute.html#gck-attribute-equal" title="gck_attribute_equal ()">gck_attribute_equal</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">guint</span>
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-hash" title="gck_attribute_hash ()">gck_attribute_hash</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="gck-GckAttribute.html#gck-attribute-init" title="gck_attribute_init ()">gck_attribute_init</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="gck-GckAttribute.html#gck-attribute-init-boolean" title="gck_attribute_init_boolean ()">gck_attribute_init_boolean</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="gck-GckAttribute.html#gck-attribute-init-date" title="gck_attribute_init_date ()">gck_attribute_init_date</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="gck-GckAttribute.html#gck-attribute-init-string" title="gck_attribute_init_string ()">gck_attribute_init_string</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="gck-GckAttribute.html#gck-attribute-init-ulong" title="gck_attribute_init_ulong ()">gck_attribute_init_ulong</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="gck-GckAttribute.html#gck-attribute-init-empty" title="gck_attribute_init_empty ()">gck_attribute_init_empty</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="gck-GckAttribute.html#gck-attribute-init-invalid" title="gck_attribute_init_invalid ()">gck_attribute_init_invalid</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="gck-GckAttribute.html#gck-attribute-init-copy" title="gck_attribute_init_copy ()">gck_attribute_init_copy</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new" title="gck_attribute_new ()">gck_attribute_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-boolean" title="gck_attribute_new_boolean ()">gck_attribute_new_boolean</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-date" title="gck_attribute_new_date ()">gck_attribute_new_date</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-string" title="gck_attribute_new_string ()">gck_attribute_new_string</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-ulong" title="gck_attribute_new_ulong ()">gck_attribute_new_ulong</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-empty" title="gck_attribute_new_empty ()">gck_attribute_new_empty</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-new-invalid" title="gck_attribute_new_invalid ()">gck_attribute_new_invalid</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
</td>
<td class="function_name">
<a class="link" href="gck-GckAttribute.html#gck-attribute-dup" title="gck_attribute_dup ()">gck_attribute_dup</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="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()">gck_attribute_clear</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="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()">gck_attribute_free</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gck-GckAttribute.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="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute">GckAttribute</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gck-GckAttribute.description"></a><h2>Description</h2>
<p>This structure represents a PKCS11 CK_ATTRIBUTE. These attributes contain i
about a PKCS11 object. Use <a class="link" href="GckObject.html#gck-object-get" title="gck_object_get ()"><code class="function">gck_object_get()</code></a> or <a class="link" href="GckObject.html#gck-object-set" title="gck_object_set ()"><code class="function">gck_object_set()</code></a> to set and
attributes on an object.</p>
<p>Although you are free to allocate a <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> in your own code, no functions in
this library will operate on such an attribute.</p>
</div>
<div class="refsect1">
<a name="gck-GckAttribute.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gck-attribute-is-invalid"></a><h3>gck_attribute_is_invalid ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gck_attribute_is_invalid (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Check if the PKCS#11 attribute represents 'invalid' or 'not found'
according to the PKCS#11 spec. That is, having length
of (CK_ULONG)-1.</p>
<div class="refsect3">
<a name="gck-attribute-is-invalid.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>attr</p></td>
<td class="parameter_description"><p>The attribute to check.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-is-invalid.returns"></a><h4>Returns</h4>
<p> Whether the attribute represents invalid or not.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-get-boolean"></a><h3>gck_attribute_get_boolean ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gck_attribute_get_boolean (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Get the CK_BBOOL of a PKCS#11 attribute. No conversion
is performed. It is an error to pass an attribute to this
function unless you're know it's supposed to contain a
boolean value.</p>
<div class="refsect3">
<a name="gck-attribute-get-boolean.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>attr</p></td>
<td class="parameter_description"><p>The attribute to retrieve value from.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-get-boolean.returns"></a><h4>Returns</h4>
<p> The boolean value of the attribute.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-get-ulong"></a><h3>gck_attribute_get_ulong ()</h3>
<pre class="programlisting"><span class="returnvalue">gulong</span>
gck_attribute_get_ulong (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Get the CK_ULONG value of a PKCS#11 attribute. No
conversion is performed. It is an error to pass an attribute
to this function unless you're know it's supposed to contain
a value of the right type.</p>
<div class="refsect3">
<a name="gck-attribute-get-ulong.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>attr</p></td>
<td class="parameter_description"><p>The attribute to retrieve value from.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-get-ulong.returns"></a><h4>Returns</h4>
<p> The ulong value of the attribute.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-get-string"></a><h3>gck_attribute_get_string ()</h3>
<pre class="programlisting"><span class="returnvalue">gchar</span> *
gck_attribute_get_string (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Get the string value of a PKCS#11 attribute. No
conversion is performed. It is an error to pass an attribute
to this function unless you're know it's supposed to contain
a value of the right type.</p>
<div class="refsect3">
<a name="gck-attribute-get-string.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>attr</p></td>
<td class="parameter_description"><p>The attribute to retrieve value from.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-get-string.returns"></a><h4>Returns</h4>
<p>a null terminated string, to be freed with
<code class="function">g_free()</code>, or <code class="literal">NULL</code> if the value was invalid. </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="gck-attribute-get-date"></a><h3>gck_attribute_get_date ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_get_date (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                        <em class="parameter"><code><span class="type">GDate</span> *value</code></em>);</pre>
<p>Get the CK_DATE of a PKCS#11 attribute. No
conversion is performed. It is an error to pass an attribute
to this function unless you're know it's supposed to contain
a value of the right type.</p>
<div class="refsect3">
<a name="gck-attribute-get-date.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>attr</p></td>
<td class="parameter_description"><p>The attribute to retrieve value from.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>The date value to fill in with the parsed date.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-get-data"></a><h3>gck_attribute_get_data ()</h3>
<pre class="programlisting">const <span class="returnvalue">guchar</span> *
gck_attribute_get_data (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                        <em class="parameter"><code><span class="type">gsize</span> *length</code></em>);</pre>
<p>Get the raw value in the attribute.</p>
<p>This is useful from scripting languages. C callers will generally
access the <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> struct directly.</p>
<p>This function will <code class="literal">NULL</code> if the attribute contains empty or invalid
data. The returned data must not be modified and is only valid
as long as this <em class="parameter"><code>attribute</code></em>
.</p>
<div class="refsect3">
<a name="gck-attribute-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>attr</p></td>
<td class="parameter_description"><p>an attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the length of the returned data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-get-data.returns"></a><h4>Returns</h4>
<p>the value data 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=length]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-dump"></a><h3>gck_attribute_dump ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_dump (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Dump the specified attribute using <code class="function">g_printerr()</code>.</p>
<div class="refsect3">
<a name="gck-attribute-dump.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>attr</p></td>
<td class="parameter_description"><p>The attribute</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-equal"></a><h3>gck_attribute_equal ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gck_attribute_equal (<em class="parameter"><code><span class="type">gconstpointer</span> attr1</code></em>,
                     <em class="parameter"><code><span class="type">gconstpointer</span> attr2</code></em>);</pre>
<p>Compare two attributes. Useful with <code class="code">GHashTable</code>.</p>
<div class="refsect3">
<a name="gck-attribute-equal.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>attr1</p></td>
<td class="parameter_description"><p>first attribute to compare. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> Gck.Attribute]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>attr2</p></td>
<td class="parameter_description"><p>second attribute to compare. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> Gck.Attribute]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-equal.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if the attributes are equal.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-hash"></a><h3>gck_attribute_hash ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span>
gck_attribute_hash (<em class="parameter"><code><span class="type">gconstpointer</span> attr</code></em>);</pre>
<p>Hash an attribute for use in <code class="code">GHashTable</code> keys.</p>
<div class="refsect3">
<a name="gck-attribute-hash.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>attr</p></td>
<td class="parameter_description"><p>attribute to hash. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> Gck.Attribute]</span></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-hash.returns"></a><h4>Returns</h4>
<p> the hash code</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init"></a><h3>gck_attribute_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                    <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                    <em class="parameter"><code>const <span class="type">guchar</span> *value</code></em>,
                    <em class="parameter"><code><span class="type">gsize</span> length</code></em>);</pre>
<p>Initialize a PKCS#11 attribute. This copies the value memory
into an internal buffer.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>The raw value of the attribute. </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=length]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>The length of the raw value.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-boolean"></a><h3>gck_attribute_init_boolean ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_boolean (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                            <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                            <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to boolean. This will result
in a CK_BBOOL attribute from the PKCS#11 specs.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-boolean.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the boolean value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-date"></a><h3>gck_attribute_init_date ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_date (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                         <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                         <em class="parameter"><code>const <span class="type">GDate</span> *value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a date. This will result
in a CK_DATE attribute from the PKCS#11 specs.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-date.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the date value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-string"></a><h3>gck_attribute_init_string ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_string (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                           <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                           <em class="parameter"><code>const <span class="type">gchar</span> *value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a string. This will result
in an attribute containing the text, but not the null terminator.
The text in the attribute will be of the same encoding as you pass
to this function.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-string.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the null terminated string value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-ulong"></a><h3>gck_attribute_init_ulong ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_ulong (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                          <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                          <em class="parameter"><code><span class="type">gulong</span> value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a unsigned long. This will result
in a CK_ULONG attribute from the PKCS#11 specs.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-ulong.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the ulong value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-empty"></a><h3>gck_attribute_init_empty ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_empty (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                          <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to an empty state. The attribute
type will be set, but no data will be set.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-empty.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-invalid"></a><h3>gck_attribute_init_invalid ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_invalid (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>,
                            <em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to an 'invalid' or 'not found'
state. Specifically this sets the value length to (CK_ULONG)-1
as specified in the PKCS#11 specification.</p>
<p>When done with the attribute you should use <a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a>
to free the internal memory.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gck-attribute-init-invalid.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>attr</p></td>
<td class="parameter_description"><p>an uninitialized attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-init-copy"></a><h3>gck_attribute_init_copy ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_init_copy (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *dest</code></em>,
                         <em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *src</code></em>);</pre>
<p>Initialize a PKCS#11 attribute as a copy of another attribute.
This copies the value memory as well.</p>
<p>When done with the copied attribute you should use
<a class="link" href="gck-GckAttribute.html#gck-attribute-clear" title="gck_attribute_clear ()"><code class="function">gck_attribute_clear()</code></a> to free the internal memory.</p>
<div class="refsect3">
<a name="gck-attribute-init-copy.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>dest</p></td>
<td class="parameter_description"><p>An uninitialized attribute.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>src</p></td>
<td class="parameter_description"><p>An attribute to copy.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-new"></a><h3>gck_attribute_new ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                   <em class="parameter"><code>const <span class="type">guchar</span> *value</code></em>,
                   <em class="parameter"><code><span class="type">gsize</span> length</code></em>);</pre>
<p>Create a new PKCS#11 attribute. The value will be copied
into the new attribute.</p>
<div class="refsect3">
<a name="gck-attribute-new.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the raw value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>length</p></td>
<td class="parameter_description"><p>the length of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute
use <a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-boolean"></a><h3>gck_attribute_new_boolean ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_boolean (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                           <em class="parameter"><code><span class="type">gboolean</span> value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to boolean. This will result
in a CK_BBOOL attribute from the PKCS#11 specs.</p>
<div class="refsect3">
<a name="gck-attribute-new-boolean.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the boolean value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-boolean.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute u
<a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-date"></a><h3>gck_attribute_new_date ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_date (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                        <em class="parameter"><code>const <span class="type">GDate</span> *value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a date. This will result
in a CK_DATE attribute from the PKCS#11 specs.</p>
<div class="refsect3">
<a name="gck-attribute-new-date.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the date value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-date.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute u
<a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-string"></a><h3>gck_attribute_new_string ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_string (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                          <em class="parameter"><code>const <span class="type">gchar</span> *value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a string. This will result
in an attribute containing the text, but not the null terminator.
The text in the attribute will be of the same encoding as you pass
to this function.</p>
<div class="refsect3">
<a name="gck-attribute-new-string.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the null-terminated string value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-string.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute u
<a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-ulong"></a><h3>gck_attribute_new_ulong ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_ulong (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>,
                         <em class="parameter"><code><span class="type">gulong</span> value</code></em>);</pre>
<p>Initialize a PKCS#11 attribute to a unsigned long. This will result
in a CK_ULONG attribute from the PKCS#11 specs.</p>
<div class="refsect3">
<a name="gck-attribute-new-ulong.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>the ulong value of the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-ulong.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute u
<a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-empty"></a><h3>gck_attribute_new_empty ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_empty (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>);</pre>
<p>Create a new PKCS#11 attribute with empty data.</p>
<div class="refsect3">
<a name="gck-attribute-new-empty.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-empty.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute
use <a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-new-invalid"></a><h3>gck_attribute_new_invalid ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_new_invalid (<em class="parameter"><code><span class="type">gulong</span> attr_type</code></em>);</pre>
<p>Create a new PKCS#11 attribute as 'invalid' or 'not found'
state. Specifically this sets the value length to (CK_ULONG)-1
as specified in the PKCS#11 specification.</p>
<div class="refsect3">
<a name="gck-attribute-new-invalid.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>attr_type</p></td>
<td class="parameter_description"><p>the PKCS#11 attribute type to set on the attribute</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-new-invalid.returns"></a><h4>Returns</h4>
<p>the new attribute; when done with the attribute
use <a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a> to free it. </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="gck-attribute-dup"></a><h3>gck_attribute_dup ()</h3>
<pre class="programlisting"><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="returnvalue">GckAttribute</span></a> *
gck_attribute_dup (<em class="parameter"><code>const <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Duplicate the PKCS#11 attribute. All value memory is
also copied.</p>
<p>The <em class="parameter"><code>attr</code></em>
 must have been allocated or initialized by a Gck function or
the results of this function are undefined.</p>
<div class="refsect3">
<a name="gck-attribute-dup.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>attr</p></td>
<td class="parameter_description"><p>the attribute to duplicate</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gck-attribute-dup.returns"></a><h4>Returns</h4>
<p>the duplicated attribute; use <a class="link" href="gck-GckAttribute.html#gck-attribute-free" title="gck_attribute_free ()"><code class="function">gck_attribute_free()</code></a>
to free it. </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="gck-attribute-clear"></a><h3>gck_attribute_clear ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_clear (<em class="parameter"><code><a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a> *attr</code></em>);</pre>
<p>Clear allocated memory held by a <a class="link" href="gck-GckAttribute.html#GckAttribute" title="struct GckAttribute"><span class="type">GckAttribute</span></a>.</p>
<p>This attribute must have been allocated by a Gck library function, or
the results of this method are undefined.</p>
<p>The type of the attribute will remain set.</p>
<div class="refsect3">
<a name="gck-attribute-clear.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>attr</p></td>
<td class="parameter_description"><p>Attribute to clear.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gck-attribute-free"></a><h3>gck_attribute_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gck_attribute_free (<em class="parameter"><code><span class="type">gpointer</span> attr</code></em>);</pre>
<p>Free an attribute and its allocated memory. These is usually
used with attributes that are allocated by <a class="link" href="gck-GckAttribute.html#gck-attribute-new" title="gck_attribute_new ()"><code class="function">gck_attribute_new()</code></a>
or a similar function.</p>
<div class="refsect3">
<a name="gck-attribute-free.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>attr</p></td>
<td class="parameter_description"><p>attribute to free. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> Gck.Attribute]</span></td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="gck-GckAttribute.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GckAttribute"></a><h3>struct GckAttribute</h3>
<pre class="programlisting">struct GckAttribute {
	gulong type;
	guchar *value;
	gulong length;
};
</pre>
<p>This structure represents a PKCS11 CK_ATTRIBUTE.</p>
<div class="refsect3">
<a name="GckAttribute.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><span class="type">gulong</span> <em class="structfield"><code><a name="GckAttribute.type"></a>type</code></em>;</p></td>
<td class="struct_member_description"><p>The attribute type, such as CKA_LABEL.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">guchar</span> *<em class="structfield"><code><a name="GckAttribute.value"></a>value</code></em>;</p></td>
<td class="struct_member_description"><p>The value of the attribute. May be NULL. </p></td>
<td class="struct_member_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length]</span></td>
</tr>
<tr>
<td class="struct_member_name"><p><span class="type">gulong</span> <em class="structfield"><code><a name="GckAttribute.length"></a>length</code></em>;</p></td>
<td class="struct_member_description"><p>The length of the attribute. May be GCK_INVALID if the attribute is invalid.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27.1</div>
</body>
</html>