Network Working Group                                B. Ramsdell, Editor
Request for Comments: 3851                                Sendmail, Inc.
Obsoletes: 2633                                                July 2004
Category: Standards Track
        
Network Working Group                                B. Ramsdell, Editor
Request for Comments: 3851                                Sendmail, Inc.
Obsoletes: 2633                                                July 2004
Category: Standards Track
        

Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.1 Message Specification

安全/多用途Internet邮件扩展(S/MIME)3.1版邮件规范

Status of this Memo

本备忘录的状况

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2004).

版权所有(C)互联网协会(2004年)。

Abstract

摘要

This document defines Secure/Multipurpose Internet Mail Extensions (S/MIME) version 3.1. S/MIME provides a consistent way to send and receive secure MIME data. Digital signatures provide authentication, message integrity, and non-repudiation with proof of origin. Encryption provides data confidentiality. Compression can be used to reduce data size. This document obsoletes RFC 2633.

本文档定义了安全/多用途Internet邮件扩展(S/MIME)版本3.1。S/MIME提供了发送和接收安全MIME数据的一致方式。数字签名提供身份验证、消息完整性和不可否认性以及来源证明。加密提供了数据保密性。压缩可用于减少数据大小。本文件淘汰RFC 2633。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
       1.1.  Specification Overview . . . . . . . . . . . . . . . . .  3
       1.2.  Terminology. . . . . . . . . . . . . . . . . . . . . . .  3
       1.3.  Definitions. . . . . . . . . . . . . . . . . . . . . . .  4
       1.4.  Compatibility with Prior Practice of S/MIME. . . . . . .  5
       1.5.  Changes Since S/MIME v3. . . . . . . . . . . . . . . . .  5
   2.  CMS Options. . . . . . . . . . . . . . . . . . . . . . . . . .  5
       2.1.  DigestAlgorithmIdentifier. . . . . . . . . . . . . . . .  5
       2.2.  SignatureAlgorithmIdentifier . . . . . . . . . . . . . .  6
       2.3.  KeyEncryptionAlgorithmIdentifier . . . . . . . . . . . .  6
       2.4.  General Syntax . . . . . . . . . . . . . . . . . . . . .  6
       2.5.  Attributes and the SignerInfo Type . . . . . . . . . . .  7
       2.6.  SignerIdentifier SignerInfo Type . . . . . . . . . . . . 11
       2.7.  ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 12
   3.  Creating S/MIME Messages . . . . . . . . . . . . . . . . . . . 14
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
       1.1.  Specification Overview . . . . . . . . . . . . . . . . .  3
       1.2.  Terminology. . . . . . . . . . . . . . . . . . . . . . .  3
       1.3.  Definitions. . . . . . . . . . . . . . . . . . . . . . .  4
       1.4.  Compatibility with Prior Practice of S/MIME. . . . . . .  5
       1.5.  Changes Since S/MIME v3. . . . . . . . . . . . . . . . .  5
   2.  CMS Options. . . . . . . . . . . . . . . . . . . . . . . . . .  5
       2.1.  DigestAlgorithmIdentifier. . . . . . . . . . . . . . . .  5
       2.2.  SignatureAlgorithmIdentifier . . . . . . . . . . . . . .  6
       2.3.  KeyEncryptionAlgorithmIdentifier . . . . . . . . . . . .  6
       2.4.  General Syntax . . . . . . . . . . . . . . . . . . . . .  6
       2.5.  Attributes and the SignerInfo Type . . . . . . . . . . .  7
       2.6.  SignerIdentifier SignerInfo Type . . . . . . . . . . . . 11
       2.7.  ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 12
   3.  Creating S/MIME Messages . . . . . . . . . . . . . . . . . . . 14
        
       3.1.  Preparing the MIME Entity for Signing, Enveloping
             or Compressing . . . . . . . . . . . . . . . . . . . . . 14
       3.2.  The application/pkcs7-mime Type. . . . . . . . . . . . . 19
       3.3.  Creating an Enveloped-only Message . . . . . . . . . . . 21
       3.4.  Creating a Signed-only Message . . . . . . . . . . . . . 22
       3.5.  Creating an Compressed-only Message. . . . . . . . . . . 26
       3.6.  Multiple Operations. . . . . . . . . . . . . . . . . . . 27
       3.7.  Creating a Certificate Management Messagetoc . . . . . . 27
       3.8.  Registration Requests. . . . . . . . . . . . . . . . . . 28
       3.9.  Identifying an S/MIME Message. . . . . . . . . . . . . . 28
   4.  Certificate Processing . . . . . . . . . . . . . . . . . . . . 29
       4.1.  Key Pair Generation. . . . . . . . . . . . . . . . . . . 29
   5.  Security Considerations. . . . . . . . . . . . . . . . . . . . 29
   A.  ASN.1 Module . . . . . . . . . . . . . . . . . . . . . . . . . 31
   B.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 32
       B.1.  Normative References . . . . . . . . . . . . . . . . . . 32
       B.2.  Informative References . . . . . . . . . . . . . . . . . 34
   C.  Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35
   D.  Editor's Address . . . . . . . . . . . . . . . . . . . . . . . 35
       Full Copyright Statement . . . . . . . . . . . . . . . . . . . 36
        
       3.1.  Preparing the MIME Entity for Signing, Enveloping
             or Compressing . . . . . . . . . . . . . . . . . . . . . 14
       3.2.  The application/pkcs7-mime Type. . . . . . . . . . . . . 19
       3.3.  Creating an Enveloped-only Message . . . . . . . . . . . 21
       3.4.  Creating a Signed-only Message . . . . . . . . . . . . . 22
       3.5.  Creating an Compressed-only Message. . . . . . . . . . . 26
       3.6.  Multiple Operations. . . . . . . . . . . . . . . . . . . 27
       3.7.  Creating a Certificate Management Messagetoc . . . . . . 27
       3.8.  Registration Requests. . . . . . . . . . . . . . . . . . 28
       3.9.  Identifying an S/MIME Message. . . . . . . . . . . . . . 28
   4.  Certificate Processing . . . . . . . . . . . . . . . . . . . . 29
       4.1.  Key Pair Generation. . . . . . . . . . . . . . . . . . . 29
   5.  Security Considerations. . . . . . . . . . . . . . . . . . . . 29
   A.  ASN.1 Module . . . . . . . . . . . . . . . . . . . . . . . . . 31
   B.  References . . . . . . . . . . . . . . . . . . . . . . . . . . 32
       B.1.  Normative References . . . . . . . . . . . . . . . . . . 32
       B.2.  Informative References . . . . . . . . . . . . . . . . . 34
   C.  Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 35
   D.  Editor's Address . . . . . . . . . . . . . . . . . . . . . . . 35
       Full Copyright Statement . . . . . . . . . . . . . . . . . . . 36
        
1. Introduction
1. 介绍

S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a consistent way to send and receive secure MIME data. Based on the popular Internet MIME standard, S/MIME provides the following cryptographic security services for electronic messaging applications: authentication, message integrity and non-repudiation of origin (using digital signatures), and data confidentiality (using encryption).

S/MIME(安全/多用途Internet邮件扩展)提供了发送和接收安全MIME数据的一致方式。基于流行的Internet MIME标准,S/MIME为电子消息应用程序提供以下加密安全服务:身份验证、消息完整性和来源不可否认性(使用数字签名)以及数据机密性(使用加密)。

S/MIME can be used by traditional mail user agents (MUAs) to add cryptographic security services to mail that is sent, and to interpret cryptographic security services in mail that is received. However, S/MIME is not restricted to mail; it can be used with any transport mechanism that transports MIME data, such as HTTP. As such, S/MIME takes advantage of the object-based features of MIME and allows secure messages to be exchanged in mixed-transport systems.

传统的邮件用户代理(MUA)可以使用S/MIME向发送的邮件添加加密安全服务,并解释接收的邮件中的加密安全服务。但是,S/MIME不限于邮件;它可以用于传输MIME数据的任何传输机制,如HTTP。因此,S/MIME利用了MIME基于对象的特性,并允许在混合传输系统中交换安全消息。

Further, S/MIME can be used in automated message transfer agents that use cryptographic security services that do not require any human intervention, such as the signing of software-generated documents and the encryption of FAX messages sent over the Internet.

此外,S/MIME可用于自动消息传输代理,该代理使用不需要任何人工干预的加密安全服务,例如软件生成文档的签名和通过Internet发送的传真消息的加密。

1.1. Specification Overview
1.1. 规范概述

This document describes a protocol for adding cryptographic signature and encryption services to MIME data. The MIME standard [MIME-SPEC] provides a general structure for the content type of Internet messages and allows extensions for new content type applications.

本文档描述了向MIME数据添加加密签名和加密服务的协议。MIME标准[MIME-SPEC]为Internet消息的内容类型提供了通用结构,并允许扩展新的内容类型应用程序。

This specification defines how to create a MIME body part that has been cryptographically enhanced according to CMS [CMS], which is derived from PKCS #7 [PKCS-7]. This specification also defines the application/pkcs7-mime MIME type that can be used to transport those body parts.

本规范定义了如何创建根据CMS[CMS]加密增强的MIME主体部分,CMS[CMS]源自PKCS#7[PKCS-7]。本规范还定义了可用于传输这些身体部位的application/pkcs7 mime mime类型。

This document also discusses how to use the multipart/signed MIME type defined in [MIME-SECURE] to transport S/MIME signed messages. multipart/signed is used in conjunction with the application/pkcs7- signature MIME type, which is used to transport a detached S/MIME signature.

本文档还讨论了如何使用[MIME-SECURE]中定义的多部分/签名MIME类型来传输S/MIME签名消息。multipart/signed与application/pkcs7-signature MIME类型一起使用,后者用于传输分离的S/MIME签名。

In order to create S/MIME messages, an S/MIME agent MUST follow the specifications in this document, as well as the specifications listed in the Cryptographic Message Syntax document [CMS] [CMSALG].

为了创建S/MIME消息,S/MIME代理必须遵循本文档中的规范以及加密消息语法文档[CMS][CMSALG]中列出的规范。

Throughout this specification, there are requirements and recommendations made for how receiving agents handle incoming messages. There are separate requirements and recommendations for how sending agents create outgoing messages. In general, the best strategy is to "be liberal in what you receive and conservative in what you send". Most of the requirements are placed on the handling of incoming messages while the recommendations are mostly on the creation of outgoing messages.

在本规范中,有关于接收代理如何处理传入消息的要求和建议。对于发送代理如何创建传出消息,有单独的要求和建议。总的来说,最好的策略是“在你收到的东西上自由,在你发送的东西上保守”。大多数需求放在传入消息的处理上,而建议主要放在传出消息的创建上。

The separation for requirements on receiving agents and sending agents also derives from the likelihood that there will be S/MIME systems that involve software other than traditional Internet mail clients. S/MIME can be used with any system that transports MIME data. An automated process that sends an encrypted message might not be able to receive an encrypted message at all, for example. Thus, the requirements and recommendations for the two types of agents are listed separately when appropriate.

对接收代理和发送代理的要求的分离还源于可能存在S/MIME系统,这些系统涉及传统Internet邮件客户端以外的软件。S/MIME可用于传输MIME数据的任何系统。例如,发送加密消息的自动化进程可能根本无法接收加密消息。因此,在适当的情况下,将分别列出这两类代理的要求和建议。

1.2. Terminology
1.2. 术语

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [MUSTSHOULD].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[必须”中的说明进行解释。

1.3. Definitions
1.3. 定义

For the purposes of this specification, the following definitions apply.

在本规范中,以下定义适用。

ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208 [X.208-88].

ASN.1:抽象语法符号1,如CCITT X.208[X.208-88]中所定义。

BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209 [X.209-88].

BER:ASN.1的基本编码规则,如CCITT X.209[X.209-88]中所定义。

Certificate: A type that binds an entity's name to a public key with a digital signature.

证书:用数字签名将实体名称绑定到公钥的类型。

DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT X.509 [X.509-88].

DER:CCITT X.509[X.509-88]中定义的ASN.1的特殊编码规则。

7-bit data: Text data with lines less than 998 characters long, where none of the characters have the 8th bit set, and there are no NULL characters. <CR> and <LF> occur only as part of a <CR><LF> end of line delimiter.

7位数据:行长度小于998个字符的文本数据,其中没有字符设置为第8位,也没有空字符<CR>和<LF>仅作为<CR><LF>行尾分隔符的一部分出现。

8-bit data: Text data with lines less than 998 characters, and where none of the characters are NULL characters. <CR> and <LF> occur only as part of a <CR><LF> end of line delimiter.

8位数据:行数小于998个字符的文本数据,其中所有字符都不是空字符<CR>和<LF>仅作为<CR><LF>行尾分隔符的一部分出现。

Binary data: Arbitrary data.

二进制数据:任意数据。

Transfer Encoding: A reversible transformation made on data so 8-bit or binary data can be sent via a channel that only transmits 7-bit data.

传输编码:对数据进行可逆转换,以便8位或二进制数据可以通过仅传输7位数据的通道发送。

Receiving agent: Software that interprets and processes S/MIME CMS objects, MIME body parts that contain CMS content types, or both.

接收代理:解释和处理S/MIME CMS对象、包含CMS内容类型的MIME正文部分或两者的软件。

Sending agent: Software that creates S/MIME CMS content types, MIME body parts that contain CMS content types, or both.

发送代理:创建S/MIME CMS内容类型、包含CMS内容类型的MIME正文部分或两者的软件。

S/MIME agent: User software that is a receiving agent, a sending agent, or both.

S/MIME代理:作为接收代理、发送代理或两者兼有的用户软件。

1.4. Compatibility with Prior Practice of S/MIME
1.4. 与先前S/MIME实践的兼容性

S/MIME version 3.1 agents SHOULD attempt to have the greatest interoperability possible with agents for prior versions of S/MIME. S/MIME version 2 is described in RFC 2311 through RFC 2315, inclusive and S/MIME version 3 is described in RFC 2630 through RFC 2634 inclusive. RFC 2311 also has historical information about the development of S/MIME.

S/MIME版本3.1代理应尽可能与S/MIME早期版本的代理具有最大的互操作性。S/MIME版本2在RFC 2311至RFC 2315(含)中描述,S/MIME版本3在RFC 2630至RFC 2634(含)中描述。RFC2311也有关于S/MIME发展的历史信息。

1.5. Changes Since S/MIME v3
1.5. 自S/MIME v3以来的更改

The RSA public key algorithm was changed to a MUST implement key wrapping algorithm, and the Diffie-Hellman algorithm changed to a SHOULD implement.

RSA公钥算法更改为必须实现的密钥包装算法,Diffie-Hellman算法更改为应该实现的密钥包装算法。

The AES symmetric encryption algorithm has been included as a SHOULD implement.

AES对称加密算法已作为一个应实现的工具包括在内。

The RSA public key algorithm was changed to a MUST implement signature algorithm.

RSA公钥算法已更改为必须实现的签名算法。

Ambiguous language about the use of "empty" SignedData messages to transmit certificates was clarified to reflect that transmission of certificate revocation lists is also allowed.

澄清了关于使用“空”签名数据消息传输证书的含糊不清的语言,以反映也允许传输证书撤销列表。

The use of binary encoding for some MIME entities is now explicitly discussed.

现在明确讨论了对某些MIME实体使用二进制编码。

Header protection through the use of the message/rfc822 MIME type has been added.

添加了通过使用message/rfc822 MIME类型的头保护。

Use of the CompressedData CMS type is allowed, along with required MIME type and file extension additions.

允许使用CompressedData CMS类型,以及所需的MIME类型和文件扩展名添加。

2. CMS Options
2. CMS选项

CMS allows for a wide variety of options in content and algorithm support. This section puts forth a number of support requirements and recommendations in order to achieve a base level of interoperability among all S/MIME implementations. [CMSALG] provides additional details regarding the use of the cryptographic algorithms.

CMS允许在内容和算法支持方面有多种选择。本节提出了一些支持需求和建议,以实现所有S/MIME实现之间的基本互操作性。[CMSALG]提供了有关加密算法使用的其他详细信息。

2.1. DigestAlgorithmIdentifier
2.1. 算法识别器

Sending and receiving agents MUST support SHA-1 [CMSALG]. Receiving agents SHOULD support MD5 [CMSALG] for the purpose of providing backward compatibility with MD5-digested S/MIME v2 SignedData objects.

发送和接收代理必须支持SHA-1[CMSALG]。接收代理应支持MD5[CMSALG],以便提供与MD5摘要S/MIME v2 SignedData对象的向后兼容性。

2.2. SignatureAlgorithmIdentifier
2.2. 签名算法标识符

Receiving agents MUST support id-dsa-with-sha1 defined in [CMSALG]. The algorithm parameters MUST be absent (not encoded as NULL). Receiving agents MUST support rsaEncryption, defined in [CMSALG].

接收代理必须支持[CMSALG]中定义的id-dsa-with-sha1。算法参数必须不存在(不编码为NULL)。接收代理必须支持[CMSALG]中定义的RSA加密。

Sending agents MUST support either id-dsa-with-sha1 or rsaEncryption.

发送代理必须支持id-dsa-with-sha1或RSA加密。

If using rsaEncryption, sending and receiving agents MUST support the digest algorithms in section 2.1 as specified.

如果使用RSA加密,发送和接收代理必须按照规定支持第2.1节中的摘要算法。

Note that S/MIME v3 clients might only implement signing or signature verification using id-dsa-with-sha1, and might also use id-dsa as an AlgorithmIdentifier in this field. Receiving clients SHOULD recognize id-dsa as equivalent to id-dsa-with-sha1, and sending clients MUST use id-dsa-with-sha1 if using that algorithm. Also note that S/MIME v2 clients are only required to verify digital signatures using the rsaEncryption algorithm with SHA-1 or MD5, and might not implement id-dsa-with-sha1 or id-dsa at all.

请注意,S/MIME v3客户端可能仅使用id-dsa-with-sha1实现签名或签名验证,还可能使用id-dsa作为此字段中的算法标识符。接收客户端应将id dsa识别为等同于id-dsa-with-sha1,如果使用该算法,则发送客户端必须使用id-dsa-with-sha1。还要注意的是,S/MIME v2客户端只需要使用带有SHA-1或MD5的RSA加密算法来验证数字签名,可能根本无法实现id-dsa-with-sha1或id-dsa。

2.3. KeyEncryptionAlgorithmIdentifier
2.3. 密钥加密算法标识符

Sending and receiving agents MUST support rsaEncryption, defined in [CMSALG].

发送和接收代理必须支持[CMSALG]中定义的RSA加密。

Sending and receiving agents SHOULD support Diffie-Hellman defined in [CMSALG], using the ephemeral-static mode.

发送和接收代理应支持[CMSALG]中定义的Diffie Hellman,使用短暂静态模式。

Note that S/MIME v3 clients might only implement key encryption and decryption using the Diffie-Hellman algorithm. Also note that S/MIME v2 clients are only capable of decrypting content-encryption keys using the rsaEncryption algorithm.

请注意,S/MIME v3客户端可能仅使用Diffie-Hellman算法实现密钥加密和解密。还请注意,S/MIME v2客户端只能使用RSA加密算法解密内容加密密钥。

2.4. General Syntax
2.4. 一般语法

There are several CMS content types. Of these, only the Data, SignedData, EnvelopedData, and CompressedData content types are currently used for S/MIME.

有几种CMS内容类型。其中,只有Data、SignedData、EnvelopedData和CompressedData内容类型当前用于S/MIME。

2.4.1. Data Content Type
2.4.1. 数据内容类型

Sending agents MUST use the id-data content type identifier to identify the "inner" MIME message content. For example, when applying a digital signature to MIME data, the CMS SignedData encapContentInfo eContentType MUST include the id-data object identifier and the MIME content MUST be stored in the SignedData encapContentInfo eContent OCTET STRING (unless the sending agent is using multipart/signed, in which case the eContent is absent, per

发送代理必须使用id数据内容类型标识符来标识“内部”MIME消息内容。例如,当对MIME数据应用数字签名时,CMS SignedData encapContentInfo EcontType必须包含id数据对象标识符,MIME内容必须存储在SignedData encapContentInfo eContent八进制字符串中(除非发送代理使用多部分/签名,在这种情况下,根据

section 3.4.3 of this document). As another example, when applying encryption to MIME data, the CMS EnvelopedData encryptedContentInfo contentType MUST include the id-data object identifier and the encrypted MIME content MUST be stored in the EnvelopedData encryptedContentInfo encryptedContent OCTET STRING.

本文件第3.4.3节)。另一个示例是,当对MIME数据应用加密时,CMS EnvelopedData encryptedContentInfo contentType必须包含id数据对象标识符,并且加密的MIME内容必须存储在EnvelopedData encryptedContentInfo encryptedContent八位字符串中。

2.4.2. SignedData Content Type
2.4.2. SignedData内容类型

Sending agents MUST use the SignedData content type to apply a digital signature to a message or, in a degenerate case where there is no signature information, to convey certificates. Applying a signature to a message provides authentication, message integrity, and non-repudiation of origin.

发送代理必须使用SignedData内容类型对消息应用数字签名,或者在没有签名信息的退化情况下传递证书。将签名应用于消息可提供身份验证、消息完整性和来源的不可否认性。

2.4.3. EnvelopedData Content Type
2.4.3. 信封数据内容类型

This content type is used to apply data confidentiality to a message. A sender needs to have access to a public key for each intended message recipient to use this service.

此内容类型用于对消息应用数据机密性。要使用此服务,发件人需要访问每个预期邮件收件人的公钥。

2.4.4. CompressedData Content Type
2.4.4. 压缩数据内容类型

This content type is used to apply data compression to a message. This content type does not provide authentication, message integrity, non-repudiation, or data confidentiality, and is only used to reduce message size.

此内容类型用于对消息应用数据压缩。此内容类型不提供身份验证、消息完整性、不可否认性或数据机密性,仅用于减少消息大小。

See section 3.6 for further guidance on the use of this type in conjunction with other CMS types.

参见第3.6节,了解该类型与其他CMS类型结合使用的更多指南。

2.5. Attributes and the SignerInfo Type
2.5. 属性和SignerInfo类型

The SignerInfo type allows the inclusion of unsigned and signed attributes to be included along with a signature.

SignerInfo类型允许将未签名和已签名属性与签名一起包含。

Receiving agents MUST be able to handle zero or one instance of each of the signed attributes listed here. Sending agents SHOULD generate one instance of each of the following signed attributes in each S/MIME message:

接收代理必须能够处理此处列出的每个已签名属性的零个或一个实例。发送代理应在每个S/MIME消息中生成以下每个签名属性的一个实例:

- signingTime (section 2.5.1 in this document) - sMIMECapabilities (section 2.5.2 in this document) - sMIMEEncryptionKeyPreference (section 2.5.3 in this document) - id-messageDigest (section 11.2 in [CMS]) - id-contentType (section 11.1 in [CMS])

- 签名时间(本文件第2.5.1节)-sMIMECapabilities(本文件第2.5.2节)-sMIMEEncryptionKeyPreference(本文件第2.5.3节)-id messageDigest(CMS中的第11.2节)-id contentType(CMS中的第11.1节)

Further, receiving agents SHOULD be able to handle zero or one instance in the signingCertificate signed attribute, as defined in section 5 of [ESS].

此外,接收代理应能够处理signingCertificate signed属性中的零个或一个实例,如[ESS]第5节中所定义。

Sending agents SHOULD generate one instance of the signingCertificate signed attribute in each SignerInfo structure.

发送代理应在每个SignerinInfo结构中生成signingCertificate signed属性的一个实例。

Additional attributes and values for these attributes might be defined in the future. Receiving agents SHOULD handle attributes or values that it does not recognize in a graceful manner.

将来可能会定义这些属性的其他属性和值。接收代理应该以优雅的方式处理它无法识别的属性或值。

Interactive sending agents that include signed attributes that are not listed here SHOULD display those attributes to the user, so that the user is aware of all of the data being signed.

包含此处未列出的已签名属性的交互式发送代理应向用户显示这些属性,以便用户知道正在签名的所有数据。

2.5.1. Signing-Time Attribute
2.5.1. 签名时间属性

The signing-time attribute is used to convey the time that a message was signed. The time of signing will most likely be created by a message originator and therefore is only as trustworthy as the originator.

签名时间属性用于传递消息签名的时间。签名时间最有可能由消息发起者创建,因此只与发起者一样可信。

Sending agents MUST encode signing time through the year 2049 as UTCTime; signing times in 2050 or later MUST be encoded as GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST interpret the year field (YY) as follows:

发送代理必须将2049年的签名时间编码为UTCTime;2050年或以后的签名时间必须编码为GeneralizedTime。使用UTCTime选项时,S/MIME代理必须按如下方式解释年份字段(YY):

if YY is greater than or equal to 50, the year is interpreted as 19YY; if YY is less than 50, the year is interpreted as 20YY.

如果YY大于或等于50,则该年被解释为19YY;如果YY小于50,则年份被解释为20YY。

2.5.2. SMIMECapabilities Attribute
2.5.2. SMIMECapabilities属性

The SMIMECapabilities attribute includes signature algorithms (such as "sha1WithRSAEncryption"), symmetric algorithms (such as "DES-EDE3-CBC"), and key encipherment algorithms (such as "rsaEncryption"). There are also several identifiers which indicate support for other optional features such as binary encoding and compression. The SMIMECapabilities were designed to be flexible and extensible so that, in the future, a means of identifying other capabilities and preferences such as certificates can be added in a way that will not cause current clients to break.

SMIMECapabilities属性包括签名算法(如“SHA1 WithRSA加密”)、对称算法(如“DES-EDE3-CBC”)和密钥加密算法(如“RSA加密”)。还有几个标识符表示支持其他可选功能,如二进制编码和压缩。SMIMECapabilities被设计为灵活和可扩展的,以便将来可以以不会导致当前客户端中断的方式添加一种识别其他功能和首选项(如证书)的方法。

If present, the SMIMECapabilities attribute MUST be a SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT include multiple instances of the SMIMECapabilities attribute. CMS defines the ASN.1 syntax for Attribute to include attrValues SET OF AttributeValue. A

如果存在,SMIMECapabilities属性必须是SignedAttribute;它不能是未签名的属性。CMS将SignedAttribute定义为一组属性。signerInfo中的SignedAttribute不能包含多个SMIMECapabilities属性实例。CMS为属性定义ASN.1语法,以包括AttributeValue的attrValues集。A.

SMIMECapabilities attribute MUST only include a single instance of AttributeValue. There MUST NOT be zero or multiple instances of AttributeValue present in the attrValues SET OF AttributeValue.

SMIMECapabilities属性只能包含AttributeValue的单个实例。AttributeValue的attrValues集合中不能存在AttributeValue的零个或多个实例。

The semantics of the SMIMECapabilities attribute specify a partial list as to what the client announcing the SMIMECapabilities can support. A client does not have to list every capability it supports, and need not list all its capabilities so that the capabilities list doesn't get too long. In an SMIMECapabilities attribute, the object identifiers (OIDs) are listed in order of their preference, but SHOULD be separated logically along the lines of their categories (signature algorithms, symmetric algorithms, key encipherment algorithms, etc.)

SMIMECapabilities属性的语义指定了一个部分列表,其中列出了宣布SMIMECapabilities的客户端可以支持的内容。客户机不必列出它支持的所有功能,也不必列出它的所有功能,这样功能列表就不会太长。在smimecapability属性中,对象标识符(OID)按其偏好顺序列出,但应按照其类别(签名算法、对称算法、密钥加密算法等)进行逻辑分隔

The structure of the SMIMECapabilities attribute is to facilitate simple table lookups and binary comparisons in order to determine matches. For instance, the DER-encoding for the SMIMECapability for DES EDE3 CBC MUST be identically encoded regardless of the implementation. Because of the requirement for identical encoding, individuals documenting algorithms to be used in the SMIMECapabilities attribute SHOULD explicitly document the correct byte sequence for the common cases.

SMIMECapabilities属性的结构是为了方便简单的表查找和二进制比较,以便确定匹配项。例如,DES EDE3 CBC的SMIMECapability的DER编码必须是相同的编码,而与实现无关。由于对相同编码的要求,记录要在SMIMECapabilities属性中使用的算法的个人应明确记录常见情况下的正确字节序列。

For any capability, the associated parameters for the OID MUST specify all of the parameters necessary to differentiate between two instances of the same algorithm. For instance, the number of rounds and the block size for RC5 needs to be specified in addition to the key length.

对于任何功能,OID的关联参数必须指定区分同一算法的两个实例所需的所有参数。例如,除了密钥长度外,还需要指定RC5的轮数和块大小。

The OIDs that correspond to algorithms SHOULD use the same OID as the actual algorithm, except in the case where the algorithm usage is ambiguous from the OID. For instance, in an earlier specification, rsaEncryption was ambiguous because it could refer to either a signature algorithm or a key encipherment algorithm. In the event that an OID is ambiguous, it needs to be arbitrated by the maintainer of the registered SMIMECapabilities list as to which type of algorithm will use the OID, and a new OID MUST be allocated under the smimeCapabilities OID to satisfy the other use of the OID.

与算法对应的OID应使用与实际算法相同的OID,除非算法用法与OID不明确。例如,在早期的规范中,RSA加密是不明确的,因为它可以引用签名算法或密钥加密算法。如果OID不明确,则需要由注册的SMIMECapabilities列表的维护者仲裁哪种类型的算法将使用OID,并且必须在SMIMECapabilities OID下分配新的OID以满足OID的其他用途。

The registered SMIMECapabilities list specifies the parameters for OIDs that need them, most notably key lengths in the case of variable-length symmetric ciphers. In the event that there are no differentiating parameters for a particular OID, the parameters MUST be omitted, and MUST NOT be encoded as NULL.

registered SMIMECapabilities列表指定了需要它们的OID的参数,尤其是可变长度对称密码的密钥长度。如果特定OID没有区分参数,则必须忽略这些参数,并且不得将其编码为NULL。

Additional values for the SMIMECapabilities attribute might be defined in the future. Receiving agents MUST handle a SMIMECapabilities object that has values that it does not recognize in a graceful manner.

将来可能会定义SMIMECapabilities属性的其他值。接收代理必须处理SMIMECapabilities对象,该对象的值不能被优雅地识别。

Section 2.7.1 explains a strategy for caching capabilities.

第2.7.1节解释了缓存功能的策略。

2.5.2.1. SMIMECapability For the RC2 Algorithm
2.5.2.1. RC2算法的SMIMECapability

For the RC2 algorithm preference SMIMECapability, the capabilityID MUST be set to the value rc2-cbc as defined in [CMSALG]. The parameters field MUST contain SMIMECapabilitiesParametersForRC2CBC (see appendix A).

对于RC2算法首选项SMIMECapability,capabilityID必须设置为[CMSALG]中定义的值RC2 cbc。参数字段必须包含SMIMECapabilitiesParametersForRC2CBC(见附录A)。

Please note that the SMIMECapabilitiesParametersForRC2CBC is a single INTEGER which contains the effective key length (NOT the corresponding RC2 parameter version value). So, for example, for RC2 with a 128-bit effective key length, the parameter would be encoded as the INTEGER value 128, NOT the corresponding parameter version of 58.

请注意,SMIMECapabilitiesParametersForRC2CBC是一个包含有效密钥长度(而不是相应的RC2参数版本值)的单个整数。因此,例如,对于具有128位有效密钥长度的RC2,参数将被编码为整数值128,而不是对应的参数版本58。

2.5.3. Encryption Key Preference Attribute
2.5.3. 加密密钥首选项属性

The encryption key preference attribute allows the signer to unambiguously describe which of the signer's certificates has the signer's preferred encryption key. This attribute is designed to enhance behavior for interoperating with those clients that use separate keys for encryption and signing. This attribute is used to convey to anyone viewing the attribute which of the listed certificates is appropriate for encrypting a session key for future encrypted messages.

“加密密钥首选项”属性允许签名者明确描述签名者的哪些证书具有签名者的首选加密密钥。此属性旨在增强与使用单独密钥进行加密和签名的客户端进行互操作的行为。此属性用于向查看该属性的任何人传达列出的证书中的哪一个适合加密会话密钥以用于将来加密的消息。

If present, the SMIMEEncryptionKeyPreference attribute MUST be a SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT include multiple instances of the SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax for Attribute to include attrValues SET OF AttributeValue. A SMIMEEncryptionKeyPreference attribute MUST only include a single instance of AttributeValue. There MUST NOT be zero or multiple instances of AttributeValue present in the attrValues SET OF AttributeValue.

如果存在,SMIMEEncryptionKeyPreference属性必须是SignedAttribute;它不能是未签名的属性。CMS将SignedAttribute定义为一组属性。signerInfo中的SignedAttribute不能包含多个SMIMEEncryptionKeyPreference属性实例。CMS为属性定义ASN.1语法,以包括AttributeValue的attrValues集。SMIMEEncryptionKeyPreference属性只能包含AttributeValue的单个实例。AttributeValue的attrValues集合中不能存在AttributeValue的零个或多个实例。

The sending agent SHOULD include the referenced certificate in the set of certificates included in the signed message if this attribute is used. The certificate MAY be omitted if it has been previously made available to the receiving agent. Sending agents SHOULD use this attribute if the commonly used or preferred encryption

如果使用此属性,则发送代理应将引用的证书包括在已签名消息中包含的证书集中。如果先前已向接收代理提供证书,则可省略该证书。如果使用常用或首选加密,则发送代理应使用此属性

certificate is not the same as the certificate used to sign the message.

证书与用于签名消息的证书不同。

Receiving agents SHOULD store the preference data if the signature on the message is valid and the signing time is greater than the currently stored value. (As with the SMIMECapabilities, the clock skew SHOULD be checked and the data not used if the skew is too great.) Receiving agents SHOULD respect the sender's encryption key preference attribute if possible. This, however, represents only a preference and the receiving agent can use any certificate in replying to the sender that is valid.

如果消息上的签名有效且签名时间大于当前存储的值,则接收代理应存储首选项数据。(与SMIMECapabilities一样,应检查时钟偏差,如果偏差太大,则不使用数据。)如果可能,接收代理应尊重发送方的加密密钥首选项属性。但是,这只表示首选项,并且接收方代理可以使用任何有效的证书回复发送方。

Section 2.7.1 explains a strategy for caching preference data.

第2.7.1节解释了缓存首选项数据的策略。

2.5.3.1. Selection of Recipient Key Management Certificate
2.5.3.1. 选择收件人密钥管理证书

In order to determine the key management certificate to be used when sending a future CMS EnvelopedData message for a particular recipient, the following steps SHOULD be followed:

为了确定在为特定收件人发送未来CMS信封数据消息时要使用的密钥管理证书,应遵循以下步骤:

- If an SMIMEEncryptionKeyPreference attribute is found in a SignedData object received from the desired recipient, this identifies the X.509 certificate that SHOULD be used as the X.509 key management certificate for the recipient.

- 如果在从所需收件人接收的SignedData对象中找到SMIMEEncryptionKeyPreference属性,则会标识应用作收件人的X.509密钥管理证书的X.509证书。

- If an SMIMEEncryptionKeyPreference attribute is not found in a SignedData object received from the desired recipient, the set of X.509 certificates SHOULD be searched for a X.509 certificate with the same subject name as the signing of a X.509 certificate which can be used for key management.

- 如果在从所需收件人接收的SignedData对象中未找到SMIMEEncryptionKeyPreference属性,则应在X.509证书集中搜索与可用于密钥管理的X.509证书签名具有相同主题名称的X.509证书。

- Or use some other method of determining the user's key management key. If a X.509 key management certificate is not found, then encryption cannot be done with the signer of the message. If multiple X.509 key management certificates are found, the S/MIME agent can make an arbitrary choice between them.

- 或者使用一些其他方法来确定用户的密钥管理密钥。如果未找到X.509密钥管理证书,则无法对消息的签名者进行加密。如果找到多个X.509密钥管理证书,S/MIME代理可以在它们之间进行任意选择。

2.6. SignerIdentifier SignerInfo Type
2.6. SignerIdentifier SignerInfo类型

S/MIME v3.1 implementations MUST support both issuerAndSerialNumber as well as subjectKeyIdentifier. Messages that use the subjectKeyIdentifier choice cannot be read by S/MIME v2 clients.

S/MIME v3.1实现必须同时支持issuerAndSerialNumber和subjectKeyIdentifier。S/MIME v2客户端无法读取使用subjectKeyIdentifier选项的消息。

It is important to understand that some certificates use a value for subjectKeyIdentifier that is not suitable for uniquely identifying a certificate. Implementations MUST be prepared for multiple certificates for potentially different entities to have the same value for subjectKeyIdentifier, and MUST be prepared to try each

必须了解,某些证书使用的subjectKeyIdentifier值不适合唯一标识证书。实现必须为可能不同的实体的多个证书做好准备,以使subjectKeyIdentifier具有相同的值,并且必须准备尝试每个证书

matching certificate during signature verification before indicating an error condition.

在指示错误条件之前,在签名验证期间匹配证书。

2.7. ContentEncryptionAlgorithmIdentifier
2.7. ContentEncryptionAlgorithmIdentifier

Sending and receiving agents MUST support encryption and decryption with DES EDE3 CBC, hereinafter called "tripleDES" [CMSALG]. Receiving agents SHOULD support encryption and decryption using the RC2 [CMSALG] or a compatible algorithm at a key size of 40 bits, hereinafter called "RC2/40". Sending and receiving agents SHOULD support encryption and decryption with AES [CMSAES] at a key size of 128, 192, and 256 bits.

发送和接收代理必须支持DES EDE3 CBC的加密和解密,以下称为“tripleDES”[CMSALG]。接收代理应支持使用RC2[CMSALG]或密钥大小为40位的兼容算法(以下称为“RC2/40”)进行加密和解密。发送和接收代理应支持密钥大小为128、192和256位的AES[CMSAES]加密和解密。

2.7.1. Deciding Which Encryption Method To Use
2.7.1. 决定使用哪种加密方法

When a sending agent creates an encrypted message, it has to decide which type of encryption to use. The decision process involves using information garnered from the capabilities lists included in messages received from the recipient, as well as out-of-band information such as private agreements, user preferences, legal restrictions, and so on.

当发送代理创建加密消息时,它必须决定使用哪种加密类型。决策过程涉及使用从收件人收到的消息中包含的功能列表中收集的信息,以及带外信息,如私人协议、用户首选项、法律限制等。

Section 2.5.2 defines a method by which a sending agent can optionally announce, among other things, its decrypting capabilities in its order of preference. The following method for processing and remembering the encryption capabilities attribute in incoming signed messages SHOULD be used.

第2.5.2节定义了一种方法,通过该方法,发送代理可以选择按其优先顺序宣布其解密能力。应使用以下方法来处理和记住传入签名消息中的加密功能属性。

- If the receiving agent has not yet created a list of capabilities for the sender's public key, then, after verifying the signature on the incoming message and checking the timestamp, the receiving agent SHOULD create a new list containing at least the signing time and the symmetric capabilities.

- 如果接收代理尚未为发送方的公钥创建功能列表,则在验证传入消息上的签名并检查时间戳后,接收代理应创建一个至少包含签名时间和对称功能的新列表。

- If such a list already exists, the receiving agent SHOULD verify that the signing time in the incoming message is greater than the signing time stored in the list and that the signature is valid. If so, the receiving agent SHOULD update both the signing time and capabilities in the list. Values of the signing time that lie far in the future (that is, a greater discrepancy than any reasonable clock skew), or a capabilities list in messages whose signature could not be verified, MUST NOT be accepted.

- 如果此类列表已经存在,则接收代理应验证传入消息中的签名时间是否大于列表中存储的签名时间,以及签名是否有效。如果是这样,接收代理应该更新列表中的签名时间和功能。不能接受未来很长时间内的签名时间值(即,比任何合理的时钟偏差都大的差异)或无法验证签名的消息中的功能列表。

The list of capabilities SHOULD be stored for future use in creating messages.

应存储功能列表,以便将来在创建消息时使用。

Before sending a message, the sending agent MUST decide whether it is willing to use weak encryption for the particular data in the

在发送消息之前,发送代理必须决定是否愿意对消息中的特定数据使用弱加密

message. If the sending agent decides that weak encryption is unacceptable for this data, then the sending agent MUST NOT use a weak algorithm such as RC2/40. The decision to use or not use weak encryption overrides any other decision in this section about which encryption algorithm to use.

消息如果发送代理决定此数据不能接受弱加密,则发送代理不得使用弱算法,如RC2/40。使用或不使用弱加密的决定将覆盖本节中有关使用哪种加密算法的任何其他决定。

Sections 2.7.2.1 through 2.7.2.4 describe the decisions a sending agent SHOULD use in deciding which type of encryption will be applied to a message. These rules are ordered, so the sending agent SHOULD make its decision in the order given.

第2.7.2.1节至第2.7.2.4节描述了发送代理在决定将对消息应用哪种类型的加密时应使用的决定。这些规则是有序的,因此发送代理应该按照给定的顺序做出决定。

2.7.1.1. Rule 1: Known Capabilities
2.7.1.1. 规则1:已知能力

If the sending agent has received a set of capabilities from the recipient for the message the agent is about to encrypt, then the sending agent SHOULD use that information by selecting the first capability in the list (that is, the capability most preferred by the intended recipient) that the sending agent knows how to encrypt. The sending agent SHOULD use one of the capabilities in the list if the agent reasonably expects the recipient to be able to decrypt the message.

如果发送代理已从收件人处收到一组代理将要加密的消息的功能,则发送代理应通过选择列表中发送代理知道如何加密的第一个功能(即预期收件人最喜欢的功能)来使用该信息。如果发送代理合理地期望收件人能够解密邮件,则发送代理应使用列表中的功能之一。

2.7.1.2. Rule 2: Unknown Capabilities, Unknown Version of S/MIME
2.7.1.2. 规则2:未知功能,未知版本的S/MIME

If the following two conditions are met: - the sending agent has no knowledge of the encryption capabilities of the recipient, - and the sending agent has no knowledge of the version of S/MIME of the recipient, then the sending agent SHOULD use tripleDES because it is a stronger algorithm and is required by S/MIME v3. If the sending agent chooses not to use tripleDES in this step, it SHOULD use RC2/40.

如果满足以下两个条件:-发送代理不知道收件人的加密功能,-并且发送代理不知道收件人的S/MIME版本,则发送代理应使用tripleDES,因为它是一种更强的算法,并且是S/MIME v3所要求的。如果发送代理在此步骤中选择不使用三元组,则应使用RC2/40。

2.7.2. Choosing Weak Encryption
2.7.2. 选择弱加密

Like all algorithms that use 40 bit keys, RC2/40 is considered by many to be weak encryption. A sending agent that is controlled by a human SHOULD allow a human sender to determine the risks of sending data using RC2/40 or a similarly weak encryption algorithm before sending the data, and possibly allow the human to use a stronger encryption method such as tripleDES.

像所有使用40位密钥的算法一样,许多人认为RC2/40是弱加密。由人工控制的发送代理应允许人工发送者在发送数据之前确定使用RC2/40或类似弱加密算法发送数据的风险,并可能允许人工使用更强的加密方法,如tripleDES。

2.7.3. Multiple Recipients
2.7.3. 多个收件人

If a sending agent is composing an encrypted message to a group of recipients where the encryption capabilities of some of the recipients do not overlap, the sending agent is forced to send more than one message. Please note that if the sending agent chooses to

如果发送代理正在向一组收件人发送加密邮件,其中某些收件人的加密功能不重叠,则发送代理将被迫发送多条邮件。请注意,如果发送代理选择

send a message encrypted with a strong algorithm, and then send the same message encrypted with a weak algorithm, someone watching the communications channel could learn the contents of the strongly-encrypted message simply by decrypting the weakly-encrypted message.

发送使用强算法加密的消息,然后发送使用弱算法加密的相同消息,观察通信信道的人只需对弱加密消息解密,即可了解强加密消息的内容。

3. Creating S/MIME Messages
3. 创建S/MIME消息

This section describes the S/MIME message formats and how they are created. S/MIME messages are a combination of MIME bodies and CMS content types. Several MIME types as well as several CMS content types are used. The data to be secured is always a canonical MIME entity. The MIME entity and other data, such as certificates and algorithm identifiers, are given to CMS processing facilities which produce a CMS object. Finally, the CMS object is wrapped in MIME. The Enhanced Security Services for S/MIME [ESS] document provides descriptions of how nested, secured S/MIME messages are formatted. ESS provides a description of how a triple-wrapped S/MIME message is formatted using multipart/signed and application/pkcs7-mime for the signatures.

本节介绍S/MIME消息格式及其创建方式。S/MIME消息是MIME正文和CMS内容类型的组合。使用了几种MIME类型以及几种CMS内容类型。要保护的数据始终是规范的MIME实体。MIME实体和其他数据(如证书和算法标识符)被提供给CMS处理设施,这些设施生成CMS对象。最后,CMS对象被包装在MIME中。增强的S/MIME安全服务[ESS]文档描述了嵌套的安全S/MIME消息的格式。ESS描述了如何使用签名的multipart/signed和application/pkcs7 MIME对三层包装的S/MIME消息进行格式化。

S/MIME provides one format for enveloped-only data, several formats for signed-only data, and several formats for signed and enveloped data. Several formats are required to accommodate several environments, in particular for signed messages. The criteria for choosing among these formats are also described.

S/MIME为仅封装数据提供了一种格式,为仅签名数据提供了几种格式,为签名和封装数据提供了几种格式。需要多种格式来适应多种环境,特别是对于签名消息。还描述了在这些格式中选择的标准。

The reader of this section is expected to understand MIME as described in [MIME-SPEC] and [MIME-SECURE].

本节的读者应理解[MIME-SPEC]和[MIME-SECURE]中所述的MIME。

3.1. Preparing the MIME Entity for Signing, Enveloping or Compressing
3.1. 准备MIME实体以进行签名、封装或压缩

S/MIME is used to secure MIME entities. A MIME entity can be a sub-part, sub-parts of a message, or the whole message with all its sub-parts. A MIME entity that is the whole message includes only the MIME headers and MIME body, and does not include the RFC-822 headers. Note that S/MIME can also be used to secure MIME entities used in applications other than Internet mail. If protection of the RFC-822 headers is required, the use of the message/rfc822 MIME type is explained later in this section.

S/MIME用于保护MIME实体。MIME实体可以是消息的子部分或子部分,也可以是整个消息及其所有子部分。作为整个消息的MIME实体只包括MIME头和MIME体,不包括RFC-822头。请注意,S/MIME还可用于保护除Internet邮件以外的应用程序中使用的MIME实体。如果需要保护RFC-822头,本节后面将解释消息/rfc822 MIME类型的使用。

The MIME entity that is secured and described in this section can be thought of as the "inside" MIME entity. That is, it is the "innermost" object in what is possibly a larger MIME message. Processing "outside" MIME entities into CMS content types is described in Section 3.2, 3.4, and elsewhere.

本节中描述的受保护MIME实体可以被视为“内部”MIME实体。也就是说,它可能是更大的MIME消息中的“最内层”对象。将“外部”MIME实体处理为CMS内容类型在第3.2节、第3.4节和其他地方进行了描述。

The procedure for preparing a MIME entity is given in [MIME-SPEC]. The same procedure is used here with some additional restrictions

[MIME-SPEC]中给出了准备MIME实体的过程。这里使用相同的程序,但有一些附加限制

when signing. Description of the procedures from [MIME-SPEC] are repeated here, but it is suggested that the reader refer to that document for the exact procedure. This section also describes additional requirements.

签字的时候。此处重复[MIME-SPEC]中的过程描述,但建议读者参考该文档了解确切的过程。本节还描述了其他要求。

A single procedure is used for creating MIME entities that are to have any combination of signing, enveloping, and compressing applied. Some additional steps are recommended to defend against known corruptions that can occur during mail transport that are of particular importance for clear-signing using the multipart/signed format. It is recommended that these additional steps be performed on enveloped messages, or signed and enveloped messages, so that the message can be forwarded to any environment without modification.

一个过程用于创建MIME实体,这些实体将应用签名、封装和压缩的任意组合。建议采取一些额外的步骤来防止邮件传输过程中可能发生的已知损坏,这些损坏对于使用多部分/签名格式的清除签名特别重要。建议对封装的消息或签名和封装的消息执行这些附加步骤,以便在不进行修改的情况下将消息转发到任何环境。

These steps are descriptive rather than prescriptive. The implementer is free to use any procedure as long as the result is the same.

这些步骤是描述性的,而不是规定性的。只要结果相同,实现者就可以自由使用任何过程。

Step 1. The MIME entity is prepared according to the local conventions.

第一步。MIME实体是根据本地约定准备的。

Step 2. The leaf parts of the MIME entity are converted to canonical form.

第二步。MIME实体的叶部分将转换为规范形式。

Step 3. Appropriate transfer encoding is applied to the leaves of the MIME entity.

第三步。对MIME实体的叶子应用适当的传输编码。

When an S/MIME message is received, the security services on the message are processed, and the result is the MIME entity. That MIME entity is typically passed to a MIME-capable user agent where, it is further decoded and presented to the user or receiving application.

当接收到S/MIME消息时,将处理消息上的安全服务,结果是MIME实体。该MIME实体通常被传递给支持MIME的用户代理,在该代理中,它被进一步解码并呈现给用户或接收应用程序。

In order to protect outer, non-content related message headers (for instance, the "Subject", "To", "From" and "CC" fields), the sending client MAY wrap a full MIME message in a message/rfc822 wrapper in order to apply S/MIME security services to these headers. It is up to the receiving client to decide how to present these "inner" headers along with the unprotected "outer" headers.

为了保护外部的、与内容无关的消息头(例如,“主题”、“收件人”、“发件人”和“抄送”字段),发送客户端可以将完整的MIME消息包装在消息/rfc822包装器中,以便将S/MIME安全服务应用于这些头。由接收客户端决定如何显示这些“内部”头和未受保护的“外部”头。

When an S/MIME message is received, if the top-level protected MIME entity has a Content-Type of message/rfc822, it can be assumed that the intent was to provide header protection. This entity SHOULD be presented as the top-level message, taking into account header merging issues as previously discussed.

当接收到S/MIME消息时,如果顶级受保护MIME实体的内容类型为message/rfc822,则可以假定其目的是提供头保护。考虑到前面讨论的头合并问题,此实体应作为顶级消息显示。

3.1.1. Canonicalization
3.1.1. 规范化

Each MIME entity MUST be converted to a canonical form that is uniquely and unambiguously representable in the environment where the signature is created and the environment where the signature will be verified. MIME entities MUST be canonicalized for enveloping and compressing as well as signing.

必须将每个MIME实体转换为规范形式,该规范形式在创建签名的环境和验证签名的环境中唯一且明确地表示。MIME实体必须规范化,以便封装、压缩和签名。

The exact details of canonicalization depend on the actual MIME type and subtype of an entity, and are not described here. Instead, the standard for the particular MIME type SHOULD be consulted. For example, canonicalization of type text/plain is different from canonicalization of audio/basic. Other than text types, most types have only one representation regardless of computing platform or environment which can be considered their canonical representation. In general, canonicalization will be performed by the non-security part of the sending agent rather than the S/MIME implementation.

规范化的确切细节取决于实体的实际MIME类型和子类型,此处不作描述。相反,应该参考特定MIME类型的标准。例如,text/plain类型的规范化不同于audio/basic类型的规范化。除了文本类型之外,大多数类型只有一种表示形式,而不管计算平台或环境如何,这可以被视为它们的规范表示形式。通常,规范化将由发送代理的非安全部分执行,而不是由S/MIME实现执行。

The most common and important canonicalization is for text, which is often represented differently in different environments. MIME entities of major type "text" MUST have both their line endings and character set canonicalized. The line ending MUST be the pair of characters <CR><LF>, and the charset SHOULD be a registered charset [CHARSETS]. The details of the canonicalization are specified in [MIME-SPEC]. The chosen charset SHOULD be named in the charset parameter so that the receiving agent can unambiguously determine the charset used.

最常见和最重要的规范化是针对文本的规范化,在不同的环境中,文本通常有不同的表示。主要类型为“text”的MIME实体的行尾和字符集都必须规范化。行尾必须是一对字符<CR><LF>,并且字符集应该是注册的字符集[charset]。规范化的详细信息在[MIME-SPEC]中指定。所选的字符集应该在charset参数中命名,以便接收代理可以明确地确定使用的字符集。

Note that some charsets such as ISO-2022 have multiple representations for the same characters. When preparing such text for signing, the canonical representation specified for the charset MUST be used.

请注意,某些字符集(如ISO-2022)具有相同字符的多个表示形式。准备此类文本进行签名时,必须使用为字符集指定的规范表示。

3.1.2. Transfer Encoding
3.1.2. 传输编码

When generating any of the secured MIME entities below, except the signing using the multipart/signed format, no transfer encoding is required at all. S/MIME implementations MUST be able to deal with binary MIME objects. If no Content-Transfer-Encoding header is present, the transfer encoding is presumed to be 7BIT.

生成以下任何受保护的MIME实体时,除了使用多部分/签名格式的签名外,根本不需要传输编码。S/MIME实现必须能够处理二进制MIME对象。如果不存在内容传输编码头,则传输编码假定为7BIT。

S/MIME implementations SHOULD however use transfer encoding described in section 3.1.3 for all MIME entities they secure. The reason for securing only 7-bit MIME entities, even for enveloped data that are not exposed to the transport, is that it allows the MIME entity to be handled in any environment without changing it. For example, a trusted gateway might remove the envelope, but not the signature, of a message, and then forward the signed message on to the end

但是,S/MIME实现应使用第3.1.3节中所述的传输编码来保护所有MIME实体。仅保护7位MIME实体的原因是,它允许在任何环境中处理MIME实体,而无需对其进行更改,即使对于未暴露于传输的封装数据也是如此。例如,可信网关可能会删除消息的信封,但不会删除签名,然后将签名的消息转发到最后

recipient so that they can verify the signatures directly. If the transport internal to the site is not 8-bit clean, such as on a wide-area network with a single mail gateway, verifying the signature will not be possible unless the original MIME entity was only 7-bit data.

收件人,以便他们可以直接验证签名。如果站点内部的传输不是8位干净的,例如在具有单个邮件网关的广域网上,则无法验证签名,除非原始MIME实体仅为7位数据。

S/MIME implementations which "know" that all intended recipient(s) are capable of handling inner (all but the outermost) binary MIME objects SHOULD use binary encoding as opposed to a 7-bit-safe transfer encoding for the inner entities. The use of a 7-bit-safe encoding (such as base64) would unnecessarily expand the message size. Implementations MAY "know" that recipient implementations are capable of handling inner binary MIME entities either by interpreting the id-cap-preferBinaryInside sMIMECapabilities attribute, by prior agreement, or by other means.

S/MIME实现“知道”所有预期接收者都能够处理内部(除了最外层)二进制MIME对象,应该使用二进制编码,而不是内部实体的7位安全传输编码。使用7位安全编码(如base64)会不必要地扩大消息大小。实现可能“知道”接收方实现能够通过解释id cap preferBinaryInside sMIMECapabilities属性、事先约定或其他方式来处理内部二进制MIME实体。

If one or more intended recipients are unable to handle inner binary MIME objects, or if this capability is unknown for any of the intended recipients, S/MIME implementations SHOULD use transfer encoding described in section 3.1.3 for all MIME entities they secure.

如果一个或多个预期收件人无法处理内部二进制MIME对象,或者如果任何预期收件人都不知道此功能,则S/MIME实现应使用第3.1.3节中所述的传输编码来保护所有MIME实体。

3.1.3. Transfer Encoding for Signing Using multipart/signed
3.1.3. 使用多部分/签名的签名传输编码

If a multipart/signed entity is ever to be transmitted over the standard Internet SMTP infrastructure or other transport that is constrained to 7-bit text, it MUST have transfer encoding applied so that it is represented as 7-bit text. MIME entities that are 7-bit data already need no transfer encoding. Entities such as 8-bit text and binary data can be encoded with quoted-printable or base-64 transfer encoding.

如果要通过标准Internet SMTP基础设施或其他限制为7位文本的传输传输多部分/签名实体,则必须应用传输编码,以便将其表示为7位文本。7位数据的MIME实体已经不需要传输编码。实体(如8位文本和二进制数据)可以使用带引号的可打印或base-64传输编码进行编码。

The primary reason for the 7-bit requirement is that the Internet mail transport infrastructure cannot guarantee transport of 8-bit or binary data. Even though many segments of the transport infrastructure now handle 8-bit and even binary data, it is sometimes not possible to know whether the transport path is 8-bit clean. If a mail message with 8-bit data were to encounter a message transfer agent that can not transmit 8-bit or binary data, the agent has three options, none of which are acceptable for a clear-signed message:

7位要求的主要原因是Internet邮件传输基础设施无法保证8位或二进制数据的传输。尽管传输基础设施的许多部分现在处理8位甚至二进制数据,但有时不可能知道传输路径是否是8位干净的。如果具有8位数据的邮件遇到无法传输8位或二进制数据的邮件传输代理,则该代理有三个选项,其中任何一个选项都不适用于无签名邮件:

- The agent could change the transfer encoding; this would invalidate the signature. - The agent could transmit the data anyway, which would most likely result in the 8th bit being corrupted; this too would invalidate the signature. - The agent could return the message to the sender.

- 代理可以更改传输编码;这将使签名无效代理无论如何都可以传输数据,这很可能导致第8位被破坏;这也会使签名无效代理可以将邮件返回给发件人。

[MIME-SECURE] prohibits an agent from changing the transfer encoding of the first part of a multipart/signed message. If a compliant agent that can not transmit 8-bit or binary data encounters a multipart/signed message with 8-bit or binary data in the first part, it would have to return the message to the sender as undeliverable.

[MIME-SECURE]禁止代理更改多部分/签名消息第一部分的传输编码。如果无法传输8位或二进制数据的兼容代理在第一部分遇到包含8位或二进制数据的多部分/签名消息,则必须将消息作为无法送达返回给发送方。

3.1.4. Sample Canonical MIME Entity
3.1.4. 示例规范MIME实体

This example shows a multipart/mixed message with full transfer encoding. This message contains a text part and an attachment. The sample message text includes characters that are not US-ASCII and thus need to be transfer encoded. Though not shown here, the end of each line is <CR><LF>. The line ending of the MIME headers, the text, and transfer encoded parts, all MUST be <CR><LF>.

此示例显示了具有完全传输编码的多部分/混合消息。此邮件包含文本部分和附件。示例消息文本包含非US-ASCII字符,因此需要进行传输编码。虽然此处未显示,但每行的末尾都是<CR><LF>。MIME头、文本和传输编码部分的行尾都必须是<CR><LF>。

Note that this example is not of an S/MIME message.

请注意,此示例不是S/MIME消息的示例。

       Content-Type: multipart/mixed; boundary=bar
        
       Content-Type: multipart/mixed; boundary=bar
        
       --bar
       Content-Type: text/plain; charset=iso-8859-1
       Content-Transfer-Encoding: quoted-printable
        
       --bar
       Content-Type: text/plain; charset=iso-8859-1
       Content-Transfer-Encoding: quoted-printable
        

=A1Hola Michael!

嗨,迈克尔!

How do you like the new S/MIME specification?

您觉得新的S/MIME规范怎么样?

It's generally a good idea to encode lines that begin with From=20because some mail transport agents will insert a greater-than (>) sign, thus invalidating the signature.

通常最好对以From=20开头的行进行编码,因为某些邮件传输代理会插入大于(>)的符号,从而使签名无效。

Also, in some cases it might be desirable to encode any =20 trailing whitespace that occurs on lines in order to ensure =20 that the message signature is not invalidated when passing =20 a gateway that modifies such whitespace (like BITNET). =20

此外,在某些情况下,可能需要对行上出现的任何=20尾随空格进行编码,以确保在传递=20修改此类空格的网关(如BITNET)时,消息签名不会失效=20

       --bar
       Content-Type: image/jpeg
       Content-Transfer-Encoding: base64
        
       --bar
       Content-Type: image/jpeg
       Content-Transfer-Encoding: base64
        
       iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
       jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
       uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
       HOxEa44b+EI=
        
       iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
       jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
       uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
       HOxEa44b+EI=
        

--bar--

--酒吧--

3.2. The application/pkcs7-mime Type
3.2. 应用程序/pkcs7 mime类型

The application/pkcs7-mime type is used to carry CMS content types including EnvelopedData, SignedData, and CompressedData. The details of constructing these entities is described in subsequent sections. This section describes the general characteristics of the application/pkcs7-mime type.

application/pkcs7 mime类型用于承载CMS内容类型,包括EnvelopedData、SignedData和CompressedData。构建这些实体的详细信息将在后续章节中介绍。本节介绍application/pkcs7 mime类型的一般特征。

The carried CMS object always contains a MIME entity that is prepared as described in section 3.1 if the eContentType is id-data. Other contents MAY be carried when the eContentType contains different values. See [ESS] for an example of this with signed receipts.

如果eContentType是id数据,则所携带的CMS对象始终包含按照第3.1节中所述准备的MIME实体。当eContentType包含不同的值时,可以携带其他内容。请参见[ESS]以了解带有签名收据的示例。

Since CMS content types are binary data, in most cases base-64 transfer encoding is appropriate, in particular, when used with SMTP transport. The transfer encoding used depends on the transport through which the object is to be sent, and is not a characteristic of the MIME type.

由于CMS内容类型是二进制数据,在大多数情况下,base-64传输编码是合适的,尤其是在与SMTP传输一起使用时。所使用的传输编码取决于要发送对象的传输,而不是MIME类型的特征。

Note that this discussion refers to the transfer encoding of the CMS object or "outside" MIME entity. It is completely distinct from, and unrelated to, the transfer encoding of the MIME entity secured by the CMS object, the "inside" object, which is described in section 3.1.

注意,此讨论涉及CMS对象或“外部”MIME实体的传输编码。它与CMS对象(第3.1节中描述的“内部”对象)保护的MIME实体的传输编码完全不同,也不相关。

Because there are several types of application/pkcs7-mime objects, a sending agent SHOULD do as much as possible to help a receiving agent know about the contents of the object without forcing the receiving agent to decode the ASN.1 for the object. The MIME headers of all application/pkcs7-mime objects SHOULD include the optional "smime-type" parameter, as described in the following sections.

由于存在多种类型的application/pkcs7 mime对象,因此发送代理应尽可能帮助接收代理了解对象的内容,而无需强制接收代理解码对象的ASN.1。所有application/pkcs7 MIME对象的MIME头都应包含可选的“smime type”参数,如以下各节所述。

3.2.1. The name and filename Parameters
3.2.1. 名称和文件名参数

For the application/pkcs7-mime, sending agents SHOULD emit the optional "name" parameter to the Content-Type field for compatibility with older systems. Sending agents SHOULD also emit the optional Content-Disposition field [CONTDISP] with the "filename" parameter. If a sending agent emits the above parameters, the value of the parameters SHOULD be a file name with the appropriate extension:

对于application/pkcs7 mime,发送代理应该向Content-Type字段发出可选的“name”参数,以便与旧系统兼容。发送代理还应发出带有“filename”参数的可选内容处置字段[CONTDISP]。如果发送代理发出上述参数,则参数值应为具有适当扩展名的文件名:

MIME Type File Extension

MIME类型文件扩展名

application/pkcs7-mime (SignedData, EnvelopedData) .p7m

应用程序/pkcs7 mime(签名数据、信封数据)。p7m

application/pkcs7-mime (degenerate SignedData .p7c certificate management message)

应用程序/pkcs7 mime(退化SignedData.p7c证书管理消息)

application/pkcs7-mime (CompressedData) .p7z

application/pkcs7 mime(CompressedData).p7z

application/pkcs7-signature (SignedData) .p7s

应用程序/pkcs7签名(SignedData).p7s

In addition, the file name SHOULD be limited to eight characters followed by a three letter extension. The eight character filename base can be any distinct name; the use of the filename base "smime" SHOULD be used to indicate that the MIME entity is associated with S/MIME.

此外,文件名应限制为八个字符,后跟三个字母的扩展名。八个字符的文件名基可以是任何不同的名称;应使用文件名基“smime”来指示MIME实体与S/MIME关联。

Including a file name serves two purposes. It facilitates easier use of S/MIME objects as files on disk. It also can convey type information across gateways. When a MIME entity of type application/pkcs7-mime (for example) arrives at a gateway that has no special knowledge of S/MIME, it will default the entity's MIME type to application/octet-stream and treat it as a generic attachment, thus losing the type information. However, the suggested filename for an attachment is often carried across a gateway. This often allows the receiving systems to determine the appropriate application to hand the attachment off to, in this case, a stand-alone S/MIME processing application. Note that this mechanism is provided as a convenience for implementations in certain environments. A proper S/MIME implementation MUST use the MIME types and MUST NOT rely on the file extensions.

包含文件名有两个目的。它便于将S/MIME对象作为磁盘上的文件使用。它还可以跨网关传递类型信息。例如,当类型为application/pkcs7 MIME的MIME实体到达对S/MIME没有特殊知识的网关时,它会将该实体的MIME类型默认为application/octet stream,并将其视为通用附件,从而丢失类型信息。但是,附件的建议文件名通常通过网关传送。这通常允许接收系统确定适当的应用程序,以便将附件移交给独立的S/MIME处理应用程序。请注意,提供此机制是为了方便在某些环境中实现。正确的S/MIME实现必须使用MIME类型,并且不能依赖于文件扩展名。

3.2.2. The smime-type parameter
3.2.2. smime类型参数

The application/pkcs7-mime content type defines the optional "smime-type" parameter. The intent of this parameter is to convey details about the security applied (signed or enveloped) along with information about the contained content. This specification defines the following smime-types.

application/pkcs7 mime内容类型定义可选的“smime类型”参数。此参数的目的是传递有关应用(签名或封装)的安全性的详细信息以及有关包含内容的信息。本规范定义了以下smime类型。

Name CMS type Inner Content

名称CMS类型内部内容

enveloped-data EnvelopedData id-data

包络数据包络数据id数据

signed-data SignedData id-data

签名数据签名数据id数据

certs-only SignedData none

证书仅签名数据无

compressed-data CompressedData id-data

压缩数据压缩数据id数据

In order for consistency to be obtained with future specifications, the following guidelines SHOULD be followed when assigning a new smime-type parameter.

为了与将来的规范保持一致,在指定新的smime类型参数时,应遵循以下准则。

1. If both signing and encryption can be applied to the content, then two values for smime-type SHOULD be assigned "signed-*" and "encrypted-*". If one operation can be assigned then this can be omitted. Thus since "certs-only" can only be signed, "signed-" is omitted.

1. 如果签名和加密都可以应用于内容,则smime类型的两个值应分配为“signed-*”和“encrypted-*”。如果可以分配一个操作,则可以省略该操作。因此,由于“仅证书”只能签名,因此省略了“已签名-”。

2. A common string for a content OID SHOULD be assigned. We use "data" for the id-data content OID when MIME is the inner content.

2. 应该为内容OID分配一个公共字符串。当MIME是内部内容时,我们使用“数据”作为id数据内容OID。

3. If no common string is assigned. Then the common string of "OID.<oid>" is recommended (for example, "OID.1.3.6.1.5.5.7.6.1" would be DES40).

3. 如果没有指定公共字符串。然后建议使用公共字符串“OID.<OID>”(例如,“OID.1.3.6.1.5.5.7.6.1”应为DES40)。

It is explicitly intended that this field be a suitable hint for mail client applications to indicate whether a message is "signed" or "encrypted" without having to tunnel into the CMS payload.

明确地说,该字段是邮件客户端应用程序的适当提示,用于指示消息是“已签名”还是“已加密”,而无需通过隧道进入CMS有效负载。

3.3. Creating an Enveloped-only Message
3.3. 创建仅封装的消息

This section describes the format for enveloping a MIME entity without signing it. It is important to note that sending enveloped but not signed messages does not provide for data integrity. It is possible to replace ciphertext in such a way that the processed message will still be valid, but the meaning can be altered.

本节描述了封装MIME实体而不进行签名的格式。需要注意的是,发送封装但未签名的消息不会提供数据完整性。可以通过这样的方式替换密文,即处理后的消息仍然有效,但其含义可以更改。

Step 1. The MIME entity to be enveloped is prepared according to section 3.1.

第一步。要封装的MIME实体根据第3.1节准备。

Step 2. The MIME entity and other required data is processed into a CMS object of type EnvelopedData. In addition to encrypting a copy of the content-encryption key for each recipient, a copy of the content-encryption key SHOULD be encrypted for the originator and included in the EnvelopedData (see [CMS] Section 6).

第二步。MIME实体和其他所需数据被处理为EnvelopedData类型的CMS对象。除了为每个收件人加密一份内容加密密钥副本外,还应为发起人加密一份内容加密密钥副本,并将其包含在信封数据中(见[CMS]第6节)。

Step 3. The EnvelopedData object is wrapped in a CMS ContentInfo object.

第三步。EnvelopedData对象包装在CMS ContentInfo对象中。

Step 4. The ContentInfo object is inserted into an application/pkcs7-mime MIME entity.

第四步。ContentInfo对象被插入到application/pkcs7 mime实体中。

The smime-type parameter for enveloped-only messages is "enveloped-data". The file extension for this type of message is ".p7m".

仅信封消息的smime类型参数为“信封数据”。此类消息的文件扩展名为“.p7m”。

A sample message would be:

示例消息如下:

       Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
            name=smime.p7m
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7m
        
       Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
            name=smime.p7m
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7m
        

rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 0GhIGfHfQbnj756YT64V

RFVBNJ756BBGHYHHHHHUJHJH77N8HGT9HG4VQPFYF467N8HGHGHHHHHHHHHHHHHJH4VQPFF467GHIGFHFYGTRFFBNJT6JH7756TBB9H F8HGHGTRFVHJHHJH776BB9HG4VQBNJ7567GHIGFYT6GHYHHHHHHHHJFFFF4 0GhIGfHfQbnj756YT64V

3.4. Creating a Signed-only Message
3.4. 创建仅签名的邮件

There are two formats for signed messages defined for S/MIME: application/pkcs7-mime with SignedData, and multipart/signed. In general, the multipart/signed form is preferred for sending, and receiving agents MUST be able to handle both.

为S/MIME定义的签名消息有两种格式:带SignedData的application/pkcs7 MIME和multipart/signed。通常,发送时首选多部分/签名表单,而接收代理必须能够同时处理这两种表单。

3.4.1. Choosing a Format for Signed-only Messages
3.4.1. 为仅签名邮件选择格式

There are no hard-and-fast rules when a particular signed-only format is chosen because it depends on the capabilities of all the receivers and the relative importance of receivers with S/MIME facilities being able to verify the signature versus the importance of receivers without S/MIME software being able to view the message.

当选择特定的仅签名格式时,没有硬性规定,因为它取决于所有接收器的能力以及S/MIME设施能够验证签名的接收器相对于S/MIME软件无法查看消息的接收器的相对重要性。

Messages signed using the multipart/signed format can always be viewed by the receiver whether they have S/MIME software or not. They can also be viewed whether they are using a MIME-native user agent or they have messages translated by a gateway. In this context, "be viewed" means the ability to process the message essentially as if it were not a signed message, including any other MIME structure the message might have.

无论接收方是否使用S/MIME软件,都可以查看使用多部分/签名格式签名的消息。也可以查看它们是使用MIME本机用户代理,还是通过网关翻译消息。在这种情况下,“被查看”意味着处理消息的能力,本质上就好像它不是一个签名消息一样,包括消息可能具有的任何其他MIME结构。

Messages signed using the SignedData format cannot be viewed by a recipient unless they have S/MIME facilities. However, the SignedData format protects the message content from being changed by benign intermediate agents. Such agents might do line wrapping or content-transfer encoding changes which would break the signature.

收件人无法查看使用SignedData格式签名的邮件,除非这些邮件具有S/MIME功能。但是,SignedData格式保护消息内容不被良性中间代理更改。这些代理可能会进行换行或内容传输编码更改,这会破坏签名。

3.4.2. Signing Using application/pkcs7-mime with SignedData
3.4.2. 使用带有SignedData的application/pkcs7 mime进行签名

This signing format uses the application/pkcs7-mime MIME type. The steps to create this format are:

此签名格式使用application/pkcs7 mime mime类型。创建此格式的步骤包括:

Step 1. The MIME entity is prepared according to section 3.1.

第一步。MIME实体是根据第3.1节准备的。

Step 2. The MIME entity and other required data is processed into a CMS object of type SignedData.

第二步。MIME实体和其他所需数据被处理为SignedData类型的CMS对象。

Step 3. The SignedData object is wrapped in a CMS ContentInfo object.

第三步。SignedData对象包装在CMS ContentInfo对象中。

Step 4. The ContentInfo object is inserted into an application/pkcs7-mime MIME entity.

第四步。ContentInfo对象被插入到application/pkcs7 mime实体中。

The smime-type parameter for messages using application/pkcs7-mime with SignedData is "signed-data". The file extension for this type of message is ".p7m".

使用带SignedData的application/pkcs7 mime的消息的smime类型参数为“signed data”。此类消息的文件扩展名为“.p7m”。

A sample message would be:

示例消息如下:

       Content-Type: application/pkcs7-mime; smime-type=signed-data;
            name=smime.p7m
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7m
        
       Content-Type: application/pkcs7-mime; smime-type=signed-data;
            name=smime.p7m
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7m
        

567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 6YT64V0GhIGfHfQbnj75

567GHIGHFYT6GHYHHHHHUJPFYFF4F8HGFFYT6GHYHHHHHJHFFFFFFJH776BB9Hg4VQBNJ7 77N8HgT9Hg4VQPFFYF467GHIGHFYT6RFVBNJ756BBGHHHHHHHHHHHHHJHFFFFFFJJH6JH7756TBB9H7N8HGHGHGHGHGHGHGHGHGHGHFYH6YH6YH64V0GHIGHFQBNJ75

3.4.3. Signing Using the multipart/signed Format
3.4.3. 使用多部分/签名格式签名

This format is a clear-signing format. Recipients without any S/MIME or CMS processing facilities are able to view the message. It makes use of the multipart/signed MIME type described in [MIME-SECURE]. The multipart/signed MIME type has two parts. The first part contains the MIME entity that is signed; the second part contains the "detached signature" CMS SignedData object in which the encapContentInfo eContent field is absent.

此格式是一种清晰的签名格式。没有任何S/MIME或CMS处理设施的收件人可以查看邮件。它使用[MIME-SECURE]中描述的多部分/签名MIME类型。多部分/签名MIME类型有两部分。第一部分包含已签名的MIME实体;第二部分包含“分离签名”CMS SignedData对象,其中不存在encapContentInfo eContent字段。

3.4.3.1. The application/pkcs7-signature MIME Type
3.4.3.1. 应用程序/pkcs7签名MIME类型

This MIME type always contains a CMS ContentInfo containing a single CMS object of type SignedData. The SignedData encapContentInfo eContent field MUST be absent. The signerInfos field contains the signatures for the MIME entity.

此MIME类型始终包含一个CMS ContentInfo,其中包含一个类型为SignedData的CMS对象。SignedData encapContentInfo eContent字段必须不存在。signerInfos字段包含MIME实体的签名。

The file extension for signed-only messages using application/pkcs7- signature is ".p7s".

使用application/pkcs7-signature的仅签名消息的文件扩展名为“.p7s”。

3.4.3.2. Creating a multipart/signed Message
3.4.3.2. 创建多部分/签名消息

Step 1. The MIME entity to be signed is prepared according to section 3.1, taking special care for clear-signing.

第一步。要签名的MIME实体是根据第3.1节准备的,特别注意清晰签名。

Step 2. The MIME entity is presented to CMS processing in order to obtain an object of type SignedData in which the encapContentInfo eContent field is absent.

第二步。MIME实体提供给CMS处理,以获得SignedData类型的对象,其中不存在encapContentInfo eContent字段。

Step 3. The MIME entity is inserted into the first part of a multipart/signed message with no processing other than that described in section 3.1.

第三步。MIME实体插入到多部分/签名消息的第一部分,除第3.1节所述的处理外,不进行任何处理。

Step 4. Transfer encoding is applied to the "detached signature" CMS SignedData object and it is inserted into a MIME entity of type application/pkcs7-signature.

第四步。传输编码应用于“分离签名”CMS SignedData对象,并插入到类型为application/pkcs7 signature的MIME实体中。

Step 5. The MIME entity of the application/pkcs7-signature is inserted into the second part of the multipart/signed entity.

第五步。应用程序/pkcs7签名的MIME实体插入到多部分/签名实体的第二部分。

The multipart/signed Content type has two required parameters: the protocol parameter and the micalg parameter.

多部分/签名内容类型有两个必需的参数:协议参数和micalg参数。

The protocol parameter MUST be "application/pkcs7-signature". Note that quotation marks are required around the protocol parameter because MIME requires that the "/" character in the parameter value MUST be quoted.

协议参数必须是“应用程序/pkcs7签名”。请注意,协议参数周围需要引号,因为MIME要求必须引用参数值中的“/”字符。

The micalg parameter allows for one-pass processing when the signature is being verified. The value of the micalg parameter is dependent on the message digest algorithm(s) used in the calculation of the Message Integrity Check. If multiple message digest algorithms are used they MUST be separated by commas per [MIME-SECURE]. The values to be placed in the micalg parameter SHOULD be from the following:

验证签名时,micalg参数允许一次通过处理。micalg参数的值取决于计算消息完整性检查时使用的消息摘要算法。如果使用多个消息摘要算法,则必须按照[MIME-SECURE]用逗号分隔。要放置在micalg参数中的值应为以下值:

Algorithm Value used

使用的算法值

MD5 md5 SHA-1 sha1 SHA-256 sha256 SHA-384 sha384 SHA-512 sha512 Any other (defined separately in algorithm profile or "unknown" if not defined)

MD5 MD5 SHA-1 SHA-1 SHA-256 sha256 SHA-384 sha384 SHA-512 sha512任何其他(在算法配置文件中单独定义或“未知”如果未定义)

(Historical note: some early implementations of S/MIME emitted and expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving agents SHOULD be able to recover gracefully from a micalg parameter value that they do not recognize.

(历史记录:S/MIME的一些早期实现已发出,预期micalg参数为“rsa-md5”和“rsa-sha1”)。接收代理应该能够从它们无法识别的micalg参数值中正常恢复。

The SHA-256, SHA-384, and SHA-512 algorithms [FIPS180-2] are not currently recommended in S/MIME, and are included here for completeness.

目前S/MIME中不推荐使用SHA-256、SHA-384和SHA-512算法[FIPS180-2],为完整起见,此处将其包括在内。

3.4.3.3. Sample multipart/signed Message
3.4.3.3. 多部分/签名消息示例
       Content-Type: multipart/signed;
          protocol="application/pkcs7-signature";
          micalg=sha1; boundary=boundary42
        
       Content-Type: multipart/signed;
          protocol="application/pkcs7-signature";
          micalg=sha1; boundary=boundary42
        
       --boundary42
       Content-Type: text/plain
        
       --boundary42
       Content-Type: text/plain
        

This is a clear-signed message.

这是一条清晰的签名信息。

       --boundary42
       Content-Type: application/pkcs7-signature; name=smime.p7s
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7s
        
       --boundary42
       Content-Type: application/pkcs7-signature; name=smime.p7s
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7s
        

ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 7GhIGfHfYT64VQbnj756

Ghyhhhhhhhhhhhhhhhhhhjhjh77n8hghtrfvbnj756tb9hg4vqpfyf467ghighfyt6 4vqpfyf467ghighfyt6jhhhhhhhhhhhhhhhhhhhhhjhjh756tb9hgtrffbnj n8hghtrfvhhhhhhhhhhhhhj776bb9hg4vqbnj7567ghigfyfyfyfyfyf4 7ghigff

--boundary42--

--边界42--

The content that is digested (the first part of the multipart/signed) are the bytes:

摘要内容(多部分/签名的第一部分)为字节:

43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69 6e 0d 0a 0d 0a 54 68 69 73 20 69 73 20 61 20 63 6c 65 61 72 2d 73 69 67 6e 65 64 20 6d 65 73 73 61 67 65 2e 0d 0a

43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69 6e 0d 0d 0a 54 68 69 73 20 69 73 20 61 20 63 6c 65 61 72 2d 73 69 67 6e 65 64 20 6d 65 73 61 67 2 E 0d 0a

3.5. Creating an Compressed-only Message
3.5. 创建仅压缩的消息

This section describes the format for compressing a MIME entity. Please note that versions of S/MIME prior to 3.1 did not specify any use of CompressedData, and will not recognize it. The use of a capability to indicate the ability to receive CompressedData is described in [CMSCOMPR] and is the preferred method for compatibility.

本节介绍压缩MIME实体的格式。请注意,3.1之前的S/MIME版本没有指定CompressedData的任何用法,也不会识别它。[CMSCOMPR]中描述了使用能力来指示接收压缩数据的能力,这是兼容性的首选方法。

Step 1. The MIME entity to be compressed is prepared according to section 3.1.

第一步。要压缩的MIME实体是根据第3.1节准备的。

Step 2. The MIME entity and other required data is processed into a CMS object of type CompressedData.

第二步。MIME实体和其他所需数据被处理为CompressedData类型的CMS对象。

Step 3. The CompressedData object is wrapped in a CMS ContentInfo object.

第三步。CompressedData对象包装在CMS ContentInfo对象中。

Step 4. The ContentInfo object is inserted into an application/pkcs7-mime MIME entity.

第四步。ContentInfo对象被插入到application/pkcs7 mime实体中。

The smime-type parameter for compressed-only messages is "compressed-data". The file extension for this type of message is ".p7z".

仅压缩消息的smime类型参数为“compressed data”。此类消息的文件扩展名为“.p7z”。

A sample message would be:

示例消息如下:

       Content-Type: application/pkcs7-mime; smime-type=compressed-data;
            name=smime.p7z
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7z
        
       Content-Type: application/pkcs7-mime; smime-type=compressed-data;
            name=smime.p7z
       Content-Transfer-Encoding: base64
       Content-Disposition: attachment; filename=smime.p7z
        

rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 0GhIGfHfQbnj756YT64V

RFVBNJ756BBGHYHHHHHUJHJH77N8HGT9HG4VQPFYF467N8HGHGHHHHHHHHHHHHHJH4VQPFF467GHIGFHFYGTRFFBNJT6JH7756TBB9H F8HGHGTRFVHJHHJH776BB9HG4VQBNJ7567GHIGFYT6GHYHHHHHHHHJFFFF4 0GhIGfHfQbnj756YT64V

3.6. Multiple Operations
3.6. 多重操作

The signed-only, encrypted-only, and compressed-only MIME formats can be nested. This works because these formats are all MIME entities that encapsulate other MIME entities.

可以嵌套仅签名、仅加密和仅压缩的MIME格式。这是因为这些格式都是封装其他MIME实体的MIME实体。

An S/MIME implementation MUST be able to receive and process arbitrarily nested S/MIME within reasonable resource limits of the recipient computer.

S/MIME实现必须能够在接收方计算机的合理资源限制内接收和处理任意嵌套的S/MIME。

It is possible to apply any of the signing, encrypting, and compressing operations in any order. It is up to the implementer and the user to choose. When signing first, the signatories are then securely obscured by the enveloping. When enveloping first the signatories are exposed, but it is possible to verify signatures without removing the enveloping. This can be useful in an environment were automatic signature verification is desired, as no private key material is required to verify a signature.

可以按任何顺序应用任何签名、加密和压缩操作。这取决于实现者和用户的选择。首先签字时,签字人会被信封牢牢遮挡。当第一次封装时,签名人会暴露出来,但可以在不移除封装的情况下验证签名。这在需要自动签名验证的环境中非常有用,因为验证签名不需要私钥材料。

There are security ramifications to choosing whether to sign first or encrypt first. A recipient of a message that is encrypted and then signed can validate that the encrypted block was unaltered, but cannot determine any relationship between the signer and the unencrypted contents of the message. A recipient of a message that is signed-then-encrypted can assume that the signed message itself has not been altered, but that a careful attacker could have changed the unauthenticated portions of the encrypted message.

选择先签名还是先加密会带来安全问题。经过加密然后签名的邮件的收件人可以验证加密块是否未更改,但无法确定签名者与邮件未加密内容之间的任何关系。已签名然后加密的邮件的收件人可以假定已签名邮件本身未被更改,但细心的攻击者可能已更改加密邮件的未经验证部分。

When using compression, keep the following guidelines in mind:

使用压缩时,请记住以下准则:

- Compression of binary encoded encrypted data is discouraged, since it will not yield significant compression. Base64 encrypted data could very well benefit, however. - If a lossy compression algorithm is used with signing, you will need to compress first, then sign.

- 不鼓励压缩二进制编码的加密数据,因为它不会产生显著的压缩。然而,Base64加密数据可能会受益匪浅。-如果签名使用有损压缩算法,则需要先压缩,然后签名。

3.7. Creating a Certificate Management Message
3.7. 创建证书管理消息

The certificate management message or MIME entity is used to transport certificates and/or certificate revocation lists, such as in response to a registration request.

证书管理消息或MIME实体用于传输证书和/或证书吊销列表,例如响应注册请求。

Step 1. The certificates and/or certificate revocation lists are made available to the CMS generating process which creates a CMS object of type SignedData. The SignedData encapContentInfo eContent field MUST be absent and signerInfos field MUST be empty.

第一步。证书和/或证书撤销列表可用于创建SignedData类型CMS对象的CMS生成过程。SignedData encapContentInfo eContent字段必须不存在,signerInfos字段必须为空。

Step 2. The SignedData object is wrapped in a CMS ContentInfo object.

第二步。SignedData对象包装在CMS ContentInfo对象中。

Step 3. The ContentInfo object is enclosed in an application/pkcs7- mime MIME entity.

第三步。ContentInfo对象包含在application/pkcs7-mime mime实体中。

The smime-type parameter for a certificate management message is "certs-only". The file extension for this type of message is ".p7c".

证书管理消息的smime类型参数为“仅证书”。此类消息的文件扩展名为“.p7c”。

3.8. Registration Requests
3.8. 注册申请

A sending agent that signs messages MUST have a certificate for the signature so that a receiving agent can verify the signature. There are many ways of getting certificates, such as through an exchange with a certificate authority, through a hardware token or diskette, and so on.

对消息进行签名的发送代理必须具有签名证书,以便接收代理可以验证签名。有许多获取证书的方法,例如通过与证书颁发机构的交换、通过硬件令牌或软盘等。

S/MIME v2 [SMIMEV2] specified a method for "registering" public keys with certificate authorities using an application/pkcs10 body part. Since that time, the IETF PKIX Working Group has developed other methods for requesting certificates. However, S/MIME v3.1 does not require a particular certificate request mechanism.

S/MIME v2[SMIMEV2]指定了使用应用程序/pkcs10主体部分向证书颁发机构“注册”公钥的方法。从那时起,IETF PKIX工作组开发了其他请求证书的方法。但是,S/MIME v3.1不需要特定的证书请求机制。

3.9. Identifying an S/MIME Message
3.9. 识别S/MIME消息

Because S/MIME takes into account interoperation in non-MIME environments, several different mechanisms are employed to carry the type information, and it becomes a bit difficult to identify S/MIME messages. The following table lists criteria for determining whether or not a message is an S/MIME message. A message is considered an S/MIME message if it matches any of the criteria listed below.

由于S/MIME考虑了非MIME环境中的互操作,因此采用了几种不同的机制来承载类型信息,因此识别S/MIME消息变得有点困难。下表列出了确定消息是否为S/MIME消息的标准。如果消息符合下面列出的任何条件,则将其视为S/MIME消息。

The file suffix in the table below comes from the "name" parameter in the content-type header, or the "filename" parameter on the content-disposition header. These parameters that give the file suffix are not listed below as part of the parameter section.

下表中的文件后缀来自“内容类型”标题中的“名称”参数或“内容处置”标题中的“文件名”参数。下面未将这些提供文件后缀的参数作为参数部分列出。

MIME type: application/pkcs7-mime parameters: any file suffix: any

MIME类型:应用程序/pkcs7 MIME参数:任意文件后缀:任意

   MIME type:   multipart/signed
   parameters:  protocol="application/pkcs7-signature"
   file suffix: any
        
   MIME type:   multipart/signed
   parameters:  protocol="application/pkcs7-signature"
   file suffix: any
        

MIME type: application/octet-stream parameters: any file suffix: p7m, p7s, p7c, p7z

MIME类型:应用程序/八位字节流参数:任何文件后缀:p7m、p7s、p7c、p7z

4. Certificate Processing
4. 证书处理

A receiving agent MUST provide some certificate retrieval mechanism in order to gain access to certificates for recipients of digital envelopes. This specification does not cover how S/MIME agents handle certificates, only what they do after a certificate has been validated or rejected. S/MIME certificate issues are covered in [CERT31].

接收代理必须提供某种证书检索机制,以便为数字信封的收件人访问证书。本规范不涉及S/MIME代理如何处理证书,只涉及它们在证书被验证或拒绝后的操作。[CERT31]中介绍了S/MIME证书问题。

At a minimum, for initial S/MIME deployment, a user agent could automatically generate a message to an intended recipient requesting that recipient's certificate in a signed return message. Receiving and sending agents SHOULD also provide a mechanism to allow a user to "store and protect" certificates for correspondents in such a way so as to guarantee their later retrieval.

对于初始S/MIME部署,用户代理至少可以自动生成一条消息,发送给指定的收件人,在签名的返回消息中请求该收件人的证书。接收和发送代理还应提供一种机制,允许用户以这种方式“存储和保护”通信员的证书,以保证其以后的检索。

4.1. Key Pair Generation
4.1. 密钥对生成

All generated key pairs MUST be generated from a good source of non-deterministic random input [RANDOM] and the private key MUST be protected in a secure fashion.

所有生成的密钥对必须从非确定性随机输入[random]的良好来源生成,并且必须以安全方式保护私钥。

If an S/MIME agent needs to generate an RSA key pair, then the S/MIME agent or some related administrative utility or function SHOULD generate RSA key pairs using the following guidelines. A user agent SHOULD generate RSA key pairs at a minimum key size of 768 bits. A user agent MUST NOT generate RSA key pairs less than 512 bits long. Creating keys longer than 1024 bits can cause some older S/MIME receiving agents to not be able to verify signatures, but gives better security and is therefore valuable. A receiving agent SHOULD be able to verify signatures with keys of any size over 512 bits. Some agents created in the United States have chosen to create 512 bit keys in order to get more advantageous export licenses. However, 512 bit keys are considered by many to be cryptographically insecure. Implementers SHOULD be aware that multiple (active) key pairs can be associated with a single individual. For example, one key pair can be used to support confidentiality, while a different key pair can be used for authentication.

如果S/MIME代理需要生成RSA密钥对,则S/MIME代理或某些相关管理实用程序或函数应使用以下准则生成RSA密钥对。用户代理应生成最小密钥大小为768位的RSA密钥对。用户代理不能生成长度小于512位的RSA密钥对。创建长度超过1024位的密钥可能会导致一些较旧的S/MIME接收代理无法验证签名,但会提供更好的安全性,因此很有价值。接收代理应该能够使用超过512位的任意大小的密钥验证签名。在美国创建的一些代理选择创建512位密钥,以获得更有利的出口许可证。然而,许多人认为512位密钥在加密方面是不安全的。实现者应该知道,多个(活动)密钥对可以与单个个体相关联。例如,一个密钥对可用于支持机密性,而另一个密钥对可用于身份验证。

5. Security Considerations
5. 安全考虑

40-bit encryption is considered weak by most cryptographers. Using weak cryptography in S/MIME offers little actual security over sending plaintext. However, other features of S/MIME, such as the specification of tripleDES and the ability to announce stronger cryptographic capabilities to parties with whom you communicate, allow senders to create messages that use strong encryption. Using weak cryptography is never recommended unless the only alternative is

大多数密码学家认为40位加密很弱。在S/MIME中使用弱加密技术在发送明文时几乎没有实际的安全性。但是,S/MIME的其他功能,如三元组的规范和向与您通信的各方宣布更强加密功能的能力,允许发件人创建使用强加密的消息。除非唯一的选择是

no cryptography. When feasible, sending and receiving agents SHOULD inform senders and recipients of the relative cryptographic strength of messages.

没有密码。在可行的情况下,发送和接收代理应通知发送方和接收方消息的相对加密强度。

It is impossible for most software or people to estimate the value of a message. Further, it is impossible for most software or people to estimate the actual cost of decrypting a message that is encrypted with a key of a particular size. Further, it is quite difficult to determine the cost of a failed decryption if a recipient cannot decode a message. Thus, choosing between different key sizes (or choosing whether to just use plaintext) is also impossible. However, decisions based on these criteria are made all the time, and therefore this specification gives a framework for using those estimates in choosing algorithms.

对于大多数软件或人员来说,估计消息的价值是不可能的。此外,对于大多数软件或人员来说,不可能估计解密使用特定大小的密钥加密的消息的实际成本。此外,如果收件人无法解码消息,则很难确定解密失败的成本。因此,在不同的密钥大小之间进行选择(或者选择是否只使用明文)也是不可能的。然而,基于这些标准的决策一直在做出,因此本规范给出了在选择算法时使用这些估计值的框架。

If a sending agent is sending the same message using different strengths of cryptography, an attacker watching the communications channel might be able to determine the contents of the strongly-encrypted message by decrypting the weakly-encrypted version. In other words, a sender SHOULD NOT send a copy of a message using weaker cryptography than they would use for the original of the message.

如果发送代理使用不同的加密强度发送相同的消息,则监视通信通道的攻击者可能能够通过解密弱加密版本来确定强加密消息的内容。换句话说,发件人不应使用比原始邮件更弱的加密技术发送邮件副本。

Modification of the ciphertext can go undetected if authentication is not also used, which is the case when sending EnvelopedData without wrapping it in SignedData or enclosing SignedData within it.

如果不使用身份验证,密文的修改可能不会被检测到,这是在发送信封数据时没有将其包装在SignedData中或将SignedData封装在其中的情况。

See RFC 3218 [MMA] for more information about thwarting the adaptive chosen ciphertext vulnerability in PKCS #1 Version 1.5 implementations.

有关在PKCS#1 1.5版实现中阻止自适应选择密文漏洞的更多信息,请参阅RFC 3218[MMA]。

In some circumstances the use of the Diffie-Hellman key agreement scheme in a prime order subgroup of a large prime p is vulnerable to certain attacks known as "small-subgroup" attacks. Methods exist, however, to prevent these attacks. These methods are described in RFC 2785 [DHSUB].

在某些情况下,在大素数p的素数阶子群中使用Diffie-Hellman密钥协商方案容易受到某些称为“小子群”攻击的攻击。但是,存在防止这些攻击的方法。RFC 2785[DHSUB]中描述了这些方法。

A. ASN.1 Module

A.ASN.1模块

SecureMimeMessageV3dot1
  { iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-9(9) smime(16) modules(0) msg-v3dot1(21) }
        
SecureMimeMessageV3dot1
  { iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-9(9) smime(16) modules(0) msg-v3dot1(21) }
        
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
        
DEFINITIONS IMPLICIT TAGS ::=
BEGIN
        
IMPORTS
-- Cryptographic Message Syntax
    SubjectKeyIdentifier, IssuerAndSerialNumber,
    RecipientKeyIdentifier
        FROM    CryptographicMessageSyntax
               { iso(1) member-body(2) us(840) rsadsi(113549)
                 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) };
        
IMPORTS
-- Cryptographic Message Syntax
    SubjectKeyIdentifier, IssuerAndSerialNumber,
    RecipientKeyIdentifier
        FROM    CryptographicMessageSyntax
               { iso(1) member-body(2) us(840) rsadsi(113549)
                 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) };
        
--  id-aa is the arc with all new authenticated and unauthenticated
--  attributes produced the by S/MIME Working Group
        
--  id-aa is the arc with all new authenticated and unauthenticated
--  attributes produced the by S/MIME Working Group
        
id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
        rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)}
        
id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
        rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)}
        
-- S/MIME Capabilities provides a method of broadcasting the symmetric
-- capabilities understood.  Algorithms SHOULD be ordered by
-- preference and grouped by type
        
-- S/MIME Capabilities provides a method of broadcasting the symmetric
-- capabilities understood.  Algorithms SHOULD be ordered by
-- preference and grouped by type
        
smimeCapabilities OBJECT IDENTIFIER ::=
   {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15}
        
smimeCapabilities OBJECT IDENTIFIER ::=
   {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15}
        
SMIMECapability ::= SEQUENCE {
   capabilityID OBJECT IDENTIFIER,
   parameters ANY DEFINED BY capabilityID OPTIONAL }
        
SMIMECapability ::= SEQUENCE {
   capabilityID OBJECT IDENTIFIER,
   parameters ANY DEFINED BY capabilityID OPTIONAL }
        
SMIMECapabilities ::= SEQUENCE OF SMIMECapability
        
SMIMECapabilities ::= SEQUENCE OF SMIMECapability
        
-- Encryption Key Preference provides a method of broadcasting the
-- preferred encryption certificate.
        
-- Encryption Key Preference provides a method of broadcasting the
-- preferred encryption certificate.
        
id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11}
        
id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11}
        
SMIMEEncryptionKeyPreference ::= CHOICE {
   issuerAndSerialNumber   [0] IssuerAndSerialNumber,
   receipentKeyId          [1] RecipientKeyIdentifier,
   subjectAltKeyIdentifier [2] SubjectKeyIdentifier
}
        
SMIMEEncryptionKeyPreference ::= CHOICE {
   issuerAndSerialNumber   [0] IssuerAndSerialNumber,
   receipentKeyId          [1] RecipientKeyIdentifier,
   subjectAltKeyIdentifier [2] SubjectKeyIdentifier
}
        
id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
   us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 }
        
id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
   us(840) rsadsi(113549) pkcs(1) pkcs9(9) 16 }
        
id-cap  OBJECT IDENTIFIER ::= { id-smime 11 }
        
id-cap  OBJECT IDENTIFIER ::= { id-smime 11 }
        
-- The preferBinaryInside indicates an ability to receive messages
-- with binary encoding inside the CMS wrapper
        
-- The preferBinaryInside indicates an ability to receive messages
-- with binary encoding inside the CMS wrapper
        
id-cap-preferBinaryInside  OBJECT IDENTIFIER ::= { id-cap 1 }
        
id-cap-preferBinaryInside  OBJECT IDENTIFIER ::= { id-cap 1 }
        

-- The following list the OIDs to be used with S/MIME V3

--下面列出了与S/MIME V3一起使用的OID

-- Signature Algorithms Not Found in [CMSALG]
--
-- md2WithRSAEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
--     2}
--
-- Other Signed Attributes
--
-- signingTime OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
--     5}
--    See [CMS] for a description of how to encode the attribute
--    value.
        
-- Signature Algorithms Not Found in [CMSALG]
--
-- md2WithRSAEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
--     2}
--
-- Other Signed Attributes
--
-- signingTime OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
--     5}
--    See [CMS] for a description of how to encode the attribute
--    value.
        
SMIMECapabilitiesParametersForRC2CBC ::= INTEGER
--        (RC2 Key Length (number of bits))
        
SMIMECapabilitiesParametersForRC2CBC ::= INTEGER
--        (RC2 Key Length (number of bits))
        

END

终止

B. References

B.参考资料

B.1. Normative References
B.1. 规范性引用文件

[CERT31] Ramsdell, B., Ed., "S/MIME Version 3.1 Certificate Handling", RFC 3850, July 2004.

[CERT31]Ramsdell,B.,Ed.,“S/MIME版本3.1证书处理”,RFC3850,2004年7月。

   [CHARSETS]    Character sets assigned by IANA.  See
                 http://www.iana.org/assignments/character-sets
        
   [CHARSETS]    Character sets assigned by IANA.  See
                 http://www.iana.org/assignments/character-sets
        

[CMS] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3852, July 2004.

[CMS]Housley,R.,“加密消息语法(CMS)”,RFC 38522004年7月。

[CMSAES] Schaad, J., "Use of the Advanced Encryption Standard (AES) Encryption Algorithm in Cryptographic Message Syntax (CMS)", RFC 3565, July 2003.

[CMSAES]Schaad,J.“在加密消息语法(CMS)中使用高级加密标准(AES)加密算法”,RFC 3565,2003年7月。

[CMSALG] Housley, R., "Cryptographic Message Syntax (CMS) Algorithms", RFC 3370, August 2002.

[CMSALG]Housley,R.,“加密消息语法(CMS)算法”,RFC3370,2002年8月。

[CMSCOMPR] Gutmann, P., "Compressed Data Content Type for Cryptographic Message Syntax (CMS)", RFC 3274, June 2002.

[CMSCOMPR]Gutmann,P.,“加密消息语法(CMS)的压缩数据内容类型”,RFC 3274,2002年6月。

[CONTDISP] Troost, R., Dorner, S., and K. Moore, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field", RFC 2183, August 1997.

[CONTDISP]Troost,R.,Dorner,S.,和K.Moore,“在Internet消息中传递表示信息:内容处置头字段”,RFC 2183,1997年8月。

[ESS] Hoffman, P., "Enhanced Security Services for S/MIME", RFC 2634, June 1999.

[ESS]Hoffman,P.,“S/MIME的增强安全服务”,RFC 2634,1999年6月。

[FIPS180-2] "Secure Hash Signature Standard (SHS)", National Institute of Standards and Technology (NIST). FIPS Publication 180-2.

[FIPS180-2]“安全哈希签名标准(SHS)”,国家标准与技术研究所(NIST)。FIPS出版物180-2。

[MIME-SPEC] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.

[MIME-SPEC]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第一部分:Internet邮件正文格式”,RFC 20451996年11月。

Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996.

Freed,N.和N.Borenstein,“多用途互联网邮件扩展(MIME)第二部分:媒体类型”,RFC 20461996年11月。

Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text", RFC 2047, November 1996.

Moore,K.,“MIME(多用途互联网邮件扩展)第三部分:非ASCII文本的消息头扩展”,RFC 2047,1996年11月。

Freed, N., Klensin, J., and J. Postel, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 2048, November 1996.

Freed,N.,Klensin,J.,和J.Postel,“多用途互联网邮件扩展(MIME)第四部分:注册程序”,BCP 13,RFC 2048,1996年11月。

Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples", RFC 2049, November 1996.

Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第五部分:一致性标准和示例”,RFC 2049,1996年11月。

[MIME-SECURE] Galvin, J., Murphy, S., Crocker, S., and N. Freed, "Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", RFC 1847, October 1995.

[MIME-SECURE]Galvin,J.,Murphy,S.,Crocker,S.,和N.Freed,“MIME的安全多部分:多部分/签名和多部分/加密”,RFC 1847,1995年10月。

[MUSTSHOULD] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[MUSTSHOULD]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[X.208-88] CCITT. Recommendation X.208: Specification of Abstract Syntax Notation One (ASN.1). 1988.

[X.208-88]CCITT。建议X.208:抽象语法符号1(ASN.1)的规范。1988

[X.209-88] CCITT. Recommendation X.209: Specification of Basic Encoding Rules for Abstract Syntax Notation One (ASN.1). 1988.

[X.209-88]CCITT。建议X.209:抽象语法符号1(ASN.1)的基本编码规则规范。1988

[X.509-88] CCITT. Recommendation X.509: The Directory - Authentication Framework. 1988.

[X.509-88]CCITT。建议X.509:目录认证框架。1988

B.2. Informative References
B.2. 资料性引用

[DHSUB] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup" Attacks on the Diffie-Hellman Key Agreement Method for S/MIME", RFC 2785, March 2000.

[DHSUB]Zuccherato,R.,“避免针对S/MIME的Diffie-Hellman密钥协商方法的“小子组”攻击的方法”,RFC 27852000年3月。

[MMA] Rescorla, E., "Preventing the Million Message Attack on Cryptographic Message Syntax", RFC 3218, January 2002.

[MMA]Rescorla,E.“防止对加密消息语法的百万消息攻击”,RFC 3218,2002年1月。

[PKCS-7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315, March 1998.

[PKCS-7]Kaliski,B.,“PKCS#7:加密消息语法版本1.5”,RFC 2315,1998年3月。

[RANDOM] Eastlake 3rd, D., Crocker, S., and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994.

[RANDOM]Eastlake 3rd,D.,Crocker,S.,和J.Schiller,“安全的随机性建议”,RFC 1750,1994年12月。

[SMIMEV2] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and L. Repka, "S/MIME Version 2 Message Specification", RFC 2311, March 1998.

[SMIMEV2]Dusse,S.,Hoffman,P.,Ramsdell,B.,Lundblade,L.,和L.Repka,“S/MIME版本2消息规范”,RFC 23111998年3月。

C. Acknowledgements

C.致谢

Many thanks go out to the other authors of the S/MIME Version 2 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence Lundblade and Lisa Repka.

非常感谢S/MIME版本2消息规范RFC的其他作者:Steve Dusse、Paul Hoffman、Laurence Lundblade和Lisa Repka。

A number of the members of the S/MIME Working Group have also worked very hard and contributed to this document. Any list of people is doomed to omission, and for that I apologize. In alphabetical order, the following people stand out in my mind due to the fact that they made direct contributions to this document.

S/MIME工作组的一些成员也非常努力地工作,为本文件作出了贡献。任何人的名单都注定会被遗漏,对此我深表歉意。按字母顺序排列,以下人员在我心目中脱颖而出,因为他们对本文件作出了直接贡献。

Tony Capel Piers Chivers Dave Crocker Bill Flanigan Peter Gutmann Paul Hoffman Russ Housley William Ottaway John Pawling Jim Schaad

托尼·卡佩尔·皮尔斯·奇弗斯、戴夫·克罗克、比尔·弗拉尼根、彼得·古特曼、保罗·霍夫曼、罗斯、霍斯利、威廉·奥塔维、约翰·波林、吉姆·沙德

D. Editor's Address

D.编辑地址

Blake Ramsdell Sendmail, Inc. 704 228th Ave NE #775 Sammamish, WA 98074

Blake Ramsdell Sendmail,Inc.地址:华盛顿州Sammamish东北775号第228大道704号,邮编:98074

   EMail: blake@sendmail.com
        
   EMail: blake@sendmail.com
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (2004). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

版权所有(C)互联网协会(2004年)。本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件及其包含的信息是按“原样”提供的,贡献者、他/她所代表或赞助的组织(如有)、互联网协会和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Intellectual Property

知识产权

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.

IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.

Acknowledgement

确认

Funding for the RFC Editor function is currently provided by the Internet Society.

RFC编辑功能的资金目前由互联网协会提供。