Exporting public keys from PGPSecretKeyRing does denote sub keys as normal keys #381
Comments
Thanks for the report. Yes, it's a bit dodgy... oh dear... try the latest beta, I think that should now be making sure the keys are converted into subkeys immediately. https://www.bouncycastle.org/betas Let us know how you go. |
It seems to work now :) Edit: Ah I see some related changes in 486c6d3 |
Yes, it's the change to PGPKeyRingGenerator |
For the record, I created this workaround for fixing this issue in retrospect on existing keys. |
neuhalje
added a commit
to neuhalje/bouncy-gpg
that referenced
this issue
Dec 23, 2018
From the issue[1]: My issue is the following: If I create a PGPSecretKeyRing containing a master key and a sub key, and then try to extract a PGPPublicKeyRing from it, the resulting key ring does only contain one key, as the sub keys are ignored. The cause for this is, that the sub keys are not carrying a PUBLIC_SUBKEY packet tag, but instead a PUBLIC_KEY tag. When creating the PGPPublicKeyRing, the sub keys are therefore ignored due to this line. Inspecting the encoded PGPPublicKeyRing with gpg --list-packets also suggests, that only two normal public keys are exported. [1] bcgit/bc-java#381
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
My issue is the following: If I create a PGPSecretKeyRing containing a master key and a sub key, and then try to extract a PGPPublicKeyRing from it, the resulting key ring does only contain one key, as the sub keys are ignored. The cause for this is, that the sub keys are not carrying a PUBLIC_SUBKEY packet tag, but instead a PUBLIC_KEY tag. When creating the PGPPublicKeyRing, the sub keys are therefore ignored due to this line.
Inspecting the encoded PGPPublicKeyRing with
gpg --list-packets
also suggests, that only two normal public keys are exported.I created this minimal example for you to recreate the issue.
The text was updated successfully, but these errors were encountered: