1 2 Previous Next 16 Replies Latest reply on Sep 19, 2011 6:44 AM by handat Go to original post
      • 15. Re: Decode private key from DER format
        So do what it says in the article you cited. Convert it to DER with the OpenSSL tool, then you have a file you can load with the Java code in the article.

        I'd love to know why you're avoiding the keystore solution though. You do realize that it secures the private key with a password? If you do what you're presently planning the key file will just be lying around on the disk.
        • 16. Re: Decode private key from DER format
          Firstly, read your PEM file and base64 decode the content between -----(BEGIN|END) RSA PRIVATE KEY-----. That will give you a byte array which you can pass to a PKCS8EncodedKeySpec which in turn can be used to generate a PrivateKey object from a KeyFactory.
          1 2 Previous Next