论坛首页 入门技术论坛

keytool的用法

浏览 2715 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-02-12  
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。
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics