内容概览:
keytool的几个常用的命令。
1.创建证书
2.查看证书库
3.导出证书文件
4.导入证书的信息
5.查看证书信息
6.删除密钥库中的条目
7.修改证书条目的口令
--------------------------------------------------------------------------------------
预备知识:
SUN公司提供了制作证书的工具keytool。
在JDK 1.4以后的版本中都包含了这一工具,它的位置为<JAVA_HOME>\bin\keytool.exe。
--------------------------------------------------------------------------------------
主要内容:
1.创建证书
keytool -genkeypair -alias "test1" -keyalg "RSA" -keystore "test.keystore"
说明:
密钥库密码为testtest
证书条目密码为testtest1,若别名为test2则密码为testtest2
这样为个不乱
功能:
创建一个别名为test1的证书条目,该条目存放在名为test.keystore的密钥库中,若test.keystore密钥库不存在则创建。
参数说明:
-genkeypair:生成一对非对称密钥;
-alias:指定密钥对的别名,该别名是公开的;
-keyalg:指定加密算法,本例中的采用通用的RAS加密算法;
-keystore:密钥库的路径及名称,不指定的话,默认在操作系统的用户目录下生成一个".keystore"的文件
注意:
1.“名字与姓氏”应该是域名,若输成了姓名,和真正运行的时候域名不符,会出问题;
2.再次输入密码,第一次输入的是密钥库(keystore)的密码,第二次输入的是证书条目的密码
3.这里所说的证书库和密钥库是等同的(个人观点)
为了测试需要,这里再创建两个别名为test2和test3的证书条目在test.keystore密钥库中,代码如下:
keytool -genkeypair -alias "test2" -keyalg "RSA" -keystore "test.keystore" keytool -genkeypair -alias "test3" -keyalg "RSA" -keystore "test.keystore"
2.查看证书库
keytool -list -keystore test.keystore
功能:
查看名为test.keystore的证书库中的证书条目
3.导出到证书文件
keytool -export -alias test1 -file test.crt -keystore test.keystore
功能:
将名为test.keystore的证书库中别名为test1的证书条目导出到证书文件test.crt中
4.导入证书的信息
keytool -import -keystore test_cacerts -file test.crt
功能:
将证书文件test.crt导入到名为test_cacerts的证书库中,
5.查看证书信息
keytool -printcert -file "test.crt"
功能:
查看证书文件test.crt的信息
6.删除密钥库中的条目
删除前查看密钥库test.keysote中的证书条目
keytool -list -keystore test.keystore
删除密钥库test.keystore中别名为test2的证书条目
keytool -delete -keystore test.keystore -alias test2
删除后查看密钥库test.keystore中的证书条目
keytool -list -keystore test.keystore
7.修改证书条目的口令
交互的方式
keytool -keypasswd -alias test1 -keystore test.keystore
功能:
将密钥库test.keystore中别名为test1的证书条目的密码修改为testtesttest1
非交互方式
keytool -keypasswd -alias test1 -keypass testtesttest1 -new testtest1 -storepass testtest -keystore test.keystore
功能:
将密钥库test.keystore中别名为test1的证书条目的密码修改为testtest1
--------------------------------------------------------------------------------------
相关推荐
Keytool与数字证书
java keytool 使用总结 结合网络资源,对keytool使用总结
keytoolgui
java keytool使用例子 keytool
密钥管理工具 Keytool-IUI
keytool图形化工具 KeyToolGui-17-setup.rar
keytool -genkey -alias ChangeBackgroundWid get.keystore -keyalg RSA -validity 20000 -eystore ChangeBackgroundWidget.keystore 上面的命令中间不换行,按下“Enter”键,并根据提示填写相关信息,详细信息如下...
KeyTool1.6,数字证书工具、服务器证书管理工具。用于数字证书私钥公钥管理。可新增私钥文件。,数字证书工具、
1) KeyTool IUI: . Java Runtime 1.5, or higher 2) KeyTool IUI Plus: . Java Runtime 1.5, or higher . Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0 ...
KeyTool1.6,数字证书工具、服务器证书管理工具。用于数字证书私钥公钥管理。可新增私钥文件。
Keytool IUI 支持JDK1.6及以上
java keytool gui
KeyTool制作证书
密钥管理工具 Keytool-IUI.7z
keytool 是个密钥和证书管理工具。它使用户能够管理自己的公钥/私钥对及相关证书,用于(通过数字签名)自我认证(用户向别的用户/服务认证自己)或数据完整性以及认证服务。它还允许用户储存他们的通信对等者的公钥...
keytool-importkeypair 是生成keystore的必须文件,可以用此工具放于目录文件夹下载,和系统的 platform.pk8 platform.x509.pem 以及signapk.jar 生成签名文件,让软件编译的时候就有系统签名
基于java的keytool GUI 图形工具 含:安装版和jar版
keytool-advanced-v2.01.zip keytool密钥和证书管理工具
利用keytool生成数字证书。.bat文件。配置好java环境变量后,直接运行即可。非常简单。