博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Openssl pkcs12命令
阅读量:6168 次
发布时间:2019-06-21

本文共 3095 字,大约阅读时间需要 10 分钟。

一、简介

pkcs12命令能生成和分析pkcs12文件

 

二、语法

openssl pkcs12 [-export] [-chain] [-inkey filename] [-certfile filename] [-CApath arg] [-CAfile arg] [-name name] [-caname name] [-in filename] [-out filename] [-noout] [-nomacver] [-nocerts] [-clcerts] [-cacerts] [-nokeys] [-info] [-noiter] [-maciter] [-nomaciter] [-nomac] [-twopass] [-descert] [-certpbe alg] [-keypbe alg] [-macalg digest] [-keyex] [-keysig] [-password arg] [-passin arg] [-passout arg] [-rand file(s)] [-LMK] [-CSP name][-engine e] [-des] [-des3] [-aes128] [-aes192] [-aes256] [-idea] [-camellia128] [-camellia192] [-camellia256] [-nodes]

选项

-export       output PKCS12 file-chain        add certificate chain-inkey file   private key if not infile-certfile f   add all certs in f-CApath arg   - PEM format directory of CA's-CAfile arg   - PEM format file of CA's-name "name"  use name as friendly name-caname "nm"  use nm as CA friendly name (can be used more than once).-in  infile   input filename-out outfile  output filename-noout        don't output anything, just verify.-nomacver     don't verify MAC.-nocerts      don't output certificates.-clcerts      only output client certificates.-cacerts      only output CA certificates.-nokeys       don't output private keys.-info         give info about PKCS#12 structure.-des          encrypt private keys with DES-des3         encrypt private keys with triple DES (default)-idea         encrypt private keys with idea-seed         encrypt private keys with seed-aes128, -aes192, -aes256              encrypt PEM output with cbc aes-camellia128, -camellia192, -camellia256              encrypt PEM output with cbc camellia-nodes        don't encrypt private keys-noiter       don't use encryption iteration-nomaciter    don't use MAC iteration-maciter      use MAC iteration-nomac        don't generate MAC-twopass      separate MAC, encryption passwords-descert      encrypt PKCS#12 certificates with triple DES (default RC2-40)-certpbe alg  specify certificate PBE algorithm (default RC2-40)-keypbe alg   specify private key PBE algorithm (default 3DES)-macalg alg   digest algorithm used in MAC (default SHA1)-keyex        set MS key exchange type-keysig       set MS key signature type-password p   set import/export password source-passin p     input file pass phrase source-passout p    output file pass phrase source-engine e     use engine e, possibly a hardware device.-rand file:file:...              load the file (or the files in the directory) into              the random number generator-CSP name     Microsoft CSP name-LMK          Add local machine keyset attribute to private key

 

三、实例

1、PKCS与PEM格式互转

1)PEM转成PKCS12文件(包含CA证书、不包含CA证书)

openssl pkcs12 -export -inkey serverprikey.pem -in server.pem -CAfile demoCA/cacert.pem -password pass:"123456" -out server.pfx
openssl pkcs12 -export -inkey serverprikey.pem -in server.pem -password pass:"123456" -out server_nocret.pfx

2)PKCS12转成PEM文件

openssl pkcs12 -in server_nocret.pfx -out server_nocret.pem -nodes -password pass:"123456"

2、查看pkcs12信息

openssl pkcs12 -in server.pfx -password pass:"123456" -info -nocerts –nokeys

 

参考:

转载地址:http://xljba.baihongyu.com/

你可能感兴趣的文章
Ajax跨域请求问题
查看>>
topic4:Qt入门之常用qt控件认知之Button系列
查看>>
jstack:Java堆栈跟踪工具
查看>>
源码安装 python3
查看>>
获取当前fragment
查看>>
linux centeros 7.4 修改主机名
查看>>
关于程序员,你知道的有多少?
查看>>
Tomcat问题汇总
查看>>
由于未预料的错误,现在无法使用nautilus
查看>>
业界最有价值的Linux资料大全(200篇)
查看>>
Arraylist动态扩容详解
查看>>
%cd%及%~dp0批处理命令的详解
查看>>
MySQL数据库负载很高连接数很多怎么处理
查看>>
关于延迟加载(lazy)和强制加载(Hibernate.initialize(Object proxy) )
查看>>
Cent OS 环境下 samba服务器的搭建
查看>>
vCloud Director 1.5.1 Install Procedure
查看>>
hive 中的多列进行group by查询方法
查看>>
Cisco统一通信---视频部分
查看>>
nginx编译及参数详解
查看>>
VMware下PM魔术分区使用教程
查看>>