34 The B<smime> command handles S/MIME mail. It can encrypt, decrypt, sign and
35 verify S/MIME messages.
37 =head1 COMMAND OPTIONS
39 There are five operation options that set the type of operation to be performed.
40 The meaning of the other options varies according to the operation type.
46 encrypt mail for the given recipient certificates. Input file is the message
47 to be encrypted. The output file is the encrypted mail in MIME format.
51 decrypt mail using the supplied certificate and private key. Expects an
52 encrypted mail message in MIME format for the input file. The decrypted mail
53 is written to the output file.
57 sign mail using the supplied certificate and private key. Input file is
58 the message to be signed. The signed message in MIME format is written
63 verify signed mail. Expects a signed mail message on input and outputs
64 the signed data. Both clear text and opaque signing is supported.
68 takes an input message and writes out a PEM encoded PKCS#7 structure.
72 the input message to be encrypted or signed or the MIME message to
73 be decrypted or verified.
75 =item B<-out filename>
77 the message text that has been decrypted or verified or the output MIME
78 format message that has been signed or verified.
82 this option adds plain text (text/plain) MIME headers to the supplied
83 message if encrypting or signing. If decrypting or verifying it strips
84 off text headers: if the decrypted or verified message is not of MIME
85 type text/plain then an error occurs.
89 a file containing trusted CA certificates, only used with B<-verify>.
93 a directory containing trusted CA certificates, only used with
94 B<-verify>. This directory must be a standard certificate directory: that
95 is a hash of each subject name (using B<x509 -hash>) should be linked
98 =item B<-des3 -rc2-40 -rc2-64 -rc2-128>
100 the encryption algorithm to use. DES (56 bits), triple DES (168 bits)
101 or 40, 64 or 128 bit RC2 respectively if not specified 40 bit RC2 is
102 used. Only used with B<-encrypt>.
106 when verifying a message normally certificates (if any) included in
107 the message are searched for the signing certificate. With this option
108 only the certificates specified in the B<-certfile> option are used.
109 The supplied certificates can still be used as untrusted CAs however.
113 do not verify the signers certificate of a signed message.
117 do not do chain verification of signers certfificates: that is don't
118 use the certificates in the signed message as untrusted CAs.
122 don't try to verify the signatures on the message.
126 when signing a message the signer's certificate is normally included
127 with this option it is excluded. This will reduce the size of the
128 signed message but the verifier must have a copy of the signers certificate
129 available locally (passed using the B<-certfile> option for example).
133 normally when a message is signed a set of attributes are included which
134 include the signing time and supported symmetric algorithms. With this
135 option they are not included.
139 normally the input message is converted to "canonical" format which is
140 effectively using CR and LF as end of line. When this option is present
141 no translation occurs. This is useful when handling binary data which may
142 not be in MIME format.
146 when signing a message use opaque signing: this form is more resistant
147 to translation by mail relays but it cannot be read by mail agents that
148 do not support S/MIME. Without this option cleartext signing with
149 the MIME type multipart/signed is used.
151 =item B<-certfile file>
153 allows additional certificates to be specified. When signing these will
154 be included with the message. When verifying these will be searched for
155 the signers certificates. The certificates should be in PEM format.
157 =item B<-signer file>
159 the signers certificate when signing a message. If a message is
160 being verified then the signers certificates will be written to this
161 file if the verification was successful.
165 the recipients certificate when decrypting a message. This certificate
166 must match one of the recipients of the message or an error occurs.
170 the private key to use when signing or decrypting. This must match the
171 corresponding certificate. If this option is not specified then the
172 private key must be included in the certificate file specified with
173 the B<-recip> or B<-signer> file.
177 one or more certificates of message recipients: used when encrypting
180 =item B<-to, -from, -subject>
182 the relevant mail headers. These are included outside the signed
183 portion of a message so they may be included manually. If signing
184 then many S/MIME mail clients check the signers certificate's email
185 address matches that specified in the From: address.
191 The MIME message must be sent without any blank lines between the
192 headers and the output. Some mail programs will automatically add
193 a blank line. Piping the mail directly to sendmail is one way to
194 achieve the correct format.
196 A "signed and encrypted" message is one where a signed message is
197 then encrypted. This can be produced by encrypting an already signed
200 This version of the program only allows one signer per message but it
201 will verify multiple signers on received messages. Some S/MIME clients
202 choke if a message contains mutiple signers. It is possible to sign
203 messages "in parallel" by signing an already signed message.
211 the operation was completely successful
215 an error occurred parsing the command options.
219 one of the input files could not be read.
223 an error occurred creating the PKCS#7 file or when reading the MIME
228 an error occurred decrypting or verifying the message.
232 the message was verified correctly but an error occured writing out
233 the signers certificates.