neuhalje / bouncy-gpg

Make using Bouncy Castle with OpenPGP fun again!
https://neuhalje.github.io/bouncy-gpg/
Other
205 stars 58 forks source link

Get Key Usage for older legacy keys of PGP version 6.5.8 Network Associates #57

Open Susmit07 opened 4 years ago

Susmit07 commented 4 years ago

No able to get the key usage from the Key rings of PGP version 6.5.8 Network Associates

Iterator<PGPSignature> sigItr = secretKey.getPublicKey().getSignatures(); StringBuilder keyUsage = new StringBuilder(); while (sigItr.hasNext()) { PGPSignature sig = sigItr.next(); PGPSignatureSubpacketVector subPacks = sig.getHashedSubPackets(); if (subPacks != null) { if ((subPacks.getKeyFlags() & KeyFlags.ENCRYPT_COMMS) == 4) {

Expected behavior

It should fetch me the actual key usages, it's working for all keys except for PGP version 6.5.8 Network associates types key

System (please complete the following information):

neuhalje commented 3 years ago

Please test with 2.3.0 (should be in maven any time now)

Susmit07 commented 3 years ago

I am able to solve this in a different way, do you want me to commit ?