Difference between revisions of "Working with SSL"

From Opentaps Wiki
Jump to navigationJump to search
m (Protected "Working with SSL": Sysop page [edit=sysop:move=sysop])
(Converting PEM to JKS Private Key)
Line 21: Line 21:
 
Re-enter new keystore password:
 
Re-enter new keystore password:
 
</pre>
 
</pre>
 +
 +
ImportKey.java can be obtained from [http://www.agentbob.info/agentbob/79-AB.html]

Revision as of 21:57, 20 April 2009

Converting PEM to JKS Private Key

  • key.pem is the private SSL key
  • cert.pem is the certificate for the SSL key
$ openssl pkcs8 -topk8 -nocrypt -in key.pem -inform PEM -out key.der -outform DER

$ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER

$ javac ImportKey.java

$ java ImportKey key.der cert.der
Using keystore-file : /home/user/keystore.ImportKey
One certificate, no chain.
Key and certificate stored.
Alias:importkey  Password:importkey

$ keytool -keystore keystore.ImportKey -storepass
Enter keystore password:
New keystore password:
Re-enter new keystore password:

ImportKey.java can be obtained from [1]