Openssl pkcs7命令

时间:2023-03-09 00:13:22
Openssl pkcs7命令

一、简介

pkcs7命令用于处理DER或者PEM格式的pkcs#7文件。

 

二、语法

openssl pkcs7 [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] [-print] [-print_certs] [-text] [-noout] [-engine id]

选项

-inform arg   input format - DER or PEM
-outform arg output format - DER or PEM
-in arg input file
-out arg output file
-print_certs print any certs or crl in the input
-text print full details of certificates
-noout don't output encoded data
-engine e use engine e, possibly a hardware device.

 

三、实例

1、把一个PKCS#7文件从PEM格式转换成DER格式

openssl pkcs7 -in file.pem -outform DER -out file.der

Openssl pkcs7命令

2、 打印PKCS#7格式CRL列表

openssl pkcs7 -in crlpkcs7.pem -print_certs

 

四、知识扩展

1)PKCS7 的 attached 和 detached 方式的数字签名