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!

pem files reading

843810Oct 30 2002 — edited Nov 7 2002
hi all,

I have to read pem key files to get RSA Public key and RSA Private key,
and then use them to encrypt or decrypt.

I can do this using openssl and convert pem file to der file.
and then load my key using X509EncodedKeySpec and PKCS8EncodedKeySpec.

But I don't want to do this because pem is the user key exchange format.
user can register it's own key can like this :

-----BEGIN PUBLIC KEY-----
MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgGi0/vKrSIIQMOm4atiw+2s8tSojOKHsWJU3oPTm
b1a5UQIH7CM3NgtLvUF5DqhsP2jTqgYSsZSl+W2RtqCFTavZTWvmc0UsuK8tTzvnCXETsnpjeL13
Hul9JIpxZVej7b6KxgyxFAhuz2AGscvCXnepElkVh7oGOqkUKL7gZSD7AgMBAAE=
-----END PUBLIC KEY-----

and this key is store in a database in this format...

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 5 2002
Added on Oct 30 2002
2 comments
862 views