rpm: RPM keyring API.

rpm 4.16.1.3

Files | Functions
RPM keyring API.

RPM keyring API. More...

## Files
file | rpmkeyring.h
| RPM keyring API.

## Functions
rpmKeyring | rpmKeyringNew (void)
| Create a new, empty keyring. More...
rpmKeyring | rpmKeyringFree (rpmKeyring keyring)
| Free keyring and the keys within it. More...
int | rpmKeyringAddKey (rpmKeyring keyring, rpmPubkey key)
| Add a public key to keyring. More...
rpmRC | rpmKeyringLookup (rpmKeyring keyring, pgpDig sig)
| Perform keyring lookup for a key matching a signature. More...
rpmRC | rpmKeyringVerifySig (rpmKeyring keyring, pgpDigParams sig, DIGEST_CTX ctx)
| Perform combined keyring lookup and signature verification. More...
rpmKeyring | rpmKeyringLink (rpmKeyring keyring)
| Reference a keyring. More...
rpmPubkey | rpmPubkeyNew (const uint8_t *pkt, size_t pktlen)
| Create a new rpmPubkey from OpenPGP packet. More...
rpmPubkey * | rpmGetSubkeys (rpmPubkey mainkey, int *count)
| Return array of subkeys belonging to maikey param mainkey main rpmPubkey param count count of returned subkeys. More...
rpmPubkey | rpmPubkeyRead (const char *filename)
| Create a new rpmPubkey from ASCII-armored pubkey file. More...
rpmPubkey | rpmPubkeyFree (rpmPubkey key)
| Free a pubkey. More...
rpmPubkey | rpmPubkeyLink (rpmPubkey key)
| Reference a pubkey. More...
pgpDig | rpmPubkeyDig (rpmPubkey key)
| Parse OpenPGP pubkey parameters. More...
char * | rpmPubkeyBase64 (rpmPubkey key)
| Return base64 encoding of pubkey. More...
pgpDigParams | rpmPubkeyPgpDigParams (rpmPubkey key)
| Return pgp params of key. More...

## Detailed Description

RPM keyring API.

## Function Documentation

## ◆ rpmGetSubkeys()

rpmPubkey* rpmGetSubkeys | ( | rpmPubkey | mainkey,
|  | int * | count
| ) |  |

Return array of subkeys belonging to maikey param mainkey main rpmPubkey param count count of returned subkeys.

Returns
  an array of subkey's handles

## ◆ rpmKeyringAddKey()

int rpmKeyringAddKey | ( | rpmKeyring | keyring,
|  | rpmPubkey | key
| ) |  |

Add a public key to keyring.

Parameters

  keyring | keyring handle
  key | pubkey handle

Returns
  0 on success, -1 on error, 1 if key already present

## ◆ rpmKeyringFree()

rpmKeyring rpmKeyringFree | ( | rpmKeyring | keyring | ) |

Free keyring and the keys within it.

Returns
  NULL always

## ◆ rpmKeyringLink()

rpmKeyring rpmKeyringLink | ( | rpmKeyring | keyring | ) |

Reference a keyring.

Parameters

  keyring | keyring handle

Returns
  new keyring reference

## ◆ rpmKeyringLookup()

rpmRC rpmKeyringLookup | ( | rpmKeyring | keyring,
|  | pgpDig | sig
| ) |  |

Perform keyring lookup for a key matching a signature.

Parameters

  keyring | keyring handle
  sig | OpenPGP packet container of signature

Returns
  RPMRC_OK if found, RPMRC_NOKEY otherwise

## ◆ rpmKeyringNew()

rpmKeyring rpmKeyringNew | ( | void |  | ) |

Create a new, empty keyring.

Returns
  new keyring handle

## ◆ rpmKeyringVerifySig()

rpmRC rpmKeyringVerifySig | ( | rpmKeyring | keyring,
|  | pgpDigParams | sig,
|  | DIGEST_CTX | ctx
| ) |  |

Perform combined keyring lookup and signature verification.

Parameters

  keyring | keyring handle
  sig | OpenPGP signature parameters
  ctx | signature hash context

Returns
  RPMRC_OK / RPMRC_FAIL / RPMRC_NOKEY

## ◆ rpmPubkeyBase64()

char* rpmPubkeyBase64 | ( | rpmPubkey | key | ) |

Return base64 encoding of pubkey.

Parameters

  key | Pubkey

Returns
  base64 encoded pubkey (malloced), NULL on error

## ◆ rpmPubkeyDig()

pgpDig rpmPubkeyDig | ( | rpmPubkey | key | ) |

Parse OpenPGP pubkey parameters.

Parameters

  key | Pubkey

Returns
  parsed output of pubkey packet parameters

## ◆ rpmPubkeyFree()

rpmPubkey rpmPubkeyFree | ( | rpmPubkey | key | ) |

Free a pubkey.

Parameters

  key | Pubkey to free

Returns
  NULL always

## ◆ rpmPubkeyLink()

rpmPubkey rpmPubkeyLink | ( | rpmPubkey | key | ) |

Reference a pubkey.

Parameters

  key | Pubkey

Returns
  new pubkey reference

## ◆ rpmPubkeyNew()

rpmPubkey rpmPubkeyNew | ( | const uint8_t * | pkt,
|  | size_t | pktlen
| ) |  |

Create a new rpmPubkey from OpenPGP packet.

Parameters

  pkt | OpenPGP packet data
  pktlen | Data length

Returns
  new pubkey handle

## ◆ rpmPubkeyPgpDigParams()

pgpDigParams rpmPubkeyPgpDigParams | ( | rpmPubkey | key | ) |

Return pgp params of key.

Parameters

  key | Pubkey

Returns
  pgp params, NULL on error

## ◆ rpmPubkeyRead()

rpmPubkey rpmPubkeyRead | ( | const char * | filename | ) |

Create a new rpmPubkey from ASCII-armored pubkey file.

Parameters

  filename | Path to pubkey file

Returns
  new pubkey handle