wood burning stoves 2.0*
The moose likes Java in General and the fly likes reading pem format private keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "reading pem format private keys" Watch "reading pem format private keys" New topic
Author

reading pem format private keys

srini Raman
Ranch Hand

Joined: Oct 16, 2006
Posts: 33
Hi,
How can I read pem formated private keys using java classes. I am trying to pass it to PKCS8EncodedKeySpec and then using this in KeyFactory to generate private key.But at this step I get error...Should I decode (Base64)and remove the -----BEGIN RSA private KEY--- ----END RSA PRIVATE KEY--
Strings before passing this to PKCS8EncodedKeySpec ??

Thanks,
Srini
srini Raman
Ranch Hand

Joined: Oct 16, 2006
Posts: 33
Seems I can use Bouncycastle apis for the purpose.It has PEMReader,PEMWriter classes.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading pem format private keys