1. Create a certificate
| 1 |
keytool -genkeypair -alias "cas"-keyalg "RSA"-keystore "F:\sync\java\Keys\cas.keystore" |
1, "First name and surname" should be the domain name, if the name is lost, and the real run when the domain name does not match, will be problematic;
2, re-enter the password, the first input is the key store (keystore) password, the second time entered is the password of the certificate entry
3. keystore file is a key pair (private key and public key)
| 12345678910111213141516 |
-certreq 生成证书请求-changealias 更改条目的别名-delete删除条目-exportcert 导出证书-genkeypair 生成密钥对-genseckey 生成密钥-gencert 根据证书请求生成证书-importcert 导入证书或证书链-importpass 导入口令-importkeystore 从其他密钥库导入一个或-keypasswd 更改条目的密钥口令-list 列出密钥库中的条目-printcert 打印证书内容-printcertreq 打印证书请求的内容-printcrl 打印 CRL 文件的内容-storepasswd 更改密钥库的存储口令 |
2. View KeyStore
| 1 |
keytool -list -keystore "F:\sync\java\Keys\cas.keystore" |
3. Export to certificate file
| 1 |
keytool -export -alias cas -file "F:\sync\java\Keys\cas.crt"-keystore "F:\sync\java\Keys\cas.keystore" |
1. The certificate file contains the public key, the name, and the digital signature of the Certificate Authority Center
4. Import the certificate information
| 1 |
keytool -import -keystore "F:\sync\java\Keys\cas.keystore"-file "F:\sync\java\Keys\cas.crt" |
5. View certificate Information
| 1 |
keytool -printcert -file "F:\sync\java\Keys\cas.crt" |
6. Delete entries in the KeyStore
| 1 |
keytool -delete -keystore "F:\sync\java\Keys\cas.keystore"-alias cas |
7. Modify the password for the certificate entry
| 1 |
keytool -keypasswd -alias cas -keystore "F:\sync\java\Keys\cas.keystore" |
From for notes (Wiz)
Keytool tool Use