Librepo library 1.19.0
C library for downloading linux repository metadata and packages
Loading...
Searching...
No Matches
GPG signature verification

Typedefs

typedef struct tLrGpgSubkey LrGpgSubkey
 
typedef struct tLrGpgKey LrGpgKey
 

Functions

gboolean lr_gpg_check_signature_fd (int signature_fd, int data_fd, const char *home_dir, GError **err)
 
gboolean lr_gpg_check_signature (const char *signature_fn, const char *data_fn, const char *home_dir, GError **err)
 
gboolean lr_gpg_import_key_from_memory (const char *key, size_t key_len, const char *home_dir, GError **err)
 
gboolean lr_gpg_import_key_from_fd (int key_fd, const char *home_dir, GError **err)
 
gboolean lr_gpg_import_key (const char *key_fn, const char *home_dir, GError **err)
 
LrGpgKeylr_gpg_list_keys (gboolean export_keys, const char *home_dir, GError **err)
 
const LrGpgKeylr_gpg_key_get_next (const LrGpgKey *key)
 
char *const * lr_gpg_key_get_userids (const LrGpgKey *key)
 
const char * lr_gpg_key_get_raw_key (const LrGpgKey *key)
 
const LrGpgSubkeylr_gpg_key_get_subkeys (const LrGpgKey *key)
 
void lr_gpg_keys_free (LrGpgKey *key_array)
 
const LrGpgSubkeylr_gpg_subkey_get_next (const LrGpgSubkey *subkey)
 
const char * lr_gpg_subkey_get_id (const LrGpgSubkey *subkey)
 
const char * lr_gpg_subkey_get_fingerprint (const LrGpgSubkey *subkey)
 
long int lr_gpg_subkey_get_timestamp (const LrGpgSubkey *subkey)
 
gboolean lr_gpg_subkey_get_can_sign (const LrGpgSubkey *subkey)
 

Detailed Description

Typedef Documentation

◆ LrGpgKey

typedef struct tLrGpgKey LrGpgKey

A structure containing information about a key with subkeys.

Definition at line 40 of file gpg.h.

◆ LrGpgSubkey

typedef struct tLrGpgSubkey LrGpgSubkey

A structure containing information about subkey.

Definition at line 36 of file gpg.h.

Function Documentation

◆ lr_gpg_check_signature()

gboolean lr_gpg_check_signature ( const char *  signature_fn,
const char *  data_fn,
const char *  home_dir,
GError **  err 
)

Check detached signature of data.

Parameters
signature_fnFilename (path) of signature file.
data_fnFilename (path) of data to verify.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns TRUE if error is not set and FALSE if it is.

◆ lr_gpg_check_signature_fd()

gboolean lr_gpg_check_signature_fd ( int  signature_fd,
int  data_fd,
const char *  home_dir,
GError **  err 
)

Check detached signature of data.

Parameters
signature_fdFile descriptor of signature file.
data_fdFile descriptor of data to verify.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns TRUE if error is not set and FALSE if it is.

◆ lr_gpg_import_key()

gboolean lr_gpg_import_key ( const char *  key_fn,
const char *  home_dir,
GError **  err 
)

Import key into the keyring.

Parameters
key_fnFilename (path) of key file.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns TRUE if error is not set and FALSE if it is.

◆ lr_gpg_import_key_from_fd()

gboolean lr_gpg_import_key_from_fd ( int  key_fd,
const char *  home_dir,
GError **  err 
)

Import key into the keyring.

Parameters
key_fdFiledescriptor of key file.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns TRUE if error is not set and FALSE if it is.

◆ lr_gpg_import_key_from_memory()

gboolean lr_gpg_import_key_from_memory ( const char *  key,
size_t  key_len,
const char *  home_dir,
GError **  err 
)

Import key into the keyring.

Parameters
keyPointer to memory buffer with key.
key_lenLength of the key.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns TRUE if error is not set and FALSE if it is.

◆ lr_gpg_key_get_next()

const LrGpgKey * lr_gpg_key_get_next ( const LrGpgKey key)

Get the next key from the list obtained from lr_gpg_list_keys.

Parameters
keyInput key.
Returns
returns next kye.

◆ lr_gpg_key_get_raw_key()

const char * lr_gpg_key_get_raw_key ( const LrGpgKey key)

Get key in ASCII-Armor format (only if key was obtained from lr_gpg_list_keys with export = TRUE).

Parameters
keyInput key.
Returns
returns key in ACII-Armor format.

◆ lr_gpg_key_get_subkeys()

const LrGpgSubkey * lr_gpg_key_get_subkeys ( const LrGpgKey key)

Get a list of subkeys associated with the key. The first subkey is the primary key.

Parameters
keyInput key.
Returns
returns list of subkeys associated with the key.

◆ lr_gpg_key_get_userids()

char *const * lr_gpg_key_get_userids ( const LrGpgKey key)

Get NULL terminated array of user IDs strings.

Parameters
keyInput key.
Returns
returns NULL terminated array of user IDs strings.

◆ lr_gpg_keys_free()

void lr_gpg_keys_free ( LrGpgKey key_array)

Release the list of keys obtained from lr_gpg_list_keys.

Parameters
keyInput array of keys.

◆ lr_gpg_list_keys()

LrGpgKey * lr_gpg_list_keys ( gboolean  export_keys,
const char *  home_dir,
GError **  err 
)

List/export keys (and subkeys) from the keyring.

Parameters
export_keysIf TRUE, the list also contains the exported keys. Export is in ASCII-Armor format.
home_dirConfiguration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
errGError **
Returns
returns list of keys (and subkeys), or NULL if keyring is empty or an error occured.

◆ lr_gpg_subkey_get_can_sign()

gboolean lr_gpg_subkey_get_can_sign ( const LrGpgSubkey subkey)

Get information if the subkey can be used for signing.

Parameters
keyInput subkey.
Returns
returns TRUE if subkey can be used for signing.

◆ lr_gpg_subkey_get_fingerprint()

const char * lr_gpg_subkey_get_fingerprint ( const LrGpgSubkey subkey)

Get fingerprint of the subkey in hex digit form.

Parameters
keyInput subkey.
Returns
returns fingerprint of the subkey in hex digit form.

◆ lr_gpg_subkey_get_id()

const char * lr_gpg_subkey_get_id ( const LrGpgSubkey subkey)

Get subkey ID.

Parameters
keyInput subkey.
Returns
returns key ID.

◆ lr_gpg_subkey_get_next()

const LrGpgSubkey * lr_gpg_subkey_get_next ( const LrGpgSubkey subkey)

Get the next subkey from the list obtained from lr_gpg_key_get_subkeys.

Parameters
keyInput subkey.
Returns
returns next subkye.

◆ lr_gpg_subkey_get_timestamp()

long int lr_gpg_subkey_get_timestamp ( const LrGpgSubkey subkey)

Get the creation timestamp.

Parameters
keyInput subkey.
Returns
returns Get the creation timestamp, -1 if invalid, 0 if not available..