(cross posting unanswered question on superuser.com)


GnuPG public keys that are imported into the RPM keyring with:

rpm --import PUBKEY_FILE

can be queried with

rpm -q gpg-pubkey-<key-id>

For example the CentOS4 key:

pub  1024D/443E1821 2005-02-25 CentOS-4 key <centos-4key@centos.org>
     Key fingerprint = 31EA 27E5 6F79 0C18 AD79  18DF A53D 0BAB 443E 1821
sub  2048g/06870DBC 2005-02-25 [expires: 2015-02-23]

can be queried with

rpm -q gpg-pubkey-443e1821

and the result is:

gpg-pubkey-443e1821-421f218f

The RPM's version number 443e1821 corresponds to the key id 0x443e1821 but what the release number 421f218f stands for?

asked 09 Aug '10, 14:00

chenlevy's gravatar image

chenlevy
525
accept rate: 0%

edited 09 Aug '10, 14:34




The second number is the unix time in hex for the key creation.

[felsburr@agnus devel]$ date '+%s'
1281331238
[felsburr@agnus devel]$ echo "obase=16; 1281331238" | bc
4C5F9026
[felsburr@agnus devel]$ echo "16i 4C5F9026 p" | dc
1281331238

This thread is enlightening:

http://forums.fedoraforum.org/showthread.php?t=85896

link

answered 09 Aug '10, 18:27

rfelsburg's gravatar image

rfelsburg ♦
6061618
accept rate: 25%

... or as a one liner: date -d "1970-1-1 + $((0x4C5F9026)) sec" -- Thanks. (meta: would have voted you up, but don't have sufficient reputation)

(10 Aug '10, 13:30) chenlevy
Gathering the first and second hex number identifying a GPG key with comment "IBR RPM Package Signing Key" could be done like this:

NUMBER_DSA_KEY_ID=$(gpg --list-keys | \
grep -B 1 -C 2 "IBR RPM Package Signing Key" | \
grep pub | cut -c 13-20 | tr [A-Z] [a-z])
#
NUMBER_CREATION_TIME=$(echo "obase=16 ; $(gpg --with-colons --fixed-list-mode \
--with-fingerprint --list-keys ${NUMBER_DSA_KEY_ID} | grep pub | \
awk -F':' '{print $6}')" | bc | tr [A-Z] [a-z])
#
echo ${NUMBER_DSA_KEY_ID}
echo ${NUMBER_CREATION_TIME}
link

answered 15 May '11, 02:57

ib%20rudolph's gravatar image

ib rudolph
1
accept rate: 0%

edited 15 May '11, 03:03

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: 09 Aug '10, 14:00

Seen: 2,731 times

Last updated: 15 May '11, 16:49

powered by OSQA