File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading pem format private keys

 
srini Raman
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic