Re: PGPPublicKeyRing from PGPSecretKeyRing
David Hook <dgh-rTAZ0PM/[email protected]>
| Newsgroups | gmane.comp.encryption.bouncy-castle.devel |
|---|---|
| Message-ID | <[email protected]> |
There's code for this in PGPKeyRingGenerator - actually you might find it does the job. I'd be interested to know if it doesn't. Regards, David On 10/06/18 20:29, Paul Schaub wrote: > Hi! > > I'm currently working with BouncyCastle on an OpenPGP Java project. For > that reason I have to create OpenPGP key pairs for the user. > > I created a builder that returns a PGPSecretKeyRing as result of the > build() method. Now for convenience I would like to be able to easily > retrieve the PGPPublicKeyRing from the secret key ring. > > For now the only way to accomplish that that I came across is, to > serialize the PGPSecretKeyRing to a byte array and deserialize it into a > PGPPublicKeyRing. Same procedure applies if I want to convert a key ring > into a key ring collection. However, this appears a little inefficient > to me. > > Is there a better way to do this? > > Greetings > Paul > > > >