Skip to content

Commit

Permalink
Add rpmPubkeyKeyIDAsHex
Browse files Browse the repository at this point in the history
  • Loading branch information
ffesti committed Oct 7, 2024
1 parent 8824960 commit 050256d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/rpm/rpmkeyring.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ int rpmPubkeyFingerprint(rpmPubkey key, uint8_t **fp, size_t *fplen);
*/
char * rpmPubkeyFingerprintAsHex(rpmPubkey key);

/** \ingroup rpmkeyring
* Return key ID of key as hex string
* @param key Pubkey
* @ return string or NULL on failure
*/
char * rpmPubkeyKeyIDAsHex(rpmPubkey key);

/** \ingroup rpmkeyring
* Return pgp params of key
* @param key Pubkey
Expand Down
6 changes: 6 additions & 0 deletions rpmio/rpmkeyring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ char * rpmPubkeyFingerprintAsHex(rpmPubkey key)
return result;
}

char * rpmPubkeyKeyIDAsHex(rpmPubkey key)
{
return rpmhex((const uint8_t*)(key->keyid.c_str()), key->keyid.length());
}


rpmPubkey rpmPubkeyFree(rpmPubkey key)
{
if (key == NULL)
Expand Down

0 comments on commit 050256d

Please sign in to comment.