Utility functions

Utility functions — miscellaneous utility functions

Functions

Object Hierarchy


Includes

#include <gsignond/gsignond-utils.h>

Description

Miscellaneous utility functions are described below.

Functions

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.

Parameters

filename

filename to wipe

 

Returns

TRUE if wiping and removal was successful.


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.

Parameters

dirname

directory to wipe

 

Returns

TRUE if wiping and removal was successful.


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_sequence_to_variant ()

GVariant *
gsignond_sequence_to_variant (GSequence *seq);

Convert a string sequence to a variant.

Parameters

seq

Sequence of strings to convert

 

Returns

GVariant of type "as".

[transfer full]


gsignond_variant_to_sequence ()

GSequence *
gsignond_variant_to_sequence (GVariant *var);

Convert variant containing string array to sequence.

Parameters

var

Variant of "as" to convert

 

Returns

GSequence of strings.

[transfer full]


gsignond_sequence_to_array ()

gchar **
gsignond_sequence_to_array (GSequence *seq);

Convert sequence of strings to null-terminated string array.

Parameters

seq

Sequence of strings to convert

 

Returns

Null-terminated array of strings.

[transfer full]


gsignond_array_to_sequence ()

GSequence *
gsignond_array_to_sequence (gchar **items);

Convert null-terminated array of strings to a sequence.

Parameters

items

Null-terminated array of strings to convert.

[transfer full]

Returns

GSequence of strings.

[transfer full]


gsignond_copy_array_to_sequence ()

GSequence *
gsignond_copy_array_to_sequence (const gchar **items);

Copy null-terminated array of strings to a sequence.

Parameters

items

Null-terminated array of strings to copy

 

Returns

GSequence of strings.

[transfer full]


gsignond_is_host_in_domain ()

gboolean
gsignond_is_host_in_domain (const gchar *host,
                            const gchar *domain);

Checks if host belongs to domain .

Parameters

domain

a domain name

 

host

a host name

 

Returns

the result

Types and Values