Now you can import the file to the destination machine and configure the web server to use it. Note: Please replace the “qqq” behind “-srcalias” with the alias, you noted in the previous step and the “xxx” behind “-deststorepass” with the password for the .jks file. The last step is now to import the certificate and its private key into the keystore by running the following command: keytool -importkeystore -srckeystore d:\cert\wildcard.pfx -srcstoretype pkcs12 -srcalias -destkeystore d:\cert\wildcard.jks -deststoretype jks -deststorepass xxx -destalias wildcard Open the file cert.txt and look for the line starting with “ Aliasname:“. To do so, run the following command: keytool -v -list -storetype pkcs12 -keystore d:\cert\wildcard.pfx > d:\cert\cert.txt In order to import the certificate, we first have to reveal the alias used. Now we import the other two CA certificates the same way: keytool -import -trustcacerts -file "d:\cert\COMODORSAAddTrustCA.crt" -alias COMODORSAAddTrustCA -keystore d:\cert\wildcard.jks -storepass xxx keytool -import -trustcacerts -file "d:\cert\COMODORSAOrganizationValidationSecureServerCA.crt" -alias COMODORSAOrganizationValidationSecureServerCA -keystore d:\cert\wildcard.jks -storepass xxx Note: Please replace the “xxx” behind “-storepass” with a reasonable password. I use it a lot and never had a need for something else. Keytool is ultimate tool when dealing with Java keystore, but there is one fancy and quite powerful free tool: Keystore explorer. Since the key store doesn’t exist, it will create it automatically: keytool -import -trustcacerts -file "d:\cert\AddTrustExternalCARoot.crt" -alias AddTrustExternalCARoot -keystore d:\cert\wildcard.jks -storepass xxx Try 'Keystore Explorer' I agree with Bruno. The first command puts the root CA’s certificate into the keystore. Now, we’ll use the keytool command inside the java installation folder (in my case C:\Program Files\Java\jre1.8.0_201\bin to create the keystore and put all necessary files in there. Click the below link to download the Java Source code and PPT. KeyStore Explorer can be used to create and navigate KeyStores via its intuitive graphical interface. KeyStore Explorer presents their functionality, and more, via an intuitive graphical user interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |