Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Keystore for Asymmetric Keys (Bouncy Castle)

843810Jan 10 2003 — edited Jan 11 2003
I've currently got some data to encrypt with RSA (don't worry, data is very small!). Thanks to euxx, I've used BouncyCastle to successfully generate a private and public key-pair, and can encrypt/decrypt the data without a problem.

However, when I move beyond prototyping, I need to secure the private and public key, rather have it generated within the program (fair enough!). I'm fairly sure that using a Keystore is the right way to go, and I used this successfully with a symmetric key using the Sun JCE provider. What I don't know is what I should be doing for asymmetric, using BouncyCastle provider.

Do I use the Sun keystore, or the BC one (if so, which BC one?).
I'm trying the standard BC one, but it seems like I cannot store the public and private key without reference to a certificate. Is this necessary for encryption? I thought I only needed to consider using certificates for authentication purposes? If so, what sort of certificate do I create, and do I need one for both public and private key, or can I store one of them independently of the certificate.

Oh, and I'd rather create the keys in the keystore programmatically rather than via keytool, but at them moment I'll accept anything that works!

Supplementary questions are likely depending on answers!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2003
Added on Jan 10 2003
5 comments
621 views