keytool的用法

keytool is a key and certificate management utility.

keytool -printcert -file abc.cer
打印证书abc.cer的信息

keytool -export -keystore client.keystore -alias myca -file abc.cer
导出证书信息,keystore文件为client.keystore,证书别名为myca,导出的证书文件名abc.cer

keytool -list -keystore client.keystore -alias myca
列出entry信息,keystore文件为client.keystore,entry的别名为myca

keytool -list -alias myca
列出keystore文件中的所有的entry信息,keystore文件默认为~/.keystore

keytool -genkey -alias ok-entry -keystore ok.keystore -keypass 123456
生成entry key,别名为ok-entry keystore文件为ok.keystore,private key密码123456。
关于此keystore文件的密码在生成时指定。
keypass is a password used to protect the private key of the generated key pair. If no password is provided, the user is prompted for it.

storepass: The password which is used to protect the integrity of the keystore.

keytool -import -alias joe -file ok.cer -keystore ok.keystore
导入信任证书,将证书ok.cer导入到keystore中,以joe为entry的别名,keystore文件为ok.keystore。导入的证书为trustedCertEntry。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值