1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Utility functions</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="gsignond API Reference Manual">
8 <link rel="up" href="ch06.html" title="Miscellaneous">
9 <link rel="prev" href="gsignond-Logging.html" title="Logging">
10 <link rel="next" href="object-tree.html" title="Object Hierarchy">
11 <meta name="generator" content="GTK-Doc V1.19.1 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="10"><tr valign="middle">
16 <td width="100%" align="left">
17 <a href="#" class="shortcut">Top</a>
19 <a href="#gsignond-Utility-functions.description" class="shortcut">Description</a>
21 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
22 <td><a accesskey="u" href="ch06.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
23 <td><a accesskey="p" href="gsignond-Logging.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
24 <td><a accesskey="n" href="object-tree.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
26 <div class="refentry">
27 <a name="gsignond-Utility-functions"></a><div class="titlepage"></div>
28 <div class="refnamediv"><table width="100%"><tr>
30 <h2><span class="refentrytitle"><a name="gsignond-Utility-functions.top_of_page"></a>Utility functions</span></h2>
31 <p>Utility functions — miscellaneous utility functions</p>
33 <td valign="top" align="right"></td>
35 <div class="refsynopsisdiv">
36 <a name="gsignond-Utility-functions.synopsis"></a><h2>Synopsis</h2>
37 <pre class="synopsis">
38 #include <gsignond/gsignond-utils.h>
40 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="gsignond-Utility-functions.html#gsignond-generate-nonce" title="gsignond_generate_nonce ()">gsignond_generate_nonce</a> ();
41 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-directory" title="gsignond_wipe_directory ()">gsignond_wipe_directory</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>);
42 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-file" title="gsignond_wipe_file ()">gsignond_wipe_file</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);
45 <div class="refsect1">
46 <a name="gsignond-Utility-functions.description"></a><h2>Description</h2>
48 Miscellaneous utility functions are described below.
51 <div class="refsect1">
52 <a name="gsignond-Utility-functions.details"></a><h2>Details</h2>
53 <div class="refsect2">
54 <a name="gsignond-generate-nonce"></a><h3>gsignond_generate_nonce ()</h3>
55 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * gsignond_generate_nonce ();</pre>
57 This function generates a random secure nonce using SHA1 HMAC.
59 <div class="variablelist"><table border="0">
60 <col align="left" valign="top">
62 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
63 <td>the nonce in lowercase hexadecimal format, 40 bytes long. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
69 <div class="refsect2">
70 <a name="gsignond-wipe-directory"></a><h3>gsignond_wipe_directory ()</h3>
71 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gsignond_wipe_directory (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dirname</code></em>);</pre>
73 This function securely wipes the contents of the directory by calling
74 <a class="link" href="gsignond-Utility-functions.html#gsignond-wipe-file" title="gsignond_wipe_file ()"><code class="function">gsignond_wipe_file()</code></a> on each file. It also removes links and empty directories but
75 does not recursively wipe them.
77 <div class="variablelist"><table border="0">
78 <col align="left" valign="top">
81 <td><p><span class="term"><em class="parameter"><code>dirname</code></em> :</span></p></td>
82 <td>directory to wipe</td>
85 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
86 <td>TRUE if wiping and removal was successful.</td>
92 <div class="refsect2">
93 <a name="gsignond-wipe-file"></a><h3>gsignond_wipe_file ()</h3>
94 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gsignond_wipe_file (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>);</pre>
96 This function securely wipes the contents of the file, by overwriting it with
97 0's, then 1's, then random data. The file is then removed.
99 <div class="variablelist"><table border="0">
100 <col align="left" valign="top">
103 <td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
104 <td>filename to wipe</td>
107 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
108 <td>TRUE if wiping and removal was successful.</td>
117 Generated by GTK-Doc V1.19.1</div>