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!

Private key problem

843811Feb 23 2006 — edited May 24 2006
hey folks,

i would like to store a certificate's private key in a mysql db.

my problem is that i don't know how to convert it back to a PrivateKey when i extract it from the db.

i use the function Base64.encode(userPrivKey.getEncoded()); (org.bouncycastle.util.encoders.Base64; to store the private key base64 encoded in the db.

when i extract the key from the db i can decode it with Base64.decode(). the problem is that the decode function only returns a byte array.

so does anybody know how i can convert that byte array back to a private key?

or is there any other (better) solution to store and retrieve private keys from a mysql db?

many thanks

toto
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2006
Added on Feb 23 2006
7 comments
607 views