summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usr.bin/openssl/openssl.1520
1 files changed, 518 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1
index 2f15b23cbf..e15ef60395 100644
--- a/src/usr.bin/openssl/openssl.1
+++ b/src/usr.bin/openssl/openssl.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: openssl.1,v 1.115 2019/11/19 10:20:10 inoguchi Exp $ 1.\" $OpenBSD: openssl.1,v 1.116 2019/11/28 11:21:33 inoguchi Exp $
2.\" ==================================================================== 2.\" ====================================================================
3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3.\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4.\" 4.\"
@@ -110,7 +110,7 @@
110.\" copied and put under another distribution licence 110.\" copied and put under another distribution licence
111.\" [including the GNU Public Licence.] 111.\" [including the GNU Public Licence.]
112.\" 112.\"
113.Dd $Mdocdate: November 19 2019 $ 113.Dd $Mdocdate: November 28 2019 $
114.Dt OPENSSL 1 114.Dt OPENSSL 1
115.Os 115.Os
116.Sh NAME 116.Sh NAME
@@ -877,6 +877,522 @@ Like
877.Fl V , 877.Fl V ,
878but without cipher suite codes. 878but without cipher suite codes.
879.El 879.El
880.Sh CMS
881.Bl -hang -width "openssl cms"
882.It Nm openssl cms
883.Bk -words
884.Oo
885.Fl aes128 | aes192 | aes256 | camellia128 |
886.Fl camellia192 | camellia256 | des | des3 |
887.Fl rc2-40 | rc2-64 | rc2-128
888.Oc
889.Op Fl CAfile Ar file
890.Op Fl CApath Ar directory
891.Op Fl binary
892.Op Fl certfile Ar file
893.Op Fl certsout Ar file
894.Op Fl cmsout
895.Op Fl compress
896.Op Fl content Ar file
897.Op Fl crlfeol
898.Op Fl data_create
899.Op Fl data_out
900.Op Fl debug_decrypt
901.Op Fl decrypt
902.Op Fl digest_create
903.Op Fl digest_verify
904.Op Fl econtent_type Ar type
905.Op Fl encrypt
906.Op Fl EncryptedData_decrypt
907.Op Fl EncryptedData_encrypt
908.Op Fl from Ar addr
909.Op Fl in Ar file
910.Op Fl inform Cm der | pem | smime
911.Op Fl inkey Ar file
912.Op Fl keyform Cm der | pem
913.Op Fl keyid
914.Op Fl keyopt Ar nm:v
915.Op Fl md Ar digest
916.Op Fl no_attr_verify
917.Op Fl no_content_verify
918.Op Fl no_signer_cert_verify
919.Op Fl noattr
920.Op Fl nocerts
921.Op Fl nodetach
922.Op Fl nointern
923.Op Fl nooldmime
924.Op Fl noout
925.Op Fl nosigs
926.Op Fl nosmimecap
927.Op Fl noverify
928.Op Fl out Ar file
929.Op Fl outform Cm der | pem | smime
930.Op Fl passin Ar src
931.Op Fl print
932.Op Fl pwri_password Ar arg
933.Op Fl rctform Cm der | pem | smime
934.Op Fl receipt_request_all | receipt_request_first
935.Op Fl receipt_request_from Ar addr
936.Op Fl receipt_request_print
937.Op Fl receipt_request_to Ar addr
938.Op Fl recip Ar file
939.Op Fl resign
940.Op Fl secretkey Ar key
941.Op Fl secretkeyid Ar id
942.Op Fl sign
943.Op Fl sign_receipt
944.Op Fl signer Ar file
945.Op Fl stream | indef | noindef
946.Op Fl subject Ar s
947.Op Fl text
948.Op Fl to Ar addr
949.Op Fl uncompress
950.Op Fl verify
951.Op Fl verify_receipt Ar file
952.Op Fl verify_retcode
953.Op Ar cert.pem ...
954.Ek
955.El
956.Pp
957The
958.Nm cms
959command handles S/MIME v3.1 mail.
960It can encrypt, decrypt, sign and verify, compress and uncompress S/MIME
961messages.
962.Pp
963The MIME message must be sent without any blank lines between the headers and
964the output.
965Some mail programs will automatically add a blank line.
966Piping the mail directly to sendmail is one way to achieve the correct format.
967.Pp
968The supplied message to be signed or encrypted must include the necessary MIME
969headers or many S/MIME clients won't display it properly (if at all).
970You can use the
971.Fl text
972option to automatically add plain text headers.
973.Pp
974A "signed and encrypted" message is one where a signed message is then
975encrypted.
976This can be produced by encrypting an already signed message.
977.Pp
978There are various operation options that set the type of operation to be
979performed.
980The meaning of the other options varies according to the operation type.
981.Bl -tag -width "XXXX"
982.It Fl encrypt
983Encrypt mail for the given recipient certificates.
984Input file is the message to be encrypted.
985The output file is the encrypted mail in MIME format.
986The actual CMS type is EnvelopedData.
987Note that no revocation check is done for the recipient cert, so if that
988key has been compromised, others may be able to decrypt the text.
989.It Fl decrypt
990Decrypt mail using the supplied certificate and private key.
991Expects an encrypted mail message in MIME format for the input file.
992The decrypted mail is written to the output file.
993.It Fl sign
994Sign mail using the supplied certificate and private key.
995Input file is the message to be signed.
996The signed message in MIME format is written to the output file.
997.It Fl verify
998Verify signed mail.
999Expects a signed mail message on input and outputs the signed data.
1000Both clear text and opaque signing are supported.
1001.It Fl cmsout
1002Take an input message and write out a PEM encoded CMS structure.
1003.It Fl resign
1004Resign a message.
1005Take an existing message and one or more new signers.
1006This operation uses an existing message digest when adding a new signer.
1007This means that attributes must be present in at least one existing
1008signer using the same message digest or this operation will fail.
1009.It Fl data_create
1010Create a CMS Data type.
1011.It Fl data_out
1012Output a content from the input CMS Data type.
1013.It Fl digest_create
1014Create a CMS DigestedData type.
1015.It Fl digest_verify
1016Verify a CMS DigestedData type and output the content.
1017.It Fl compress
1018Create a CMS CompressedData type.
1019Must be compiled with zlib support for this option to work.
1020.It Fl uncompress
1021Uncompress a CMS CompressedData type and output the content.
1022Must be compiled with zlib support for this option to work.
1023.It Fl EncryptedData_encrypt
1024Encrypt a content using supplied symmetric key and algorithm using a
1025CMS EncryptedData type.
1026.It Fl EncryptedData_decrypt
1027Decrypt a CMS EncryptedData type using supplied symmetric key.
1028.It Fl sign_receipt
1029Generate and output a signed receipt for the supplied message.
1030The input message must contain a signed receipt request.
1031Functionality is otherwise similar to the
1032.Fl sign
1033operation.
1034.It Xo
1035.Fl verify_receipt Ar file
1036.Xc
1037Verify a signed receipt in file.
1038The input message must contain the original receipt request.
1039Functionality is otherwise similar to the
1040.Fl verify
1041operation.
1042.El
1043.Pp
1044The remaining options are as follows:
1045.Bl -tag -width "XXXX"
1046.It Xo
1047.Fl aes128 | aes192 | aes256 | camellia128 |
1048.Fl camellia192 | camellia256 | des | des3 |
1049.Fl rc2-40 | rc2-64 | rc2-128
1050.Xc
1051The encryption algorithm to use.
1052128-, 192-, or 256-bit AES, 128-, 192-, or 256-bit CAMELLIA,
1053DES (56 bits), triple DES (168 bits),
1054or 40-, 64-, or 128-bit RC2, respectively;
1055if not specified, triple DES is
1056used.
1057Only used with
1058.Fl encrypt
1059and
1060.Fl EncryptedData_encrypt
1061commands.
1062.It Fl binary
1063Normally the input message is converted to "canonical" format which is
1064effectively using CR/LF as end of line, as required by the S/MIME specification.
1065When this option is present no translation occurs.
1066This is useful when handling binary data which may not be in MIME format.
1067.It Fl CAfile Ar file
1068A file containing trusted CA certificates, used with
1069.Fl verify
1070and
1071.Fl verify_receipt .
1072.It Fl CApath Ar directory
1073A directory containing trusted CA certificates, used with
1074.Fl verify
1075and
1076.Fl verify_receipt .
1077This directory must be a standard certificate directory: that is a hash
1078of each subject name (using
1079.Nm x509 Fl hash )
1080should be linked to each certificate.
1081.It Ar cert.pem...
1082One or more certificates of message recipients: used when encrypting a message.
1083.It Fl certfile Ar file
1084Allows additional certificates to be specified.
1085When signing these will be included with the message.
1086When verifying these will be searched for the signer's certificates.
1087The certificates should be in PEM format.
1088.It Fl certsout Ar file
1089A file that any certificates contained in the message are written to.
1090.It Xo
1091.Fl check_ss_sig ,
1092.Fl crl_check ,
1093.Fl crl_check_all ,
1094.Fl extended_crl ,
1095.Fl ignore_critical ,
1096.Fl issuer_checks ,
1097.Fl policy ,
1098.Fl policy_check ,
1099.Fl purpose ,
1100.Fl x509_strict
1101.Xc
1102Set various certificate chain validation options.
1103See the
1104.Nm verify
1105command for details.
1106.It Fl content Ar file
1107A file containing the detached content.
1108This is only useful with the
1109.Fl verify
1110command.
1111This is only usable if the CMS structure is using the detached signature
1112form where the content is not included.
1113This option will override any content if the input format is S/MIME and
1114it uses the multipart/signed MIME content type.
1115.It Fl crlfeol
1116Output a S/MIME message with CR/LF end of line.
1117.It Fl debug_decrypt
1118Set the CMS_DEBUG_DECRYPT flag when decrypting.
1119This option should be used with caution, since this can be used to disable
1120the MMA attack protection and return an error if no recipient can be found.
1121See the
1122.Xr CMS_decrypt 3
1123manual page for details of the flag.
1124.It Xo
1125.Fl from Ar addr ,
1126.Fl subject Ar s ,
1127.Fl to Ar addr
1128.Xc
1129The relevant mail headers.
1130These are included outside the signed portion of a message so they may
1131be included manually.
1132If signing then many S/MIME mail clients check the signer's certificate's
1133email address matches that specified in the From: address.
1134.It Fl econtent_type Ar type
1135Set the encapsulated content type, used with
1136.Fl sign .
1137If not supplied the Data type is used.
1138The type argument can be any valid OID name in either text or numerical format.
1139.It Fl in Ar file
1140The input message to be encrypted or signed or the message to be decrypted or
1141verified.
1142.It Fl inform Cm der | pem | smime
1143The input format for the CMS structure.
1144The default is
1145.Cm smime ,
1146which reads an S/MIME format message.
1147.Cm pem
1148and
1149.Cm der
1150format change this to expect PEM and DER format CMS structures instead.
1151This currently only affects the input format of the CMS structure; if no
1152CMS structure is being input (for example with
1153.Fl encrypt
1154or
1155.Fl sign )
1156this option has no effect.
1157.It Fl inkey Ar file
1158The private key to use when signing or decrypting.
1159This must match the corresponding certificate.
1160If this option is not specified then the private key must be included in
1161the certificate file specified with the
1162.Fl recip
1163or
1164.Fl signer
1165file.
1166When signing this option can be used multiple times to specify successive keys.
1167.It Fl keyform Cm der | pem
1168Input private key format.
1169The default is
1170.Cm pem .
1171.It Fl keyid
1172Use subject key identifier to identify certificates instead of issuer
1173name and serial number.
1174The supplied certificate must include a subject key identifier extension.
1175Supported by
1176.Fl sign
1177and
1178.Fl encrypt
1179operations.
1180.It Fl keyopt Ar nm:v
1181Set customised parameters for the preceding key or certificate
1182for encryption and signing.
1183It can currently be used to set RSA-PSS for signing, RSA-OAEP for
1184encryption or to modify default parameters for ECDH.
1185This option can be used multiple times.
1186.It Fl md Ar digest
1187The digest algorithm to use when signing or resigning.
1188If not present then the default digest algorithm for the signing key
1189will be used (usually SHA1).
1190.It Fl no_attr_verify
1191Do not verify the signer's attribute of a signature.
1192.It Fl no_content_verify
1193Do not verify the content of a signed message.
1194.It Fl no_signer_cert_verify
1195Do not verify the signer's certificate of a signed message.
1196.It Fl noattr
1197Do not include attributes.
1198Normally when a message is signed a set of attributes are included which
1199include the signing time and supported symmetric algorithms.
1200With this option they are not included.
1201.It Fl nocerts
1202Do not include the signer's certificate.
1203This will reduce the size of the signed message but the verifier must
1204have a copy of the signer's certificate available locally (passed using
1205the
1206.Fl certfile
1207option for example).
1208.It Fl nodetach
1209When signing a message use opaque signing.
1210This form is more resistant to translation by mail relays but it cannot be
1211read by mail agents that do not support S/MIME.
1212Without this option cleartext signing with the MIME type multipart/signed is
1213used.
1214.It Fl nointern
1215Only the certificates specified in the
1216.Fl certfile
1217option are used.
1218When verifying a message normally certificates (if any) included in the
1219message are searched for the signing certificate.
1220The supplied certificates can still be used as untrusted CAs however.
1221.It Fl nooldmime
1222Output an old S/MIME content type like "application/x-pkcs7-".
1223.It Fl noout
1224Do not output the parsed CMS structure for the
1225.Fl cmsout
1226operation.
1227This is useful when combined with the
1228.Fl print
1229option or if the syntax of the CMS structure is being checked.
1230.It Fl nosigs
1231Do not try to verify the signatures on the message.
1232.It Fl nosmimecap
1233Exclude the list of supported algorithms from signed attributes; other
1234options such as signing time and content type are still included.
1235.It Fl noverify
1236Do not verify the signer's certificate of a signed message.
1237.It Fl out Ar file
1238The message text that has been decrypted or verified or the output MIME
1239format message that has been signed or verified.
1240.It Fl outform Cm der | pem | smime
1241This specifies the output format for the CMS structure.
1242The default is
1243.Cm smime ,
1244which writes an S/MIME format message.
1245.Cm pem
1246and
1247.Cm der
1248format change this to write PEM and DER format CMS structures instead.
1249This currently only affects the output format of the CMS structure; if
1250no CMS structure is being output (for example with
1251.Fl verify
1252or
1253.Fl decrypt )
1254this option has no effect.
1255.It Fl passin Ar src
1256The private key password source.
1257.It Fl print
1258Print out all fields of the CMS structure for the
1259.Fl cmsout
1260operation.
1261This is mainly useful for testing purposes.
1262.It Fl pwri_password Ar arg
1263Specify PasswordRecipientInfo (PWRI) password to use.
1264Supported by the
1265.Fl encrypt
1266and
1267.Fl decrypt
1268operations.
1269.It Fl rctform Cm der | pem | smime
1270Specify the format for a signed receipt for use with the
1271.Fl receipt_verify
1272operation.
1273The default is
1274.Cm smime .
1275.It Fl receipt_request_all | receipt_request_first
1276Indicate requests should be provided by all recipient or first tier
1277recipients (those mailed directly and not from a mailing list), for the
1278.Fl sign
1279operation to include a signed receipt request.
1280Ignored if
1281.Fl receipt_request_from
1282is included.
1283.It Fl receipt_request_from Ar addr
1284Add an explicit email address where receipts should be supplied.
1285.It Fl receipt_request_print
1286Print out the contents of any signed receipt requests for the
1287.Fl verify
1288operation.
1289.It Fl receipt_request_to Ar addr
1290Add an explicit email address where signed receipts should be sent to.
1291This option must be supplied if a signed receipt is requested.
1292.It Fl recip Ar file
1293When decrypting a message this specifies the recipient's certificate.
1294The certificate must match one of the recipients of the message or an
1295error occurs.
1296When encrypting a message this option may be used multiple times to
1297specify each recipient.
1298This form must be used if customised parameters are required (for example to
1299specify RSA-OAEP).
1300Only certificates carrying RSA, Diffie-Hellman or EC keys are supported
1301by this option.
1302.It Fl secretkey Ar key
1303Specify symmetric key to use.
1304The key must be supplied in hex format and be consistent with the
1305algorithm used.
1306Supported by the
1307.Fl EncryptedData_encrypt ,
1308.Fl EncryptedData_decrypt ,
1309.Fl encrypt
1310and
1311.Fl decrypt
1312operations.
1313When used with
1314.Fl encrypt
1315or
1316.Fl decrypt
1317the supplied key is used to wrap or unwrap the content encryption key
1318using an AES key in the KEKRecipientInfo type.
1319.It Fl secretkeyid Ar id
1320The key identifier for the supplied symmetric key for KEKRecipientInfo type.
1321This option must be present if the
1322.Fl secretkey
1323option is used with
1324.Fl encrypt .
1325With
1326.Fl decrypt
1327operations the id is used to locate the relevant key; if it is not supplied
1328then an attempt is used to decrypt any KEKRecipientInfo structures.
1329.It Fl signer Ar file
1330A signing certificate when signing or resigning a message; this option
1331can be used multiple times if more than one signer is required.
1332If a message is being verified then the signers certificates will be
1333written to this file if the verification was successful.
1334.It Xo
1335.Fl stream |
1336.Fl indef |
1337.Fl noindef
1338.Xc
1339The
1340.Fl stream
1341and
1342.Fl indef
1343options are equivalent and enable streaming I/O for encoding operations.
1344This permits single pass processing of data without the need to hold the
1345entire contents in memory, potentially supporting very large files.
1346Streaming is automatically set for S/MIME signing with detached data if
1347the output format is
1348.Cm smime ;
1349it is currently off by default for all other operations.
1350.Fl noindef
1351disable streaming I/O where it would produce an indefinite length
1352constructed encoding.
1353This option currently has no effect.
1354.It Fl text
1355Add plain text (text/plain) MIME headers to the supplied message if
1356encrypting or signing.
1357If decrypting or verifying it strips off text headers: if the decrypted
1358or verified message is not of MIME type text/plain then an error occurs.
1359.It Fl verify_retcode
1360Set verification error code to exit code to indicate what verification error
1361has occurred.
1362Supported by
1363.Fl verify
1364operation only.
1365Exit code value minus 32 shows verification error code.
1366See
1367.Nm verify
1368command for the list of verification error code.
1369.El
1370.Pp
1371The exit codes for
1372.Nm cms
1373are as follows:
1374.Pp
1375.Bl -tag -width "XXXX" -offset 3n -compact
1376.It 0
1377The operation was completely successful.
1378.It 1
1379An error occurred parsing the command options.
1380.It 2
1381One of the input files could not be read.
1382.It 3
1383An error occurred creating the CMS file or when reading the MIME message.
1384.It 4
1385An error occurred decrypting or verifying the message.
1386.It 5
1387The message was verified correctly but an error occurred writing out the
1388signer's certificates.
1389.It 6
1390An error occurred writing the output file.
1391.It 32+
1392A verify error occurred while
1393.Fl verify_retcode
1394is specified.
1395.El
880.Sh CRL 1396.Sh CRL
881.Bl -hang -width "openssl crl" 1397.Bl -hang -width "openssl crl"
882.It Nm openssl crl 1398.It Nm openssl crl