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)
LrGpgKey * | lr_gpg_list_keys (gboolean export_keys, const char *home_dir, GError **err)
const LrGpgKey * | lr_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 LrGpgSubkey * | lr_gpg_key_get_subkeys (const LrGpgKey *key)
void | lr_gpg_keys_free (LrGpgKey *key_array)
const LrGpgSubkey * | lr_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_fn | Filename (path) of signature file.
  data_fn | Filename (path) of data to verify.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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_fd | File descriptor of signature file.
  data_fd | File descriptor of data to verify.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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_fn | Filename (path) of key file.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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_fd | Filedescriptor of key file.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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

  key | Pointer to memory buffer with key.
  key_len | Length of the key.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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

  key | Input 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

  key | Input 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

  key | Input 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

  key | Input 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

  key | Input 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_keys | If TRUE, the list also contains the exported keys. Export is in ASCII-Armor format.
  home_dir | Configuration directory of OpenPGP engine (e.g. "/home/user/.gnupg/"), if NULL default config directory is used.
  err | GError **

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

  key | Input 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

  key | Input 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

  key | Input 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

  key | Input 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

  key | Input subkey.

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