aspose file tools
The moose likes Java in General and the fly likes reading pem format private keys Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: reading pem format private keys
 
Similar Threads
pls check the private key
JCE and binary private keys
Store PrivateKey PublicKey in DB
Accessing HTTPS URL with a Client PEM file
How to store PublicKey and PrivateKey in database??