Sunday, 15 November 2015

KeyStore commands

Command
Description
keytool -genkey -keystore keystorename -storepass keystorepassword
Generates a new private key entry and self-signed digital certificate in a keystore. If the keystore does not exist, it is created.
keytool -import -alias aliasforprivatekey
-file 
privatekeyfilename.pem-keypass privatekeypassword-keystore keystorename -storepass keystorepassword
Updates the self-signed digital certificate with one signed by a trusted CA.
keytool -import -alias aliasfortrustedca -trustcacerts -filetrustedcafilename.pem -keystore keystorename -storepasskeystorepassword
Loads a trusted CA certificate into a keystore. If the keystore does not exist, it is created.
-certreq -alias alias
-sigalg sigalg
-file certreq_file-keypass privatekeypassword-storetype keystoretype-keystore keystorename-storepass keystorepassword
Generates a CSR, using the PKCS#10 format.
Sent the CSR to be sent to a trusted CA. The trusted CA authenticates the certificate requestor and returns a digital certificate to replace the existing self-signed digital certificate in the keystore.
keytool -list -keystore keystorename
Displays what is in the keystore.
keytool -delete -keystore keystorename -storepass keystorepassword-alias privatekeyalias
Delete a private key/digital certifcate pair for the specified alias from the keystore.
keytool -help

No comments:

Post a Comment