712 lines
21 KiB
HTML
712 lines
21 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of SMIME</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>SMIME</H1>
|
|
Section: OpenSSL (1SSL)<BR>Updated: 2021-03-22<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
openssl-smime, smime - S/MIME utility
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>openssl</B> <B>smime</B>
|
|
[<B>-help</B>]
|
|
[<B>-encrypt</B>]
|
|
[<B>-decrypt</B>]
|
|
[<B>-sign</B>]
|
|
[<B>-resign</B>]
|
|
[<B>-verify</B>]
|
|
[<B>-pk7out</B>]
|
|
[<B>-binary</B>]
|
|
[<B>-crlfeol</B>]
|
|
[<B>-</B>cipher<B></B>]
|
|
[<B>-in file</B>]
|
|
[<B>-CAfile file</B>]
|
|
[<B>-CApath dir</B>]
|
|
[<B>-no-CAfile</B>]
|
|
[<B>-no-CApath</B>]
|
|
[<B>-attime timestamp</B>]
|
|
[<B>-check_ss_sig</B>]
|
|
[<B>-crl_check</B>]
|
|
[<B>-crl_check_all</B>]
|
|
[<B>-explicit_policy</B>]
|
|
[<B>-extended_crl</B>]
|
|
[<B>-ignore_critical</B>]
|
|
[<B>-inhibit_any</B>]
|
|
[<B>-inhibit_map</B>]
|
|
[<B>-partial_chain</B>]
|
|
[<B>-policy arg</B>]
|
|
[<B>-policy_check</B>]
|
|
[<B>-policy_print</B>]
|
|
[<B>-purpose purpose</B>]
|
|
[<B>-suiteB_128</B>]
|
|
[<B>-suiteB_128_only</B>]
|
|
[<B>-suiteB_192</B>]
|
|
[<B>-trusted_first</B>]
|
|
[<B>-no_alt_chains</B>]
|
|
[<B>-use_deltas</B>]
|
|
[<B>-auth_level num</B>]
|
|
[<B>-verify_depth num</B>]
|
|
[<B>-verify_email email</B>]
|
|
[<B>-verify_hostname hostname</B>]
|
|
[<B>-verify_ip ip</B>]
|
|
[<B>-verify_name name</B>]
|
|
[<B>-x509_strict</B>]
|
|
[<B>-certfile file</B>]
|
|
[<B>-signer file</B>]
|
|
[<B>-recip file</B>]
|
|
[<B>-inform SMIME|PEM|DER</B>]
|
|
[<B>-passin arg</B>]
|
|
[<B>-inkey file_or_id</B>]
|
|
[<B>-out file</B>]
|
|
[<B>-outform SMIME|PEM|DER</B>]
|
|
[<B>-content file</B>]
|
|
[<B>-to addr</B>]
|
|
[<B>-from ad</B>]
|
|
[<B>-subject s</B>]
|
|
[<B>-text</B>]
|
|
[<B>-indef</B>]
|
|
[<B>-noindef</B>]
|
|
[<B>-stream</B>]
|
|
[<B>-rand file...</B>]
|
|
[<B>-writerand file</B>]
|
|
[<B>-md digest</B>]
|
|
[cert.pem]...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The <B>smime</B> command handles S/MIME mail. It can encrypt, decrypt, sign and
|
|
verify S/MIME messages.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
There are six operation options that set the type of operation to be performed.
|
|
The meaning of the other options varies according to the operation type.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-help</B><DD>
|
|
|
|
|
|
Print out a usage message.
|
|
<DT id="2"><B>-encrypt</B><DD>
|
|
|
|
|
|
Encrypt mail for the given recipient certificates. Input file is the message
|
|
to be encrypted. The output file is the encrypted mail in <FONT SIZE="-1">MIME</FONT> format.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that no revocation check is done for the recipient cert, so if that
|
|
key has been compromised, others may be able to decrypt the text.
|
|
<DT id="3"><B>-decrypt</B><DD>
|
|
|
|
|
|
Decrypt mail using the supplied certificate and private key. Expects an
|
|
encrypted mail message in <FONT SIZE="-1">MIME</FONT> format for the input file. The decrypted mail
|
|
is written to the output file.
|
|
<DT id="4"><B>-sign</B><DD>
|
|
|
|
|
|
Sign mail using the supplied certificate and private key. Input file is
|
|
the message to be signed. The signed message in <FONT SIZE="-1">MIME</FONT> format is written
|
|
to the output file.
|
|
<DT id="5"><B>-verify</B><DD>
|
|
|
|
|
|
Verify signed mail. Expects a signed mail message on input and outputs
|
|
the signed data. Both clear text and opaque signing is supported.
|
|
<DT id="6"><B>-pk7out</B><DD>
|
|
|
|
|
|
Takes an input message and writes out a <FONT SIZE="-1">PEM</FONT> encoded PKCS#7 structure.
|
|
<DT id="7"><B>-resign</B><DD>
|
|
|
|
|
|
Resign a message: take an existing message and one or more new signers.
|
|
<DT id="8"><B>-in filename</B><DD>
|
|
|
|
|
|
The input message to be encrypted or signed or the <FONT SIZE="-1">MIME</FONT> message to
|
|
be decrypted or verified.
|
|
<DT id="9"><B>-inform SMIME|PEM|DER</B><DD>
|
|
|
|
|
|
This specifies the input format for the PKCS#7 structure. The default
|
|
is <B></B><FONT SIZE="-1"><B>SMIME</B></FONT><B></B> which reads an S/MIME format message. <B></B><FONT SIZE="-1"><B>PEM</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>DER</B></FONT><B></B>
|
|
format change this to expect <FONT SIZE="-1">PEM</FONT> and <FONT SIZE="-1">DER</FONT> format PKCS#7 structures
|
|
instead. This currently only affects the input format of the PKCS#7
|
|
structure, if no PKCS#7 structure is being input (for example with
|
|
<B>-encrypt</B> or <B>-sign</B>) this option has no effect.
|
|
<DT id="10"><B>-out filename</B><DD>
|
|
|
|
|
|
The message text that has been decrypted or verified or the output <FONT SIZE="-1">MIME</FONT>
|
|
format message that has been signed or verified.
|
|
<DT id="11"><B>-outform SMIME|PEM|DER</B><DD>
|
|
|
|
|
|
This specifies the output format for the PKCS#7 structure. The default
|
|
is <B></B><FONT SIZE="-1"><B>SMIME</B></FONT><B></B> which write an S/MIME format message. <B></B><FONT SIZE="-1"><B>PEM</B></FONT><B></B> and <B></B><FONT SIZE="-1"><B>DER</B></FONT><B></B>
|
|
format change this to write <FONT SIZE="-1">PEM</FONT> and <FONT SIZE="-1">DER</FONT> format PKCS#7 structures
|
|
instead. This currently only affects the output format of the PKCS#7
|
|
structure, if no PKCS#7 structure is being output (for example with
|
|
<B>-verify</B> or <B>-decrypt</B>) this option has no effect.
|
|
<DT id="12"><B>-stream -indef -noindef</B><DD>
|
|
|
|
|
|
The <B>-stream</B> and <B>-indef</B> options are equivalent and enable streaming I/O
|
|
for encoding operations. This permits single pass processing of data without
|
|
the need to hold the entire contents in memory, potentially supporting very
|
|
large files. Streaming is automatically set for S/MIME signing with detached
|
|
data if the output format is <B></B><FONT SIZE="-1"><B>SMIME</B></FONT><B></B> it is currently off by default for all
|
|
other operations.
|
|
<DT id="13"><B>-noindef</B><DD>
|
|
|
|
|
|
Disable streaming I/O where it would produce and indefinite length constructed
|
|
encoding. This option currently has no effect. In future streaming will be
|
|
enabled by default on all relevant operations and this option will disable it.
|
|
<DT id="14"><B>-content filename</B><DD>
|
|
|
|
|
|
This specifies a file containing the detached content, this is only
|
|
useful with the <B>-verify</B> command. This is only usable if the PKCS#7
|
|
structure is using the detached signature form where the content is
|
|
not included. This option will override any content if the input format
|
|
is S/MIME and it uses the multipart/signed <FONT SIZE="-1">MIME</FONT> content type.
|
|
<DT id="15"><B>-text</B><DD>
|
|
|
|
|
|
This option adds plain text (text/plain) <FONT SIZE="-1">MIME</FONT> headers to the supplied
|
|
message if encrypting or signing. If decrypting or verifying it strips
|
|
off text headers: if the decrypted or verified message is not of <FONT SIZE="-1">MIME</FONT>
|
|
type text/plain then an error occurs.
|
|
<DT id="16"><B>-CAfile file</B><DD>
|
|
|
|
|
|
A file containing trusted <FONT SIZE="-1">CA</FONT> certificates, only used with <B>-verify</B>.
|
|
<DT id="17"><B>-CApath dir</B><DD>
|
|
|
|
|
|
A directory containing trusted <FONT SIZE="-1">CA</FONT> certificates, only used with
|
|
<B>-verify</B>. This directory must be a standard certificate directory: that
|
|
is a hash of each subject name (using <B>x509 -hash</B>) should be linked
|
|
to each certificate.
|
|
<DT id="18"><B>-no-CAfile</B><DD>
|
|
|
|
|
|
Do not load the trusted <FONT SIZE="-1">CA</FONT> certificates from the default file location.
|
|
<DT id="19"><B>-no-CApath</B><DD>
|
|
|
|
|
|
Do not load the trusted <FONT SIZE="-1">CA</FONT> certificates from the default directory location.
|
|
<DT id="20"><B>-md digest</B><DD>
|
|
|
|
|
|
Digest algorithm to use when signing or resigning. If not present then the
|
|
default digest algorithm for the signing key will be used (usually <FONT SIZE="-1">SHA1</FONT>).
|
|
<DT id="21"><B>-</B>cipher<B></B><DD>
|
|
|
|
|
|
The encryption algorithm to use. For example <FONT SIZE="-1">DES</FONT> (56 bits) - <B>-des</B>,
|
|
triple <FONT SIZE="-1">DES</FONT> (168 bits) - <B>-des3</B>,
|
|
<B>EVP_get_cipherbyname()</B> function) can also be used preceded by a dash, for
|
|
example <B>-aes-128-cbc</B>. See <B>enc</B> for list of ciphers
|
|
supported by your version of OpenSSL.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If not specified triple <FONT SIZE="-1">DES</FONT> is used. Only used with <B>-encrypt</B>.
|
|
<DT id="22"><B>-nointern</B><DD>
|
|
|
|
|
|
When verifying a message normally certificates (if any) included in
|
|
the message are searched for the signing certificate. With this option
|
|
only the certificates specified in the <B>-certfile</B> option are used.
|
|
The supplied certificates can still be used as untrusted CAs however.
|
|
<DT id="23"><B>-noverify</B><DD>
|
|
|
|
|
|
Do not verify the signers certificate of a signed message.
|
|
<DT id="24"><B>-nochain</B><DD>
|
|
|
|
|
|
Do not do chain verification of signers certificates: that is don't
|
|
use the certificates in the signed message as untrusted CAs.
|
|
<DT id="25"><B>-nosigs</B><DD>
|
|
|
|
|
|
Don't try to verify the signatures on the message.
|
|
<DT id="26"><B>-nocerts</B><DD>
|
|
|
|
|
|
When signing a message the signer's certificate is normally included
|
|
with this option it is excluded. This will reduce the size of the
|
|
signed message but the verifier must have a copy of the signers certificate
|
|
available locally (passed using the <B>-certfile</B> option for example).
|
|
<DT id="27"><B>-noattr</B><DD>
|
|
|
|
|
|
Normally when a message is signed a set of attributes are included which
|
|
include the signing time and supported symmetric algorithms. With this
|
|
option they are not included.
|
|
<DT id="28"><B>-binary</B><DD>
|
|
|
|
|
|
Normally the input message is converted to ``canonical'' format which is
|
|
effectively using <FONT SIZE="-1">CR</FONT> and <FONT SIZE="-1">LF</FONT> as end of line: as required by the S/MIME
|
|
specification. When this option is present no translation occurs. This
|
|
is useful when handling binary data which may not be in <FONT SIZE="-1">MIME</FONT> format.
|
|
<DT id="29"><B>-crlfeol</B><DD>
|
|
|
|
|
|
Normally the output file uses a single <B></B><FONT SIZE="-1"><B>LF</B></FONT><B></B> as end of line. When this
|
|
option is present <B></B><FONT SIZE="-1"><B>CRLF</B></FONT><B></B> is used instead.
|
|
<DT id="30"><B>-nodetach</B><DD>
|
|
|
|
|
|
When signing a message use opaque signing: this form is more resistant
|
|
to translation by mail relays but it cannot be read by mail agents that
|
|
do not support S/MIME. Without this option cleartext signing with
|
|
the <FONT SIZE="-1">MIME</FONT> type multipart/signed is used.
|
|
<DT id="31"><B>-certfile file</B><DD>
|
|
|
|
|
|
Allows additional certificates to be specified. When signing these will
|
|
be included with the message. When verifying these will be searched for
|
|
the signers certificates. The certificates should be in <FONT SIZE="-1">PEM</FONT> format.
|
|
<DT id="32"><B>-signer file</B><DD>
|
|
|
|
|
|
A signing certificate when signing or resigning a message, this option can be
|
|
used multiple times if more than one signer is required. If a message is being
|
|
verified then the signers certificates will be written to this file if the
|
|
verification was successful.
|
|
<DT id="33"><B>-recip file</B><DD>
|
|
|
|
|
|
The recipients certificate when decrypting a message. This certificate
|
|
must match one of the recipients of the message or an error occurs.
|
|
<DT id="34"><B>-inkey file_or_id</B><DD>
|
|
|
|
|
|
The private key to use when signing or decrypting. This must match the
|
|
corresponding certificate. If this option is not specified then the
|
|
private key must be included in the certificate file specified with
|
|
the <B>-recip</B> or <B>-signer</B> file. When signing this option can be used
|
|
multiple times to specify successive keys.
|
|
If no engine is used, the argument is taken as a file; if an engine is
|
|
specified, the argument is given to the engine as a key identifier.
|
|
<DT id="35"><B>-passin arg</B><DD>
|
|
|
|
|
|
The private key password source. For more information about the format of <B>arg</B>
|
|
see the <B></B><FONT SIZE="-1"><B>PASS PHRASE ARGUMENTS</B></FONT><B></B> section in <B><A HREF="/cgi-bin/man/man2html?1+openssl">openssl</A></B>(1).
|
|
<DT id="36"><B>-rand file...</B><DD>
|
|
|
|
|
|
A file or files containing random data used to seed the random number
|
|
generator.
|
|
Multiple files can be specified separated by an OS-dependent character.
|
|
The separator is <B>;</B> for MS-Windows, <B>,</B> for OpenVMS, and <B>:</B> for
|
|
all others.
|
|
<DT id="37">[<B>-writerand file</B>]<DD>
|
|
|
|
|
|
Writes random data to the specified <I>file</I> upon exit.
|
|
This can be used with a subsequent <B>-rand</B> flag.
|
|
<DT id="38"><B>cert.pem...</B><DD>
|
|
|
|
|
|
One or more certificates of message recipients: used when encrypting
|
|
a message.
|
|
<DT id="39"><B>-to, -from, -subject</B><DD>
|
|
|
|
|
|
The relevant mail headers. These are included outside the signed
|
|
portion of a message so they may be included manually. If signing
|
|
then many S/MIME mail clients check the signers certificate's email
|
|
address matches that specified in the From: address.
|
|
<DT id="40"><B>-attime</B>, <B>-check_ss_sig</B>, <B>-crl_check</B>, <B>-crl_check_all</B>, <B>-explicit_policy</B>, <B>-extended_crl</B>, <B>-ignore_critical</B>, <B>-inhibit_any</B>, <B>-inhibit_map</B>, <B>-no_alt_chains</B>, <B>-partial_chain</B>, <B>-policy</B>, <B>-policy_check</B>, <B>-policy_print</B>, <B>-purpose</B>, <B>-suiteB_128</B>, <B>-suiteB_128_only</B>, <B>-suiteB_192</B>, <B>-trusted_first</B>, <B>-use_deltas</B>, <B>-auth_level</B>, <B>-verify_depth</B>, <B>-verify_email</B>, <B>-verify_hostname</B>, <B>-verify_ip</B>, <B>-verify_name</B>, <B>-x509_strict</B><DD>
|
|
|
|
|
|
Set various options of certificate chain verification. See
|
|
<B><A HREF="/cgi-bin/man/man2html?1+verify">verify</A></B>(1) manual page for details.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
|
|
|
|
The <FONT SIZE="-1">MIME</FONT> message must be sent without any blank lines between the
|
|
headers and the output. Some mail programs will automatically add
|
|
a blank line. Piping the mail directly to sendmail is one way to
|
|
achieve the correct format.
|
|
<P>
|
|
|
|
The supplied message to be signed or encrypted must include the
|
|
necessary <FONT SIZE="-1">MIME</FONT> headers or many S/MIME clients won't display it
|
|
properly (if at all). You can use the <B>-text</B> option to automatically
|
|
add plain text headers.
|
|
<P>
|
|
|
|
A ``signed and encrypted'' message is one where a signed message is
|
|
then encrypted. This can be produced by encrypting an already signed
|
|
message: see the examples section.
|
|
<P>
|
|
|
|
This version of the program only allows one signer per message but it
|
|
will verify multiple signers on received messages. Some S/MIME clients
|
|
choke if a message contains multiple signers. It is possible to sign
|
|
messages ``in parallel'' by signing an already signed message.
|
|
<P>
|
|
|
|
The options <B>-encrypt</B> and <B>-decrypt</B> reflect common usage in S/MIME
|
|
clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7
|
|
encrypted data is used for other purposes.
|
|
<P>
|
|
|
|
The <B>-resign</B> option uses an existing message digest when adding a new
|
|
signer. This means that attributes must be present in at least one existing
|
|
signer using the same message digest or this operation will fail.
|
|
<P>
|
|
|
|
The <B>-stream</B> and <B>-indef</B> options enable streaming I/O support.
|
|
As a result the encoding is <FONT SIZE="-1">BER</FONT> using indefinite length constructed encoding
|
|
and no longer <FONT SIZE="-1">DER.</FONT> Streaming is supported for the <B>-encrypt</B> operation and the
|
|
<B>-sign</B> operation if the content is not detached.
|
|
<P>
|
|
|
|
Streaming is always used for the <B>-sign</B> operation with detached data but
|
|
since the content is no longer part of the PKCS#7 structure the encoding
|
|
remains <FONT SIZE="-1">DER.</FONT>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>EXIT CODES</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="41">0<DD>
|
|
The operation was completely successfully.
|
|
<DT id="42">1<DD>
|
|
|
|
|
|
An error occurred parsing the command options.
|
|
<DT id="43">2<DD>
|
|
|
|
|
|
One of the input files could not be read.
|
|
<DT id="44">3<DD>
|
|
|
|
|
|
An error occurred creating the PKCS#7 file or when reading the <FONT SIZE="-1">MIME</FONT>
|
|
message.
|
|
<DT id="45">4<DD>
|
|
|
|
|
|
An error occurred decrypting or verifying the message.
|
|
<DT id="46">5<DD>
|
|
|
|
|
|
The message was verified correctly but an error occurred writing out
|
|
the signers certificates.
|
|
</DL>
|
|
<A NAME="lbAH"> </A>
|
|
<H2>EXAMPLES</H2>
|
|
|
|
|
|
|
|
Create a cleartext signed message:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in message.txt -text -out mail.msg \
|
|
-signer mycert.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Create an opaque signed message:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in message.txt -text -out mail.msg -nodetach \
|
|
-signer mycert.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Create a signed message, include some additional certificates and
|
|
read the private key from another file:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in in.txt -text -out mail.msg \
|
|
-signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Create a signed message with two signers:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in message.txt -text -out mail.msg \
|
|
-signer mycert.pem -signer othercert.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Send a signed message under Unix directly to sendmail, including headers:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in in.txt -text -signer mycert.pem \
|
|
-from <A HREF="mailto:steve@openssl.org">steve@openssl.org</A> -to <A HREF="mailto:someone@somewhere">someone@somewhere</A> \
|
|
-subject "Signed message" | sendmail <A HREF="mailto:someone@somewhere">someone@somewhere</A>
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Verify a message and extract the signer's certificate if successful:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -verify -in mail.msg -signer user.pem -out signedtext.txt
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Send encrypted mail using triple <FONT SIZE="-1">DES:</FONT>
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -encrypt -in in.txt -from <A HREF="mailto:steve@openssl.org">steve@openssl.org</A> \
|
|
-to <A HREF="mailto:someone@somewhere">someone@somewhere</A> -subject "Encrypted message" \
|
|
-des3 user.pem -out mail.msg
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Sign and encrypt mail:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -sign -in ml.txt -signer my.pem -text \
|
|
| openssl smime -encrypt -out mail.msg \
|
|
-from <A HREF="mailto:steve@openssl.org">steve@openssl.org</A> -to <A HREF="mailto:someone@somewhere">someone@somewhere</A> \
|
|
-subject "Signed and Encrypted message" -des3 user.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Note: the encryption command does not include the <B>-text</B> option because the
|
|
message being encrypted already has <FONT SIZE="-1">MIME</FONT> headers.
|
|
<P>
|
|
|
|
Decrypt mail:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -decrypt -in mail.msg -recip mycert.pem -inkey key.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
The output from Netscape form signing is a PKCS#7 structure with the
|
|
detached signature format. You can use this program to verify the
|
|
signature by line wrapping the base64 encoded structure and surrounding
|
|
it with:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
-----BEGIN PKCS7-----
|
|
-----END PKCS7-----
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
and using the command:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -verify -inform PEM -in signature.pem -content content.txt
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Alternatively you can base64 decode the signature and use:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -verify -inform DER -in signature.der -content content.txt
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Create an encrypted message using 128 bit Camellia:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -encrypt -in plain.txt -camellia128 -out mail.msg cert.pem
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
Add a signer to an existing message:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl smime -resign -in mail.msg -signer newsign.pem -out mail2.msg
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAI"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
|
|
|
|
The <FONT SIZE="-1">MIME</FONT> parser isn't very clever: it seems to handle most messages that I've
|
|
thrown at it but it may choke on others.
|
|
<P>
|
|
|
|
The code currently will only write out the signer's certificate to a file: if
|
|
the signer has a separate encryption certificate this must be manually
|
|
extracted. There should be some heuristic that determines the correct
|
|
encryption certificate.
|
|
<P>
|
|
|
|
Ideally a database should be maintained of a certificates for each email
|
|
address.
|
|
<P>
|
|
|
|
The code doesn't currently take note of the permitted symmetric encryption
|
|
algorithms as supplied in the SMIMECapabilities signed attribute. This means the
|
|
user has to manually include the correct encryption algorithm. It should store
|
|
the list of permitted ciphers in a database and only use those.
|
|
<P>
|
|
|
|
No revocation checking is done on the signer's certificate.
|
|
<P>
|
|
|
|
The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
|
|
structures may cause parsing errors.
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>HISTORY</H2>
|
|
|
|
|
|
|
|
The use of multiple <B>-signer</B> options and the <B>-resign</B> command were first
|
|
added in OpenSSL 1.0.0
|
|
<P>
|
|
|
|
The -no_alt_chains option was added in OpenSSL 1.1.0.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
|
|
<P>
|
|
|
|
Licensed under the OpenSSL license (the ``License''). You may not use
|
|
this file except in compliance with the License. You can obtain a copy
|
|
in the file <FONT SIZE="-1">LICENSE</FONT> in the source distribution or at
|
|
<<A HREF="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</A>>.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="47"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="48"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="49"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="50"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="51"><A HREF="#lbAF">NOTES</A><DD>
|
|
<DT id="52"><A HREF="#lbAG">EXIT CODES</A><DD>
|
|
<DT id="53"><A HREF="#lbAH">EXAMPLES</A><DD>
|
|
<DT id="54"><A HREF="#lbAI">BUGS</A><DD>
|
|
<DT id="55"><A HREF="#lbAJ">HISTORY</A><DD>
|
|
<DT id="56"><A HREF="#lbAK">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:27 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|