ITeye博客

keytool的用法

chillwarmoon · 2009-02-12 17:07 · tcp · Markdown

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)

暂无评论。

评论功能维护中,当前仅展示历史评论。