Keytool 证书工具使用小结

Keytool 是密钥和证书的管理工具, 用来管理密钥,X.509 证书链, 可信证书的密钥库(数据库)

相关资料

具体操作

1. 命令介绍

➜  keytool --help
Key and Certificate Management Tool

Commands:

 -certreq            Generates a certificate request  #生成一个证书请求文件, 用于向CA申请证书
 -changealias        Changes an entry's alias   #变更别名
 -delete             Deletes an entry    #删除
 -exportcert         Exports certificate     #导出证书
 -genkeypair         Generates a key pair      #创建密钥对
 -genseckey          Generates a secret key     #创建密钥
 -gencert            Generates certificate from a certificate request  #根据 CSR 文件创建一个证书
 -importcert         Imports a certificate or a certificate chain   #导入证书或证书链
 -importkeystore     Imports one or all entries from another keystore    #从另一个keystore导入数据
 -keypasswd          Changes the key password of an entry   #变更密码
 -list               Lists entries in a keystore   #列表显示keystore中的全部数据
 -printcert          Prints the content of a certificate   #打印证书内容
 -printcertreq       Prints the content of a certificate request   #打印证书请求文件的内容
 -printcrl           Prints the content of a CRL file  #打印已废弃证书列表的内容
 -storepasswd        Changes the store password of a keystore  #变更存储密码

Use "keytool -command_name -help" for usage of command_name

storepass: keystore文件本身也可以通过密码加密
keypass: 用于加密keystore文件中密钥的密码
entry: 指keystore文件中存储的密钥,X.509 证书链, 可信证书

2. 创建 keystore 文件

keytool -genkey -alias {{alias_name}}}  -keyalg RSA  -storepass {{store_password}}} -keystore {{file_name}}}.keystore  -keypass {{key_password}}
Paste_Image.png

3. 显示 keystore 文件的版本信息


keytool -list  -v -keystore {{file_name}}.keystore -storepass {{store_passowrd}}
Paste_Image.png

4. 使用 RFC 样式显示 keystore 文件的输出

keytool -list  -rfc  -keystore {{file_name}}.keystore -storepass {{store_passowrd}}
Paste_Image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 服务器https配置 配置https操作说明文档 1、查看服务器环境配置(tomcat和apache合并使用) 2...
    南京杨小兵阅读 8,902评论 0 9
  • 数字证书就是网络通讯中标志通讯各方身份信息的一系列数据,其作用类似于现实生活中的身份证。它是由一个权威机构发行的,...
    拉肚阅读 21,229评论 1 17
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,859评论 18 139
  • 1 基础 1.1 对称算法 描述:对称加密是指加密过程和解密过程使用相同的密码。主要分:分组加密、序列加密。 原理...
    御浅永夜阅读 2,460评论 1 4
  • 继中医思想理解与实践之后,今天终于又要开始关于幸福学的新的感悟之路了,幸福多么可爱的一个词啊,其蕴含着的意义又是何...
    玩哲阅读 3,894评论 3 65