As of GnuPG 2.3.8 the features subpacket section 30 (under signature packet) is now always adding the reserved flags. Since PGPy does not recognize these flags it removes them and alters the key value making the key unusable later with GnuPG.
Reproduction steps:
- Install GnuPG 2.3.8+
- Create new key
gpg --expert --full-generate-key
- Export key
gpg --armor --output test-key-2.3.8.asc --export <key id here>
- Import key using PGPy
my_key = pgpy.PGPKey.from_file(test-key-2.3.8.asc)
- Print public key using PGPy
str(my_key.pubkey)
- Original value is different than the printed public key using PGPy
str(my_key.pubkey) != test-key-2.3.8.asc
- Try to import the printed key into GnuPG from PGPy and unable.