So, the steps:
IDENTITY KEYSTORE
CREATE AN EMPTY JKS KEYSTORE
keytool -genkey -alias dummy -keystore identity_keystore.jks
keytool -delete -alias dummy -keystore identity_keystore.jks
IMPORT wallet_server.p12 INTO identity_keystore.jks
keytool -v -importkeystore -srckeystore wallet_server.p12 -srcstoretype PKCS12 -destkeystore identity_keystore.jks -deststoretype JKS
TRUST KEYSTORE
For CAs (which mine is in DER format), I tried a different way. I'm using Firefox browser to convert DER into PEM format.
IMPORT CA CERTIFICATES INTO FIREFOX
options -> Advanced -> Encryption -> View Certificates -> Import
EXPORT THE CAs INTO PEM FORMAT (X.509 Certificate - PEM)
CREATE TRUSTED CA - CERTIFICATE CHAIN KEYSTORE
IMPORT CA CERTIFICATES INTO FIREFOX
options -> Advanced -> Encryption -> View Certificates -> Import
EXPORT THE CAs INTO PEM FORMAT (X.509 Certificate - PEM)
CREATE TRUSTED CA - CERTIFICATE CHAIN KEYSTORE
keytool -import -trustcacerts -file Inter1-CA.pem -keystore trust_keystore.jks -alias inter1
keytool -import -trustcacerts -file Inter2-CA.pem -keystore trust_keystore.jks -alias inter2
keytool -import -trustcacerts -file Root-CA.pem -keystore trust_keystore.jks -alias root
That's it, simple than the previous. Of course, there are many other ways to complete the task, but hope mine helps.
That's it, simple than the previous. Of course, there are many other ways to complete the task, but hope mine helps.
Looking to create an identity keystore from an Oracle wallet file; the first command executes just fine, the second (keytool -delete -alias dummy -keystore identity_keystore.jks) yields "keytool error: java.lang.IllegalStateException: masked envelope"; trying the actual import, I got "Unrecognized command: -v". I'm guessing I need to update my version of keytool, but I'd love some confirmation on that.
ReplyDeleteHa. My keytool was still pointing to the old 1.4.2 version. I updated and the commands worked fine, except that the 'successful' import imported 0 entries.
ReplyDeletekeytool -v -importkeystore -srckeystore QualitySSL2.p12 -srcstoretype PKCS12 -destkeystore banner_keystore.jks -deststoretype JKS
Enter destination keystore password:
Enter source keystore password:
Import command completed: 0 entries successfully imported, 0 entries failed or cancelled
It isn't empty..