Skip to content

Commit

Permalink
Add rpmPubkeyArmorWrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
ffesti authored and pmatilai committed Oct 16, 2024
1 parent 1181544 commit b02d648
Show file tree
Hide file tree
Showing 2 changed files with 18 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 @@ -140,6 +140,13 @@ rpmPubkey rpmPubkeyLink(rpmPubkey key);
*/
char * rpmPubkeyBase64(rpmPubkey key);

/** \ingroup rpmkeyring
* Return base64 encoding of pubkey
* @param key Pubkey
* @return armored pubkey (malloced), NULL on error
*/
char * rpmPubkeyArmorWrap(rpmPubkey key);

/** \ingroup rpmkeyring
* Return fingerprint of primary key
* @param key Pubkey
Expand Down
11 changes: 11 additions & 0 deletions rpmio/rpmkeyring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,17 @@ char * rpmPubkeyBase64(rpmPubkey key)
return enc;
}

char * rpmPubkeyArmorWrap(rpmPubkey key)
{
char *enc = NULL;

if (key) {
rdlock lock(key->mutex);
enc = pgpArmorWrap(PGPARMOR_PUBKEY, key->pkt.data(), key->pkt.size());
}
return enc;
}

rpmRC rpmPubkeyMerge(rpmPubkey oldkey, rpmPubkey newkey, rpmPubkey *mergedkeyp)
{
rpmPubkey mergedkey = NULL;
Expand Down

0 comments on commit b02d648

Please sign in to comment.