Steps to create a .jks keystore using .key and .crt files
点击数:48052015-01-12 19:48:35 来源: Oracle Fusion Middleware
Step 1 :
Copy the crt contents to a notepad and save this file with .pem extension.
Copy the contents of private key and save it into a notepad with .pem extension.
—–END RSA PRIVATE KEY—–
Step 3 :
Run the following command :
Syntax : $ java utils.ImportPrivateKey keystore storepass storetype keypass alias certfile keyfile keyfilepass
We have now created an identity.jks file.
To see the contents of this keystore use the following command :
Command : keytool -list -v -keystore identity.jks -storepass password
---
< Additional Information >
The ImportPrivateKey utility is used to load a private key into a private keystore file.
You can use the CertGen utility to create a .key ( testkey ) and .crt ( testcert ) and then use the ImportPrivateKey utility to create a .jks file.
Note: By default, the CertGen utility looks for the CertGenCA.der and CertGenCAKey.der files in the current directory, or in the WL_HOME/server/lib directory, as specified in the weblogic.home system property or the CLASSPATH.
Alternatively, you can specify CA files on the command line. If you want to use the default settings, there is no need to specify CA files on the command line.
1. Enter the following command to generate certificate files named testcert with private key files named testkey:
Command : $ java utils.CertGen -keyfilepass mykeypass -certfile testcert -keyfile testkey
2. Convert the certificate from DER format to PEM format.
Command : $ java utils.der2pem CertGenCA.der
3. Concatenate the certificate and the Certificate Authority (CA).
Command : $ cat testcert.pem CertGenCA.pem >> newcerts.pem
4. Create a new keystore named mykeystore and load the private key located in the testkey.pem file.
Command : $ java utils.ImportPrivateKey -keystore mykeystore -storepass mypasswd -keyfile mykey -keyfilepass mykeypass -certfile newcerts.pem -keyfile testkey.pem -alias passalias
上一页1下一页 |
原文地址:https://www.chinassl.net/faq/n553.html
版权所有@转载请注明出处:CHINASSL[https://www.chinassl.net]