Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > 96446e1d4700c9b725717a3531e0ff36 > files > 14

libopencdk8-devel-0.5.3-1mdk.i586.rpm



<a name="cdk_armor_filter_use">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_armor_filter_use</b>
(<i>cdk_stream_t</i> <b>inp</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>inp</b>
<dd> the stream to check
</dl>
<h3>Description</h3>
<ul>
Check if the stream contains armored data.
</ul>
<hr>


<a name="cdk_file_armor">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_armor</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> Handle
<dt><i>const char *</i> <b>file</b>
<dd> Name of the file to protect.
<dt><i>const char *</i> <b>output</b>
<dd> Output filename.
</dl>
<h3>Description</h3>
<ul>
Protect a file with ASCII armor.
</ul>
<hr>


<a name="cdk_file_dearmor">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_dearmor</b>
(<i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>file</b>
<dd> Name of the file to unprotect.
<dt><i>const char *</i> <b>output</b>
<dd> Output filename.
</dl>
<h3>Description</h3>
<ul>
Remove ASCII armor from a file.
</ul>
<hr>


<a name="cdk_stream_encrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_encrypt</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>cdk_stream_t</i> <b>inp</b>
, <i>cdk_stream_t</i> <b>out</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> Handle
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd> List of recipients
<dt><i>cdk_stream_t</i> <b>inp</b>
<dd> Input stream handle
<dt><i>cdk_stream_t</i> <b>out</b>
<dd> Output stream handle
</dl>
<h3>Description</h3>
<ul>
If remusr is NULL, then symmetric encryption is used. Via the
handle the caller can set or unset multiple options.
</ul>
<hr>


<a name="cdk_file_encrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_encrypt</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> Handle
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd> List of recipient
<dt><i>const char *</i> <b>file</b>
<dd> Input file
<dt><i>const char *</i> <b>output</b>
<dd> Output file
</dl>
<hr>


<a name="cdk_file_decrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_decrypt</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> Handle.
<dt><i>const char *</i> <b>file</b>
<dd> Name of the file to decrypt.
<dt><i>const char *</i> <b>output</b>
<dd> Output filename.
</dl>
<h3>Description</h3>
<ul>
When the operation was successfull, hd can contain information about
the signature (when present) and more.
</ul>
<hr>


<a name="cdk_data_transform">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_data_transform</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>enum cdk_crypto_mode_t</i> <b>mode</b>
, <i>cdk_strlist_t</i> <b>locusr</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>const void *</i> <b>inbuf</b>
, <i>size_t</i> <b>insize</b>
, <i>byte **</i> <b>outbuf</b>
, <i>size_t *</i> <b>outsize</b>
, <i>int</i> <b>modval</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>enum cdk_crypto_mode_t</i> <b>mode</b>
<dd> crypto mode
<dt><i>cdk_strlist_t</i> <b>locusr</b>
<dd> local user list (sign mode only)
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd> remote users 'recipients'
<dt><i>const void *</i> <b>inbuf</b>
<dd> input buffer with data
<dt><i>size_t</i> <b>insize</b>
<dd> length of data in bytes
<dt><i>byte **</i> <b>outbuf</b>
<dd> pointer to the output data (will be allocated)
<dt><i>size_t *</i> <b>outsize</b>
<dd> size of the new data in bytes
<dt><i>int</i> <b>modval</b>
<dd> value for the modus (for example sign mode)
</dl>
<h3>Description</h3>
<ul>
This function transforms data into the given openpgp mode. It works
exactly like the cdk_file_xxx functions with the exception that it can
be used with memory and not with streams or files.
</ul>
<hr>


<a name="cdk_kbnode_new">&nbsp</a><h2>Function</h2>
<i>cdk_kbnode_t</i>
<b>cdk_kbnode_new</b>
(<i>cdk_packet_t</i> <b>pkt</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_packet_t</i> <b>pkt</b>
<dd> the packet to add
</dl>
<h3>Description</h3>
<ul>
Allocate a new key node and add the packet.
</ul>
<hr>


<a name="cdk_kbnode_release">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_kbnode_release</b>
(<i>cdk_kbnode_t</i> <b>node</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd></dl>
<h3>Description</h3>
<ul>
Release the memory of the node.
</ul>
<hr>


<a name="cdk_kbnode_delete">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_kbnode_delete</b>
(<i>cdk_kbnode_t</i> <b>node</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the ke keynode.
</dl>
<h3>Description</h3>
<ul>
Delete @node.
</ul>
<hr>


<a name="cdk_kbnode_insert">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_kbnode_insert</b>
(<i>cdk_kbnode_t</i> <b>root</b>
, <i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>root</b>
<dd> the root key node
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the node to add
<dt><i>int</i> <b>pkttype</b>
<dd> packet type
</dl>
<h3>Description</h3>
<ul>
Insert @node into the list after @root but before a packet which is not of
type @pkttype (only if @pkttype != 0).
</ul>
<hr>


<a name="cdk_kbnode_find_prev">&nbsp</a><h2>Function</h2>
<i>cdk_kbnode_t</i>
<b>cdk_kbnode_find_prev</b>
(<i>cdk_kbnode_t</i> <b>root</b>
, <i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>root</b>
<dd> the root key node
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>int</i> <b>pkttype</b>
<dd> packet type
</dl>
<h3>Description</h3>
<ul>
Find the previous node (if @pkttype = 0) or the previous node
with pkttype @pkttype in the list starting with @root of @node.
</ul>
<hr>


<a name="cdk_kbnode_find_next">&nbsp</a><h2>Function</h2>
<i>cdk_kbnode_t</i>
<b>cdk_kbnode_find_next</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>int</i> <b>pkttype</b>
<dd> packet type
</dl>
<h3>Description</h3>
<ul>
Ditto, but find the next packet.  The behaviour is trivial if
@pkttype is 0 but if it is specified, the next node with a packet
of this type is returned.  The function has some knowledge about
</ul>
<h3>the valid ordering of packets</h3>
<ul>
 e.g. if the next signature packet
is requested, the function will not return one if it encounters
a user-id.
</ul>
<hr>


<a name="cdk_kbnode_find">&nbsp</a><h2>Function</h2>
<i>cdk_kbnode_t</i>
<b>cdk_kbnode_find</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>int</i> <b>pkttype</b>
<dd> packet type
</dl>
<h3>Description</h3>
<ul>
Try to find the next node with the packettype @pkttype.
</ul>
<hr>


<a name="cdk_kbnode_find_packet">&nbsp</a><h2>Function</h2>
<i>cdk_packet_t</i>
<b>cdk_kbnode_find_packet</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>int</i> <b>pkttype</b>
<dd> packet type
</dl>
<h3>Description</h3>
<ul>
Same as cdk_kbnode_find but it returns the packet instead of the node.
</ul>
<hr>


<a name="cdk_kbnode_get_packet">&nbsp</a><h2>Function</h2>
<i>cdk_packet_t</i>
<b>cdk_kbnode_get_packet</b>
(<i>cdk_kbnode_t</i> <b>node</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
</dl>
<h3>Description</h3>
<ul>
Return the packet which is stored inside the node in @node.
</ul>
<hr>


<a name="cdk_kbnode_read_from_mem">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_kbnode_read_from_mem</b>
(<i>cdk_kbnode_t *</i> <b>ret_node</b>
, <i>const byte *</i> <b>buf</b>
, <i>size_t</i> <b>buflen</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t *</i> <b>ret_node</b>
<dd> the new key node
<dt><i>const byte *</i> <b>buf</b>
<dd> the buffer which stores the key sequence
<dt><i>size_t</i> <b>buflen</b>
<dd> the length of the buffer
</dl>
<h3>Description</h3>
<ul>
Try to read a key node from the memory buffer @buf.
</ul>
<hr>


<a name="cdk_kbnode_write_to_mem">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_kbnode_write_to_mem</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>byte *</i> <b>buf</b>
, <i>size_t *</i> <b>r_nbytes</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>byte *</i> <b>buf</b>
<dd> the buffer to store the node data
<dt><i>size_t *</i> <b>r_nbytes</b>
<dd> the new length of the buffer.
</dl>
<h3>Description</h3>
<ul>
Try to write the contents of the key node to the buffer @buf and
return the length of it in @r_nbytes. If buf is zero, only the
length of the node is calculated and returned in @r_nbytes.
</ul>
<hr>


<a name="cdk_kbnode_get_attr">&nbsp</a><h2>Function</h2>
<i>void *</i>
<b>cdk_kbnode_get_attr</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>int</i> <b>pkttype</b>
, <i>int</i> <b>attr</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>int</i> <b>pkttype</b>
<dd> the packet type which the attribute should be retrieved from
<dt><i>int</i> <b>attr</b>
<dd> the attribute to retrive
</dl>
<h3>Description</h3>
<ul>
Extract a single attribute from the specified packet type. If no
packet type is given, it is assumed that the public key is meant.
If the attr was found, it is returned as a pointer which can be cast
to a proper type.
</ul>
<hr>


<a name="cdk_kbnode_hash">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_kbnode_hash</b>
(<i>cdk_kbnode_t</i> <b>node</b>
, <i>cdk_md_hd_t</i> <b>md</b>
, <i>int</i> <b>is_v4</b>
, <i>int</i> <b>pkttype</b>
, <i>int</i> <b>flags</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>node</b>
<dd> the key node
<dt><i>cdk_md_hd_t</i> <b>md</b>
<dd><dt><i>int</i> <b>is_v4</b>
<dd> OpenPGP signature (yes=1, no=0)
<dt><i>int</i> <b>pkttype</b>
<dd> packet type to hash (if zero use the packet type from the node)
<dt><i>int</i> <b>flags</b>
<dd> flags which depend on the operation
</dl>
<h3>Description</h3>
<ul>
Hash the key node contents. Two modes are supported. If the packet
type is used (!= 0) then the function searches the first node with
this type. Otherwise the node is seen as a single node and the type
is extracted from it.
</ul>
<hr>


<a name="cdk_keydb_idx_rebuild">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keydb_idx_rebuild</b>
(<i>cdk_keydb_hd_t</i> <b>hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> key database handle
</dl>
<h3>Description</h3>
<ul>
Rebuild the key index files for the given key database.
</ul>
<hr>


<a name="cdk_keydb_new">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keydb_new</b>
(<i>cdk_keydb_hd_t *</i> <b>r_hd</b>
, <i>int</i> <b>type</b>
, <i>void *</i> <b>data</b>
, <i>size_t</i> <b>count</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t *</i> <b>r_hd</b>
<dd> handle to store the new keydb object
<dt><i>int</i> <b>type</b>
<dd> type of the keyring
<dt><i>void *</i> <b>data</b>
<dd> data which depends on the keyring type
<dt><i>size_t</i> <b>count</b>
<dd> length of the data
</dl>
<h3>Description</h3>
<ul>
Create a new keydb object
</ul>
<hr>


<a name="cdk_keydb_free">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_keydb_free</b>
(<i>cdk_keydb_hd_t</i> <b>hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> the keydb object
</dl>
<h3>Description</h3>
<ul>
Free the keydb object.
</ul>
<hr>


<a name="cdk_keydb_open">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keydb_open</b>
(<i>cdk_keydb_hd_t</i> <b>hd</b>
, <i>cdk_stream_t *</i> <b>ret_kr</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> keydb object
<dt><i>cdk_stream_t *</i> <b>ret_kr</b>
<dd> the STREAM object which contains the data of the keyring
</dl>
<h3>Description</h3>
<ul>
Open a STREAM with the contents of the keyring from @hd
</ul>
<hr>


<a name="cdk_keydb_search_start">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keydb_search_start</b>
(<i>cdk_keydb_hd_t</i> <b>db</b>
, <i>int</i> <b>type</b>
, <i>void *</i> <b>desc</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t</i> <b>db</b>
<dd> key database handle
<dt><i>int</i> <b>type</b>
<dd> specifies the search type
<dt><i>void *</i> <b>desc</b>
<dd> description which depends on the type
</dl>
<h3>Description</h3>
<ul>
Create a new keydb search object.
</ul>
<hr>


<a name="cdk_keydb_search">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keydb_search</b>
(<i>cdk_keydb_hd_t</i> <b>hd</b>
, <i>cdk_kbnode_t *</i> <b>ret_key</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> the keydb object
<dt><i>cdk_kbnode_t *</i> <b>ret_key</b>
<dd> kbnode object to store the key
</dl>
<h3>Description</h3>
<ul>
Search for a key in the given keyring. The search mode is handled
via @ks. If the key was found, @ret_key contains the key data.
</ul>
<hr>


<a name="cdk_listkey_start">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_listkey_start</b>
(<i>cdk_listkey_t *</i> <b>r_ctx</b>
, <i>cdk_keydb_hd_t</i> <b>db</b>
, <i>const char *</i> <b>patt</b>
, <i>cdk_strlist_t</i> <b>fpatt</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_listkey_t *</i> <b>r_ctx</b>
<dd> pointer to store the new context
<dt><i>cdk_keydb_hd_t</i> <b>db</b>
<dd> the key database handle
<dt><i>const char *</i> <b>patt</b>
<dd> string pattern
<dt><i>cdk_strlist_t</i> <b>fpatt</b>
<dd> recipients from a stringlist to show
</dl>
<h3>Description</h3>
<ul>
Prepare a key listing with the given parameters. Two modes are supported.
The first mode uses string pattern to determine if the key should be
returned or not. The other mode uses a string list to request the key
which should be listed.
</ul>
<hr>


<a name="cdk_listkey_close">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_listkey_close</b>
(<i>cdk_listkey_t</i> <b>ctx</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_listkey_t</i> <b>ctx</b>
<dd> the list key context
</dl>
<h3>Description</h3>
<ul>
Free the list key context.
</ul>
<hr>


<a name="cdk_listkey_next">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_listkey_next</b>
(<i>cdk_listkey_t</i> <b>ctx</b>
, <i>cdk_kbnode_t *</i> <b>ret_key</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_listkey_t</i> <b>ctx</b>
<dd> list key context
<dt><i>cdk_kbnode_t *</i> <b>ret_key</b>
<dd></dl>
<h3>Description</h3>
<ul>
Retrieve the next key from the pattern of the key list context.
</ul>
<hr>


<a name="cdk_keygen_set_prefs">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keygen_set_prefs</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>enum cdk_pref_type_t</i> <b>type</b>
, <i>const byte *</i> <b>array</b>
, <i>size_t</i> <b>n</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the preference type
<dt><i>enum cdk_pref_type_t</i> <b>type</b>
<dd><dt><i>const byte *</i> <b>array</b>
<dd> one-octet array with algorithm numers
<dt><i>size_t</i> <b>n</b>
<dd></dl>
<hr>


<a name="cdk_keygen_set_name">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_keygen_set_name</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>const char *</i> <b>name</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the keygen object
<dt><i>const char *</i> <b>name</b>
<dd> name
</dl>
<h3>Description</h3>
<ul>
The name will be encoded in UTF8 to avoid problems.
</ul>
<hr>


<a name="cdk_keygen_set_algo_info">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keygen_set_algo_info</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>int</i> <b>type</b>
, <i>enum cdk_pk_algo_t</i> <b>algo</b>
, <i>int</i> <b>bits</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the keygen object.
<dt><i>int</i> <b>type</b>
<dd> key type (primary=0, subkey=1)
<dt><i>enum cdk_pk_algo_t</i> <b>algo</b>
<dd> algorithm compliant with rfc2440
<dt><i>int</i> <b>bits</b>
<dd> lengt of the key in bits
</dl>
<hr>


<a name="cdk_keygen_set_mdc_feature">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_keygen_set_mdc_feature</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>int</i> <b>val</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> keygen object
<dt><i>int</i> <b>val</b>
<dd> boolean( yes=1, no=0)
</dl>
<h3>Description</h3>
<ul>
if you want a RFC2440 compliant key, you've to disable this feature
until the rfc2440-bis8 becomes the next standard.
</ul>
<hr>


<a name="cdk_keygen_set_expire_date">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_keygen_set_expire_date</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>int</i> <b>type</b>
, <i>long</i> <b>timestamp</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> keygen object
<dt><i>int</i> <b>type</b>
<dd> key type( 0=primary, 1=seconardy)
<dt><i>long</i> <b>timestamp</b>
<dd> the date the key should expire
</dl>
<hr>


<a name="cdk_keygen_start">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keygen_start</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the keygen object
</dl>
<hr>


<a name="cdk_keygen_save">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keygen_save</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
, <i>const char *</i> <b>pubf</b>
, <i>const char *</i> <b>secf</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the keygen object
<dt><i>const char *</i> <b>pubf</b>
<dd><dt><i>const char *</i> <b>secf</b>
<dd></dl>
<hr>


<a name="cdk_keygen_free">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_keygen_free</b>
(<i>cdk_keygen_ctx_t</i> <b>hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t</i> <b>hd</b>
<dd> the keygen object
</dl>
<hr>


<a name="cdk_keygen_new">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keygen_new</b>
(<i>cdk_keygen_ctx_t *</i> <b>r_hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keygen_ctx_t *</i> <b>r_hd</b>
<dd> the new object
</dl>
<hr>


<a name="cdk_pklist_select_algo">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_pklist_select_algo</b>
(<i>cdk_keylist_t</i> <b>pkl</b>
, <i>int</i> <b>preftype</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>pkl</b>
<dd> the keylist
<dt><i>int</i> <b>preftype</b>
<dd> preference type
</dl>
<h3>Description</h3>
<ul>
Select a symmetric cipher algorithm from a list of public keys.
This algorithm is present in all key preferences.
</ul>
<hr>


<a name="cdk_pklist_release">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_pklist_release</b>
(<i>cdk_keylist_t</i> <b>pkl</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>pkl</b>
<dd> the keylist
</dl>
<h3>Description</h3>
<ul>
Free the memory of the key list.
</ul>
<hr>


<a name="cdk_pklist_build">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pklist_build</b>
(<i>cdk_keylist_t *</i> <b>ret_pkl</b>
, <i>cdk_keydb_hd_t</i> <b>hd</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>int</i> <b>use</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t *</i> <b>ret_pkl</b>
<dd> the new keylist
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> the session handle
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd> the string list of the recipients
<dt><i>int</i> <b>use</b>
<dd> public key usage
</dl>
<h3>Description</h3>
<ul>
Create a public key list based on the recipient names in @remusr.
</ul>
<hr>


<a name="cdk_pklist_encrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pklist_encrypt</b>
(<i>cdk_keylist_t</i> <b>pk_list</b>
, <i>cdk_dek_t</i> <b>dek</b>
, <i>cdk_stream_t</i> <b>outp</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>pk_list</b>
<dd><dt><i>cdk_dek_t</i> <b>dek</b>
<dd> the data encryption key
<dt><i>cdk_stream_t</i> <b>outp</b>
<dd> the stream to write in the data
</dl>
<h3>Description</h3>
<ul>
Encrypt the session key with each key of the list and wrap it
into a PUBKEY_ENC packet and write it to @outp.
</ul>
<hr>


<a name="cdk_sklist_release">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_sklist_release</b>
(<i>cdk_keylist_t</i> <b>sk_list</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>sk_list</b>
<dd></dl>
<h3>Description</h3>
<ul>
Free the memory of the secret keylist.
</ul>
<hr>


<a name="cdk_sklist_write_onepass">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_sklist_write_onepass</b>
(<i>cdk_keylist_t</i> <b>skl</b>
, <i>cdk_stream_t</i> <b>outp</b>
, <i>int</i> <b>sigclass</b>
, <i>int</i> <b>mdalgo</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>skl</b>
<dd> secret keylist
<dt><i>cdk_stream_t</i> <b>outp</b>
<dd> the stream to write in the data
<dt><i>int</i> <b>sigclass</b>
<dd> the class of the sig to create
<dt><i>int</i> <b>mdalgo</b>
<dd> the message digest algorithm
</dl>
<h3>Description</h3>
<ul>
Write a one-pass signature for each key in the list into @outp.
</ul>
<hr>


<a name="cdk_sklist_write">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_sklist_write</b>
(<i>cdk_keylist_t</i> <b>skl</b>
, <i>cdk_stream_t</i> <b>outp</b>
, <i>cdk_md_hd_t</i> <b>hash</b>
, <i>int</i> <b>sigclass</b>
, <i>int</i> <b>sigver</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_keylist_t</i> <b>skl</b>
<dd> secret keylist
<dt><i>cdk_stream_t</i> <b>outp</b>
<dd> the stream to write in the data
<dt><i>cdk_md_hd_t</i> <b>hash</b>
<dd> opaque handle for the message digest operations
<dt><i>int</i> <b>sigclass</b>
<dd> the class of the sig
<dt><i>int</i> <b>sigver</b>
<dd> version of the sig
</dl>
<h3>Description</h3>
<ul>
Complete the sig based on @hash and write all signatures to @outp.
</ul>
<hr>


<a name="cdk_keyserver_recv_key">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_keyserver_recv_key</b>
(<i>const char *</i> <b>host</b>
, <i>int</i> <b>port</b>
, <i>const byte *</i> <b>keyid</b>
, <i>int</i> <b>kid_type</b>
, <i>cdk_kbnode_t *</i> <b>ret_key</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>host</b>
<dd> URL or hostname of the keyserver
<dt><i>int</i> <b>port</b>
<dd> The port to use for the connection
<dt><i>const byte *</i> <b>keyid</b>
<dd> KeyID of the key to retrieve
<dt><i>int</i> <b>kid_type</b>
<dd> KeyID type (long, short, fingerprint)
<dt><i>cdk_kbnode_t *</i> <b>ret_key</b>
<dd></dl>
<h3>Description</h3>
<ul>
Receive a key from a keyserver.
</ul>
<hr>


<a name="cdk_strerror">&nbsp</a><h2>Function</h2>
<i>const char *</i>
<b>cdk_strerror</b>
(<i>int</i> <b>ec</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>int</i> <b>ec</b>
<dd> the error number
</dl>
<h3>Description</h3>
<ul>
Return an error text for the given id.
</ul>
<hr>


<a name="cdk_set_malloc_hooks">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_set_malloc_hooks</b>
(<i>void *</i> <b>(*new_alloc_func</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>void *</i> <b>(*new_alloc_func</b>
<dd></dl>
<h3>Description</h3>
<ul>
Set private memory hooks for the lib.
</ul>
<hr>


<a name="cdk_malloc_hook_initialized">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_malloc_hook_initialized</b>
(<i></i> <b>void</b>
)
<h3>Arguments</h3>
<dl>
<dt><i></i> <b>void</b>
<dd></dl>
<h3>Description</h3>
<ul>
<p>
Return if the malloc hooks are already initialized.
</ul>
<hr>


<a name="cdk_set_log_handler">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_set_log_handler</b>
(<i>cdk_log_fnc_t</i> <b>logfnc</b>
, <i>void *</i> <b>opaque</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_log_fnc_t</i> <b>logfnc</b>
<dd> the function pointer
<dt><i>void *</i> <b>opaque</b>
<dd> a private values for the function
</dl>
<h3>Description</h3>
<ul>
set a private handler for logging.
</ul>
<hr>


<a name="cdk_set_log_level">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_set_log_level</b>
(<i>int</i> <b>lvl</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>int</i> <b>lvl</b>
<dd> the level
</dl>
<h3>Description</h3>
<ul>
set the verbosity level.
</ul>
<hr>


<a name="cdk_handle_control">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_handle_control</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>int</i> <b>action</b>
, <i>int</i> <b>cmd</b>
, <i></i> <b>...</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>int</i> <b>action</b>
<dd> flag which indicates whether put or get is requested
<dt><i>int</i> <b>cmd</b>
<dd> command id
<dt><i></i> <b>...</b>
<dd></dl>
<h3>Description</h3>
<ul>
Perform various control operations for the current session.
</ul>
<hr>


<a name="cdk_handle_new">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_handle_new</b>
(<i>cdk_ctx_t *</i> <b>r_ctx</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t *</i> <b>r_ctx</b>
<dd> context to store the handle
</dl>
<h3>Description</h3>
<ul>
create a new session handle.
</ul>
<hr>


<a name="cdk_handle_set_keydb">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_handle_set_keydb</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>cdk_keydb_hd_t</i> <b>db</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>cdk_keydb_hd_t</i> <b>db</b>
<dd> the database handle
</dl>
<h3>Description</h3>
<ul>
set the key database handle.
the function automatically detects whether this is a public or
secret keyring and the right handle is set.
</ul>
<hr>


<a name="cdk_handle_get_keydb">&nbsp</a><h2>Function</h2>
<i>cdk_keydb_hd_t</i>
<b>cdk_handle_get_keydb</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>int</i> <b>type</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>int</i> <b>type</b>
<dd> type of the keyring
</dl>
<h3>Description</h3>
<ul>
Return the keydb handle from the session handle.
</ul>
<hr>


<a name="cdk_handle_set_callback">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_handle_set_callback</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>void</i> <b>(*cb</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> the handle
<dt><i>void</i> <b>(*cb</b>
<dd></dl>
<h3>Description</h3>
<ul>
set the callback for filter operations.
</ul>
<hr>


<a name="cdk_handle_set_passphrase_cb">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_handle_set_passphrase_cb</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>char *</i> <b>(*cb</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>char *</i> <b>(*cb</b>
<dd></dl>
<h3>Description</h3>
<ul>
set the passphrase callback.
</ul>
<hr>


<a name="cdk_handle_free">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_handle_free</b>
(<i>cdk_ctx_t</i> <b>hd</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> the handle
</dl>
<h3>Description</h3>
<ul>
free the main handle.
</ul>
<hr>


<a name="cdk_check_version">&nbsp</a><h2>Function</h2>
<i>const char *</i>
<b>cdk_check_version</b>
(<i>const char *</i> <b>req_version</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>req_version</b>
<dd> The requested version
</dl>
<h3>Description</h3>
<ul>
Check that the the version of the library is at minimum the requested
one and return the version string; return NULL if the condition is
not satisfied.  If a NULL is passed to this function, no check is done,
but the version string is simply returned.
</ul>
<hr>


<a name="cdk_subpkt_free">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_subpkt_free</b>
(<i>cdk_subpkt_t</i> <b>ctx</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_subpkt_t</i> <b>ctx</b>
<dd> the sub packet node to free
</dl>
<h3>Description</h3>
<ul>
Release the context.
</ul>
<hr>


<a name="cdk_subpkt_find">&nbsp</a><h2>Function</h2>
<i>cdk_subpkt_t</i>
<b>cdk_subpkt_find</b>
(<i>cdk_subpkt_t</i> <b>ctx</b>
, <i>int</i> <b>type</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_subpkt_t</i> <b>ctx</b>
<dd> the sub packet node
<dt><i>int</i> <b>type</b>
<dd> the packet type to find
</dl>
<h3>Description</h3>
<ul>
Find the given packet type in the node. If no packet with this
type was found, return null otherwise pointer to the node.
</ul>
<hr>


<a name="cdk_subpkt_new">&nbsp</a><h2>Function</h2>
<i>cdk_subpkt_t</i>
<b>cdk_subpkt_new</b>
(<i>size_t</i> <b>size</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>size_t</i> <b>size</b>
<dd> the size of the new context
</dl>
<h3>Description</h3>
<ul>
Create a new sub packet node with the size of @size.
</ul>
<hr>


<a name="cdk_subpkt_get_data">&nbsp</a><h2>Function</h2>
<i>const byte *</i>
<b>cdk_subpkt_get_data</b>
(<i>cdk_subpkt_t</i> <b>ctx</b>
, <i>int *</i> <b>r_type</b>
, <i>size_t *</i> <b>r_nbytes</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_subpkt_t</i> <b>ctx</b>
<dd> the sub packet node
<dt><i>int *</i> <b>r_type</b>
<dd> pointer store the packet type
<dt><i>size_t *</i> <b>r_nbytes</b>
<dd> pointer to store the packet size
</dl>
<h3>Description</h3>
<ul>
Extract the data from the given sub packet. The type is returned
in @r_type and the size in @r_nbytes.
</ul>
<hr>


<a name="cdk_subpkt_add">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_subpkt_add</b>
(<i>cdk_subpkt_t</i> <b>root</b>
, <i>cdk_subpkt_t</i> <b>node</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_subpkt_t</i> <b>root</b>
<dd> the root node
<dt><i>cdk_subpkt_t</i> <b>node</b>
<dd> the node to add
</dl>
<h3>Description</h3>
<ul>
Add the node in @node to the root node @root.
</ul>
<hr>


<a name="cdk_subpkt_init">&nbsp</a><h2>Function</h2>
<i>void</i>
<b>cdk_subpkt_init</b>
(<i>cdk_subpkt_t</i> <b>node</b>
, <i>int</i> <b>type</b>
, <i>const void *</i> <b>buf</b>
, <i>size_t</i> <b>buflen</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_subpkt_t</i> <b>node</b>
<dd> the sub packet node
<dt><i>int</i> <b>type</b>
<dd> type of the packet which data should be initialized
<dt><i>const void *</i> <b>buf</b>
<dd> the buffer with the actual data
<dt><i>size_t</i> <b>buflen</b>
<dd> the size of the data
</dl>
<h3>Description</h3>
<ul>
Set the packet data of the given root and set the type of it.
</ul>
<hr>


<a name="cdk_pk_encrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_encrypt</b>
(<i>cdk_pkt_pubkey_t</i> <b>pk</b>
, <i>cdk_pkt_pubkey_enc_t</i> <b>pke</b>
, <i>cdk_sesskey_t</i> <b>esk</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_pkt_pubkey_t</i> <b>pk</b>
<dd> the public key
<dt><i>cdk_pkt_pubkey_enc_t</i> <b>pke</b>
<dd> the public key encrypted packet
<dt><i>cdk_sesskey_t</i> <b>esk</b>
<dd> the actual session key
</dl>
<h3>Description</h3>
<ul>
Encrypt the session key in @esk and write its encrypted content
into the @pke struct.
</ul>
<hr>


<a name="cdk_pk_decrypt">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_decrypt</b>
(<i>cdk_pkt_seckey_t</i> <b>sk</b>
, <i>cdk_pkt_pubkey_enc_t</i> <b>pke</b>
, <i>cdk_sesskey_t *</i> <b>r_sk</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_pkt_seckey_t</i> <b>sk</b>
<dd> the secret key
<dt><i>cdk_pkt_pubkey_enc_t</i> <b>pke</b>
<dd> public key encrypted packet
<dt><i>cdk_sesskey_t *</i> <b>r_sk</b>
<dd> the object to store the plain session key
</dl>
<h3>Description</h3>
<ul>
Decrypt the encrypted session key from @pke into @r_sk.
</ul>
<hr>


<a name="cdk_pk_sign">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_sign</b>
(<i>cdk_pkt_seckey_t</i> <b>sk</b>
, <i>cdk_pkt_signature_t</i> <b>sig</b>
, <i>const byte *</i> <b>md</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_pkt_seckey_t</i> <b>sk</b>
<dd> secret key
<dt><i>cdk_pkt_signature_t</i> <b>sig</b>
<dd> signature
<dt><i>const byte *</i> <b>md</b>
<dd> the message digest
</dl>
<h3>Description</h3>
<ul>
Sign the message digest from @md and write the result into @sig.
</ul>
<hr>


<a name="cdk_pk_verify">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_verify</b>
(<i>cdk_pkt_pubkey_t</i> <b>pk</b>
, <i>cdk_pkt_signature_t</i> <b>sig</b>
, <i>const byte *</i> <b>md</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_pkt_pubkey_t</i> <b>pk</b>
<dd> the public key
<dt><i>cdk_pkt_signature_t</i> <b>sig</b>
<dd> signature
<dt><i>const byte *</i> <b>md</b>
<dd> the message digest
</dl>
<h3>Description</h3>
<ul>
Verify the signature in @sig and compare it with the message digest in @md.
</ul>
<hr>


<a name="cdk_pk_from_secret_key">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_from_secret_key</b>
(<i>cdk_pkt_seckey_t</i> <b>sk</b>
, <i>cdk_pkt_pubkey_t*</i> <b>ret_pk</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_pkt_seckey_t</i> <b>sk</b>
<dd> the secret key
<dt><i>cdk_pkt_pubkey_t*</i> <b>ret_pk</b>
<dd> the new public key
</dl>
<h3>Description</h3>
<ul>
Create a new public key from a secret key.
</ul>
<hr>


<a name="cdk_pkt_read">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pkt_read</b>
(<i>cdk_stream_t</i> <b>inp</b>
, <i>cdk_packet_t</i> <b>pkt</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>inp</b>
<dd> the input stream
<dt><i>cdk_packet_t</i> <b>pkt</b>
<dd> allocated packet handle to store the packet
</dl>
<h3>Description</h3>
<ul>
Parse the next packet on the @inp stream and return its contents in @pkt.
</ul>
<hr>


<a name="cdk_pk_check_sigs">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pk_check_sigs</b>
(<i>cdk_kbnode_t</i> <b>knode</b>
, <i>cdk_keydb_hd_t</i> <b>hd</b>
, <i>int *</i> <b>r_status</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_kbnode_t</i> <b>knode</b>
<dd> the key node
<dt><i>cdk_keydb_hd_t</i> <b>hd</b>
<dd> the session handle
<dt><i>int *</i> <b>r_status</b>
<dd> variable to store the status of the key
</dl>
<h3>Description</h3>
<ul>
Check all signatures. When no key is available for checking, the
sigstat is marked as 'NOKEY'. The @r_status contains the key flags
which are or-ed or zero when there are no flags.
</ul>
<hr>


<a name="cdk_stream_sign">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_sign</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>cdk_stream_t</i> <b>inp</b>
, <i>cdk_stream_t</i> <b>out</b>
, <i>cdk_strlist_t</i> <b>locusr</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>int</i> <b>encryptflag</b>
, <i>int</i> <b>sigmode</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>cdk_stream_t</i> <b>inp</b>
<dd> input stream
<dt><i>cdk_stream_t</i> <b>out</b>
<dd> output stream
<dt><i>cdk_strlist_t</i> <b>locusr</b>
<dd> local user list for signing
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd><dt><i>int</i> <b>encryptflag</b>
<dd> shall the output be encrypted? (1/0)
<dt><i>int</i> <b>sigmode</b>
<dd> signature mode
</dl>
<h3>Description</h3>
<ul>
Sign the data from the STREAM @inp.
</ul>
<hr>


<a name="cdk_file_sign">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_sign</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>cdk_strlist_t</i> <b>locusr</b>
, <i>cdk_strlist_t</i> <b>remusr</b>
, <i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
, <i>int</i> <b>sigmode</b>
, <i>int</i> <b>encryptflag</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd><dt><i>cdk_strlist_t</i> <b>locusr</b>
<dd> List of userid which should be used for signing
<dt><i>cdk_strlist_t</i> <b>remusr</b>
<dd> If encrypt is valid, the list of recipients
<dt><i>const char *</i> <b>file</b>
<dd> Name of the input file
<dt><i>const char *</i> <b>output</b>
<dd> Name of the output file
<dt><i>int</i> <b>sigmode</b>
<dd> Signature mode
<dt><i>int</i> <b>encryptflag</b>
<dd></dl>
<h3>Description</h3>
<ul>
Sign a file.
</ul>
<hr>


<a name="cdk_stream_open">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_open</b>
(<i>const char *</i> <b>file</b>
, <i>cdk_stream_t *</i> <b>ret_s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>file</b>
<dd> The file to open
<dt><i>cdk_stream_t *</i> <b>ret_s</b>
<dd> The new STREAM object
</dl>
<hr>


<a name="cdk_stream_new">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_new</b>
(<i>const char *</i> <b>file</b>
, <i>cdk_stream_t *</i> <b>ret_s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>file</b>
<dd> The name of the new file
<dt><i>cdk_stream_t *</i> <b>ret_s</b>
<dd> The new STREAM object
</dl>
<hr>


<a name="cdk_stream_create">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_create</b>
(<i>const char *</i> <b>file</b>
, <i>cdk_stream_t *</i> <b>ret_s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>const char *</i> <b>file</b>
<dd> the filename
<dt><i>cdk_stream_t *</i> <b>ret_s</b>
<dd> the object
</dl>
<h3>Description</h3>
<ul>
The difference to cdk_stream_new is, that no filtering can be used with
this kind of stream and everything is written directly to the stream.
</ul>
<hr>


<a name="cdk_stream_close">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_close</b>
(<i>cdk_stream_t</i> <b>s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object.
</dl>
<h3>Description</h3>
<ul>
This function work different for read or write streams. When the
stream is for reading, the filtering is already done and we can
simply close the file and all buffers.
But for the case it's a write stream, we need to apply all registered
filters now. The file is closed in the filter function and not here.
</ul>
<hr>


<a name="cdk_stream_eof">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_stream_eof</b>
(<i>cdk_stream_t</i> <b>s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object.
</dl>
<h3>Description</h3>
<ul>
This function will only work with read streams.
</ul>
<hr>


<a name="cdk_stream_get_length">&nbsp</a><h2>Function</h2>
<i>unsigned</i>
<b>cdk_stream_get_length</b>
(<i>cdk_stream_t</i> <b>s</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object.
</dl>
<h3>Description</h3>
<ul>
This file only works for read stream because it's likely that the
write stream is not flushed or even no data was inserted.
</ul>
<hr>


<a name="cdk_stream_filter_disable">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_filter_disable</b>
(<i>cdk_stream_t</i> <b>s</b>
, <i>int</i> <b>type</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object
<dt><i>int</i> <b>type</b>
<dd> The numberic filter ID.
</dl>
<hr>


<a name="cdk_stream_read">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_stream_read</b>
(<i>cdk_stream_t</i> <b>s</b>
, <i>void *</i> <b>buf</b>
, <i>size_t</i> <b>count</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object.
<dt><i>void *</i> <b>buf</b>
<dd> The buffer to insert the readed bytes.
<dt><i>size_t</i> <b>count</b>
<dd> Request so much bytes.
</dl>
<h3>Description</h3>
<ul>
When this function is called the first time, it can take a while
because all filters need to be processed. Please remember that you
need to add the filters in reserved order.
</ul>
<hr>


<a name="cdk_stream_write">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_stream_write</b>
(<i>cdk_stream_t</i> <b>s</b>
, <i>const void *</i> <b>buf</b>
, <i>size_t</i> <b>count</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> The STREAM object
<dt><i>const void *</i> <b>buf</b>
<dd> The buffer with the values to write.
<dt><i>size_t</i> <b>count</b>
<dd> The size of the buffer.
</dl>
<h3>Description</h3>
<ul>
In this function we simply write the bytes to the stream. We can't
use the filters here because it would mean they have to support
partial flushing.
</ul>
<hr>


<a name="cdk_stream_mmap">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_stream_mmap</b>
(<i>cdk_stream_t</i> <b>s</b>
, <i>byte **</i> <b>ret_buf</b>
, <i>size_t *</i> <b>ret_count</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>s</b>
<dd> the stream
<dt><i>byte **</i> <b>ret_buf</b>
<dd> the buffer to store the content
<dt><i>size_t *</i> <b>ret_count</b>
<dd> length of the buffer
</dl>
<h3>Description</h3>
<ul>
Map the data of the given stream into a memory section. @ret_count
contains the length of the buffer.
</ul>
<hr>


<a name="cdk_stream_peek">&nbsp</a><h2>Function</h2>
<i>int</i>
<b>cdk_stream_peek</b>
(<i>cdk_stream_t</i> <b>inp</b>
, <i>byte *</i> <b>s</b>
, <i>size_t</i> <b>count</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>inp</b>
<dd> the input stream handle
<dt><i>byte *</i> <b>s</b>
<dd> buffer
<dt><i>size_t</i> <b>count</b>
<dd> number of bytes to peek
</dl>
<h3>Description</h3>
<ul>
The function acts like cdk_stream_read with the difference that
the file pointer is moved to the old position after the bytes were read.
</ul>
<hr>


<a name="cdk_file_verify">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_file_verify</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>const char *</i> <b>file</b>
, <i>const char *</i> <b>output</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> the session handle
<dt><i>const char *</i> <b>file</b>
<dd> the input file
<dt><i>const char *</i> <b>output</b>
<dd> the output file
</dl>
<h3>Description</h3>
<ul>
Verify a signature.
</ul>
<hr>


<a name="cdk_sig_get_ulong_attr">&nbsp</a><h2>Function</h2>
<i>unsigned long</i>
<b>cdk_sig_get_ulong_attr</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>int</i> <b>idx</b>
, <i>int</i> <b>what</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>int</i> <b>idx</b>
<dd> index of the signature
<dt><i>int</i> <b>what</b>
<dd> attribute id
</dl>
<h3>Description</h3>
<ul>
Extract the requested attribute of the signature. The returned value
is always an integer (max. 32-bit).
</ul>
<hr>


<a name="cdk_sig_get_data_attr">&nbsp</a><h2>Function</h2>
<i>const void *</i>
<b>cdk_sig_get_data_attr</b>
(<i>cdk_ctx_t</i> <b>hd</b>
, <i>int</i> <b>idx</b>
, <i>int</i> <b>what</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_ctx_t</i> <b>hd</b>
<dd> session handle
<dt><i>int</i> <b>idx</b>
<dd> index of the signature
<dt><i>int</i> <b>what</b>
<dd> attribute id.
</dl>
<h3>Description</h3>
<ul>
Extract the requested attribute of the signature. The returned value
is always a constant object to the data.
</ul>
<hr>


<a name="cdk_pkt_write">&nbsp</a><h2>Function</h2>
<i>cdk_error_t</i>
<b>cdk_pkt_write</b>
(<i>cdk_stream_t</i> <b>out</b>
, <i>cdk_packet_t</i> <b>pkt</b>
)
<h3>Arguments</h3>
<dl>
<dt><i>cdk_stream_t</i> <b>out</b>
<dd> the output stream handle
<dt><i>cdk_packet_t</i> <b>pkt</b>
<dd> the packet itself
</dl>
<h3>Description</h3>
<ul>
Write the contents of @pkt into the @out stream.
</ul>
<hr>