2

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?

1
  • 2
    I'm not a GPG expert, but since it uses public key crypto, which generates public-private key pairs as a matched set, it makes sense for the pair to share the same ID. – Spiff Jan 24 at 5:44
6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.