On my Windows machine running Cygwin, When I run
gpg --list-keys --keyid-format LONG gpg --list-secret-keys --keyid-format LONG
Both the pub and sec keys have the same value. sub and ssb have the same value. Is this expected behaviour?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Yes. this is expected behavior.
A Key ID (actually a shortened version of the key Fingerprint) is calculated using only Public Key material and so can ONLY refer to the Public Key.
Secret Keys do not have a separate "Key ID", gpg is just showing the "Public Key ID" that the Secret Key is paired to.
It may seem like it could be confusing. For example: if you import a Secret Key, how will gpg know which Public Key it is paired with? But this is not a problem because whenever you export a Secret Key, the exported (and subsequently imported) "Secret Key Packet" will always contain the Public Key as well.