You can also generate a certificate by using any utility or tool of your choice. The keytool utility (which is available with JDK) has been used for the following operations:
keytool stores the keys and certificates in a file termed a keystore, which is a repository of certificates used for identifying a client or a server. Typically, a keystore is specific to one client or one server. The default keystore implementation implements the keystore as a file. It protects private keys by using a password. The keystores are created in the directory from which you run keytool.
Use the following command to generate the keystore:
$%JAVA_HOME%/\bin/\keytool -genkey -keyalg RSA -alias <server/or/client> -keystore <keystore_name>.jks -storetype JKS -storepass <password> -keysize 1024 -validity <validity_period_in_days>
CSR is encrypted identification text (see the first table in Obtaining Certificates Directly Through a Certificate Authority (CA) ), and must be generated on the system where the certificate will be used. A private key is usually created at the same time that you create the CSR.
Use the following command to generate the CSR:
$%JAVA_HOME%/\bin/\keytool -certreq -v -alias <server/or/client> -keystore <keystore_name>.jks -storepass <password> -file <server/or/client>certreq.csr
For example, if you are using MSCA, then the link will be similar to:
http://<IP_Address_of_the_CA>/certsrv/
For example, if you are using MSCA, then under Select a task section, click the Request a certificate option, then advanced certificate request option, and then the Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file option (or if you are renewing the certificate, then submit a renewal request by using a base-64-encoded PKCS #7 file). Finally, copy and paste the contents of <server/or/client>clientcertreq.csr in the Base-64-encoded certificate request field and click Submit.
Use the following command to do so:
$%JAVA_HOME%/\bin/\keytool -import -keystore <server/or/client>keystore.jks -storepass <password> -file <server/or/client>certchain.p7b -alias <server/or/client>
openssl x509 -inform der -in <server/or/client>cert.cer -out <server/or/client>cert.pem
openssl pkcs12 -export -out <server/or/client>cert.pfx -inkey privateKey.key -in <server/or/client>cert.cer -certfile <server/or/client>cacert.cer
openssl pkcs7 -print_certs -in <server/or/client>cert.p7b -out <server/or/client>cert.cer
openssl pkcs12 -export -in <server/or/client>cert.cer -inkey privateKey.key -out <server/or/client>cert.pfx -certfile <server/or/client>cacert.cer
|
Copyright © 2014 CA Technologies.
All rights reserved.
|
|