Linux "pkcs7" Command Line Options and Examples
The pkcs7 command processes PKCS#7 files in DER or PEM format..
openssl pkcs7 [-help] [-inform PEM|DER] [-outform PEM|DER] [-in filename] [-out filename] [-print_certs]
[-text] [-noout] [-engine id]
Command Line Options:
Print out a usage message.
pkcs7 -help ...
This specifies the input format. DER format is DER encoded PKCS#7 v1.5 structure.PEM (the default) is abase64 encoded version of the DER form with header and footer lines.
pkcs7 -inform ...
This specifies the output format, the options have the same meaning as the -inform option.
pkcs7 -outform ...
This specifies the input filename to read from or standard input if this option is not specified.
pkcs7 -in ...
specifies the output filename to write to or standard output by default.
pkcs7 -out ...
prints out any certificates or CRLs contained in the file. They are preceded by their subject and issuernames in one line format.
pkcs7 -print_certs ...
prints out certificates details in full rather than just subject and issuer names.
pkcs7 -text ...
don't output the encoded version of the PKCS#7 structure (or certificates is -print_certs is set).
pkcs7 -noout ...
specifying an engine (by its unique id string) will cause pkcs7 to attempt to obtain a functionalreference to the specified engine, thus initialising it if needed. The engine will then be set as thedefault for all available algorithms.EXAMPLESConvert a PKCS#7 file from PEM to DER:openssl pkcs7 -in file.pem -outform DER -out file.derOutput all certificates in a file:openssl pkcs7 -in file.pem -print_certs -out certs.pemNOTESThe PEM PKCS#7 format uses the header and footer lines:
pkcs7 -engine ...