Java Tutorial/Security/Keytool
Содержание
- 1 Creating a New Key Pair and Self-Signed Certificate Using keytool
- 2 Export certificate in binary using keytool, if the certificate is in the key store
- 3 Export certificate in text format using keytool, if the certificate is in the key store
- 4 generates a 1024-bit Digital Signature Algorithm (DSA) key pair.
- 5 To create a 1024-bit RSA key:
- 6 using keytool to import a certificate into a keystore
Creating a New Key Pair and Self-Signed Certificate Using keytool
keytool -genkey -alias alias -keystore .keystore
Export certificate in binary using keytool, if the certificate is in the key store
keytool -storepass my-keystore-password -alias myalias -export -file outfilename.cer
Export certificate in text format using keytool, if the certificate is in the key store
keytool -storepass my-keystore-password -alias myalias -export -rfc -file outfilename.cer
generates a 1024-bit Digital Signature Algorithm (DSA) key pair.
keytool -genkey -alias alias -keystore .keystore
To create a 1024-bit RSA key:
keytool -genkey -keyalg RSA -keysize 1024 -alias alias -keystore .keystore
using keytool to import a certificate into a keystore
keytool -storepass my-keystore-password -alias myalias -import -file infilename.cer