Utility functions

Utility functions — miscellaneous utility functions

Synopsis

#include <gsignond/gsignond-utils.h>

gchar *             gsignond_generate_nonce             ();
gboolean            gsignond_wipe_directory             (const gchar *dirname);
gboolean            gsignond_wipe_file                  (const gchar *filename);

Description

Miscellaneous utility functions are described below.

Details

gsignond_generate_nonce ()

gchar *             gsignond_generate_nonce             ();

This function generates a random secure nonce using SHA1 HMAC.

Returns :

the nonce in lowercase hexadecimal format, 40 bytes long. [transfer full]

gsignond_wipe_directory ()

gboolean            gsignond_wipe_directory             (const gchar *dirname);

This function securely wipes the contents of the directory by calling gsignond_wipe_file() on each file. It also removes links and empty directories but does not recursively wipe them.

dirname :

directory to wipe

Returns :

TRUE if wiping and removal was successful.

gsignond_wipe_file ()

gboolean            gsignond_wipe_file                  (const gchar *filename);

This function securely wipes the contents of the file, by overwriting it with 0's, then 1's, then random data. The file is then removed.

filename :

filename to wipe

Returns :

TRUE if wiping and removal was successful.