Search code examples
javabouncycastlepgp

Restore PGP public key from private in bouncycastle


In algorythmic level it is possible to restore public key from private. But is there a way to do it in bouncycastle library with PGP keys?

Thanks!


Solution

  • in PGPPrivateKey there is the method getPublicKeyPacket, which in turn has the method getKey.

    Isn't it what you're looking for?