home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / rfc / 3 / rfc2311.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  69.2 KB  |  2,076 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          S. Dusse
  8. Request for Comments: 2311                            RSA Data Security
  9. Category: Informational                                      P. Hoffman
  10.                                                Internet Mail Consortium
  11.                                                             B. Ramsdell
  12.                                                               Worldtalk
  13.                                                            L. Lundblade
  14.                                                                Qualcomm
  15.                                                                L. Repka
  16.                                                                Netscape
  17.                                                              March 1998
  18.  
  19.  
  20.                  S/MIME Version 2 Message Specification
  21.  
  22. Status of this Memo
  23.  
  24.    This memo provides information for the Internet community.  It does
  25.    not specify an Internet standard of any kind.  Distribution of this
  26.    memo is unlimited.
  27.  
  28. Copyright Notice
  29.  
  30.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  31.  
  32. 1. Introduction
  33.  
  34.    S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a
  35.    consistent way to send and receive secure MIME data. Based on the
  36.    popular Internet MIME standard, S/MIME provides the following
  37.    cryptographic security services for electronic messaging
  38.    applications: authentication, message integrity and non-repudiation
  39.    of origin (using digital signatures) and privacy and data security
  40.    (using encryption).
  41.  
  42.    S/MIME can be used by traditional mail user agents (MUAs) to add
  43.    cryptographic security services to mail that is sent, and to
  44.    interpret cryptographic security services in mail that is received.
  45.    However, S/MIME is not restricted to mail; it can be used with any
  46.    transport mechanism that transports MIME data, such as HTTP. As such,
  47.    S/MIME takes advantage of the object-based features of MIME and
  48.    allows secure messages to be exchanged in mixed-transport systems.
  49.  
  50.    Further, S/MIME can be used in automated message transfer agents that
  51.    use cryptographic security services that do not require any human
  52.    intervention, such as the signing of software-generated documents and
  53.    the encryption of FAX messages sent over the Internet.
  54.  
  55.  
  56.  
  57.  
  58. Dusse, et. al.               Informational                      [Page 1]
  59.  
  60. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  61.  
  62.  
  63.    Please note: The information in this document is historical material
  64.    being published for the public record. It is not an IETF standard.
  65.    The use of the word "standard" in this document indicates a standard
  66.    for adopters of S/MIME version 2, not an IETF standard.
  67.  
  68. 1.1 Specification Overview
  69.  
  70.    This document describes a protocol for adding cryptographic signature
  71.    and encryption services to MIME data. The MIME standard [MIME-SPEC]
  72.    provides a general structure for the content type of Internet
  73.    messages and allows extensions for new content type applications.
  74.  
  75.    This memo defines how to create a MIME body part that has been
  76.    cryptographically enhanced according to PKCS #7 [PKCS-7]. This memo
  77.    also defines the application/pkcs7-mime MIME type that can be used to
  78.    transport those body parts. This memo also defines how to create
  79.    certification requests that conform to PKCS #10 [PKCS-10], and the
  80.    application/pkcs10 MIME type for transporting those requests.
  81.  
  82.    This memo also discusses how to use the multipart/signed MIME type
  83.    defined in [MIME-SECURE] to transport S/MIME signed messages. This
  84.    memo also defines the application/pkcs7-signature MIME type, which is
  85.    also used to transport S/MIME signed messages. This specification is
  86.    compatible with PKCS #7 in that it uses the data types defined by
  87.    PKCS #7.
  88.  
  89.    In order to create S/MIME messages, an agent has to follow
  90.    specifications in this memo, as well as some of the specifications
  91.    listed in the following documents:
  92.  
  93.     - "PKCS #1: RSA Encryption", [PKCS-1]
  94.     - "PKCS #7: Cryptographic Message Syntax", [PKCS-7]
  95.     - "PKCS #10: Certification Request Syntax", [PKCS-10]
  96.  
  97.    Throughout this memo, there are requirements and recommendations made
  98.    for how receiving agents handle incoming messages. There are separate
  99.    requirements and recommendations for how sending agents create
  100.    outgoing messages. In general, the best strategy is to "be liberal in
  101.    what you receive and conservative in what you send". Most of the
  102.    requirements are placed on the handling of incoming messages while
  103.    the recommendations are mostly on the creation of outgoing messages.
  104.  
  105.    The separation for requirements on receiving agents and sending
  106.    agents also derives from the likelihood that there will be S/MIME
  107.    systems that involve software other than traditional Internet mail
  108.    clients. S/MIME can be used with any system that transports MIME
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Dusse, et. al.               Informational                      [Page 2]
  115.  
  116. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  117.  
  118.  
  119.    data. An automated process that sends an encrypted message might not
  120.    be able to receive an encrypted message at all, for example. Thus,
  121.    the requirements and recommendations for the two types of agents are
  122.    listed separately when appropriate.
  123.  
  124. 1.2 Terminology
  125.  
  126.    Throughout this memo, the terms MUST, MUST NOT, SHOULD, and SHOULD
  127.    NOT are used in capital letters. This conforms to the definitions in
  128.    [MUSTSHOULD].  [MUSTSHOULD] defines the use of these key words to
  129.    help make the intent of standards track documents as clear as
  130.    possible. The same key words are used in this document to help
  131.    implementors achieve interoperability.
  132.  
  133. 1.3 Definitions
  134.  
  135.    For the purposes of this memo, the following definitions apply.
  136.  
  137.    ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208.
  138.  
  139.    BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209.
  140.  
  141.    Certificate: A type that binds an entity's distinguished name to a
  142.    public key with a digital signature.
  143.  
  144.    DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT
  145.    X.509.
  146.  
  147.    7-bit data: Text data with lines less than 998 characters long, where
  148.    none of the characters have the 8th bit set, and there are no NULL
  149.    characters.  <CR> and <LF> occur only as part of a <CR><LF> end of
  150.    line delimiter.
  151.  
  152.    8-bit data: Text data with lines less than 998 characters, and where
  153.    none of the characters are NULL characters. <CR> and <LF> occur only
  154.    as part of a <CR><LF> end of line delimiter.
  155.  
  156.    Binary data: Arbitrary data.
  157.  
  158.    Transfer Encoding: A reversible transformation made on data so 8-bit
  159.    or binary data may be sent via a channel that only transmits 7-bit
  160.    data.
  161.  
  162. 1.4 Compatibility with Prior Practice of S/MIME
  163.  
  164.    Appendix C contains important information about how S/MIME agents
  165.    following this specification should act in order to have the greatest
  166.    interoperability with earlier implementations of S/MIME.
  167.  
  168.  
  169.  
  170. Dusse, et. al.               Informational                      [Page 3]
  171.  
  172. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  173.  
  174.  
  175. 2. PKCS #7 Options
  176.  
  177.    The PKCS #7 message format allows for a wide variety of options in
  178.    content and algorithm support. This section puts forth a number of
  179.    support requirements and recommendations in order to achieve a base
  180.    level of interoperability among all S/MIME implementations.
  181.  
  182. 2.1 DigestAlgorithmIdentifier
  183.  
  184.    Receiving agents MUST support SHA-1 [SHA1] and MD5 [MD5].
  185.  
  186.    Sending agents SHOULD use SHA-1.
  187.  
  188. 2.2 DigestEncryptionAlgorithmIdentifier
  189.  
  190.    Receiving agents MUST support rsaEncryption, defined in [PKCS-1].
  191.    Receiving agents MUST support verification of signatures using RSA
  192.    public key sizes from 512 bits to 1024 bits.
  193.  
  194.    Sending agents MUST support rsaEncryption. Outgoing messages are
  195.    signed with a user's private key. The size of the private key is
  196.    determined during key generation.
  197.  
  198. 2.3 KeyEncryptionAlgorithmIdentifier
  199.  
  200.    Receiving agents MUST support rsaEncryption. Incoming encrypted
  201.    messages contain symmetric keys which are to be decrypted with a
  202.    user's private key.  The size of the private key is determined during
  203.    key generation.
  204.  
  205.    Sending agents MUST support rsaEncryption. Sending agents MUST
  206.    support encryption of symmetric keys with RSA public keys at key
  207.    sizes from 512 bits to 1024 bits.
  208.  
  209. 2.4 General Syntax
  210.  
  211.    The PKCS #7 defines six distinct content types: "data", "signedData",
  212.    "envelopedData", "signedAndEnvelopedData", "digestedData", and
  213.    "encryptedData". Receiving agents MUST support the "data",
  214.    "signedData" and "envelopedData" content types. Sending agents may or
  215.    may not send out any of the content types, depending on the services
  216.    that the agent supports.
  217.  
  218. 2.4.1 Data Content Type
  219.  
  220.    Sending agents MUST use the "data" content type as the content within
  221.    other content types to indicate the message content which has had
  222.    security services applied to it.
  223.  
  224.  
  225.  
  226. Dusse, et. al.               Informational                      [Page 4]
  227.  
  228. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  229.  
  230.  
  231. 2.4.2 SignedData Content Type
  232.  
  233.    Sending agents MUST use the signedData content type to apply a
  234.    digital signature to a message or, in a degenerate case where there
  235.    is no signature information, to convey certificates.
  236.  
  237. 2.4.3 EnvelopedData Content Type
  238.  
  239.    This content type is used to apply privacy protection to a message. A
  240.    sender needs to have access to a public key for each intended message
  241.    recipient to use this service. This content type does not provide
  242.    authentication.
  243.  
  244. 2.5 Attribute SignerInfo Type
  245.  
  246.    The SignerInfo type allows the inclusion of unauthenticated and
  247.    authenticated attributes to be included along with a signature.
  248.  
  249.    Receiving agents MUST be able to handle zero or one instance of each
  250.    of the signed attributes described in this section.
  251.  
  252.    Sending agents SHOULD be able to generate one instance of each of the
  253.    signed attributes described in this section, and SHOULD include these
  254.    attributes in each signed message sent.
  255.  
  256.    Additional attributes and values for these attributes may be defined
  257.    in the future. Receiving agents SHOULD handle attributes or values
  258.    that it does not recognize in a graceful manner.
  259.  
  260. 2.5.1 Signing-Time Attribute
  261.  
  262.    The signing-time attribute is used to convey the time that a message
  263.    was signed. Until there are trusted timestamping services, the time
  264.    of signing will most likely be created by a message originator and
  265.    therefore is only as trustworthy as the originator.
  266.  
  267.    Sending agents MUST encode signing time through the year 2049 as
  268.    UTCTime; signing times in 2050 or later MUST be encoded as
  269.    GeneralizedTime. Agents MUST interpret the year field (YY) as
  270.    follows: if YY is greater than or equal to 50, the year is
  271.    interpreted as 19YY; if YY is less than 50, the year is interpreted
  272.    as 20YY.
  273.  
  274. 2.5.2 S/MIME Capabilities Attribute
  275.  
  276.    The S/MIME capabilities attribute includes signature algorithms (such
  277.    as "md5WithRSAEncryption"), symmetric algorithms (such as "DES-CBC"),
  278.    and key encipherment algorithms (such as "rsaEncryption"). It also
  279.  
  280.  
  281.  
  282. Dusse, et. al.               Informational                      [Page 5]
  283.  
  284. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  285.  
  286.  
  287.    includes a non-algorithm capability which is the preference for
  288.    signedData.  SMIMECapabilities was designed to be flexible and
  289.    extensible so that, in the future, a means of identifying other
  290.    capabilities and preferences such as certificates can be added in a
  291.    way that will not cause current clients to break.
  292.  
  293.    The semantics of the S/MIME capabilites attribute specify a partial
  294.    list as to what the client announcing the SMIMECapabilites can
  295.    support. A client does not have to list every capability it supports,
  296.    and probably should not list all its capabilities so that the
  297.    capabilities list doesn't get too long. In an SMIMECapabilities
  298.    encoding, the OIDs are listed in order of their preference, but
  299.    SHOULD be logically separated along the lines of their categories
  300.    (signature algorithms, symmetric algorithms, key encipherment
  301.    algorithms, etc.)
  302.  
  303.    The structure of  SMIMECapabilities was designed to facilitate simple
  304.    table lookups and binary comparisons in order to determine matches.
  305.    For instance, the DER-encoding for the SMIMECapability for DES EDE3
  306.    CBC MUST be identically encoded regardless of the implementation.
  307.  
  308.    In the case of symmetric algorithms, the associated parameters for
  309.    the OID MUST specify all of the parameters necessary to differentiate
  310.    between two instances of the same algorithm. For instance, the number
  311.    of rounds and block size for RC5 must be specified in addition to the
  312.    key length.
  313.  
  314.    There is a list of OIDs (the registered SMIMECapability list) that is
  315.    centrally maintained and is separate from this memo. The list of OIDs
  316.    is maintained by the Internet Mail Consortium at
  317.    <http://www.imc.org/ietf-smime/oids.html>.
  318.  
  319.    The OIDs that correspond to algorithms SHOULD use the same OID as the
  320.    actual algorithm, except in the case where the algorithm usage is
  321.    ambiguous from the OID. For instance, in an earlier memo,
  322.    rsaEncryption was ambiguous because it could refer to either a
  323.    signature algorithm or a key encipherment algorithm. In the event
  324.    that an OID is ambiguous, it needs to be arbitrated by the maintainer
  325.    of the registered S/MIME capabilities list as to which type of
  326.    algorithm will use the OID, and a new OID MUST be allocated under the
  327.    smimeCapabilities OID to satisfy the other use of the OID.
  328.  
  329.    The registered S/MIME capabilities list specifies the parameters for
  330.    OIDs that need them, most notably key lengths in the case of
  331.    variable-length symmetric ciphers. In the event that there are no
  332.    differentiating parameters for a particular OID, the parameters MUST
  333.    be omitted, and MUST NOT be encoded as NULL.
  334.  
  335.  
  336.  
  337.  
  338. Dusse, et. al.               Informational                      [Page 6]
  339.  
  340. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  341.  
  342.  
  343.    Additional values for SMIMECapability may be defined in the future.
  344.    Receiving agents MUST handle a SMIMECapabilities object that has
  345.    values that it does not recognize in a graceful manner.
  346.  
  347. 2.6 ContentEncryptionAlgorithmIdentifier
  348.  
  349.    Receiving agents MUST support decryption using the RC2 [RC2] or a
  350.    compatible algorithm at a key size of 40 bits, hereinafter called
  351.    "RC2/40".  Receiving agents SHOULD support decryption using DES EDE3
  352.    CBC, hereinafter called "tripleDES" [3DES] [DES].
  353.  
  354.    Sending agents SHOULD support encryption with RC2/40 and tripleDES.
  355.  
  356. 2.6.1 Deciding Which Encryption Method To Use
  357.  
  358.    When a sending agent creates an encrypted message, it has to decide
  359.    which type of encryption to use. The decision process involves using
  360.    information garnered from the capabilities lists included in messages
  361.    received from the recipient, as well as out-of-band information such
  362.    as private agreements, user preferences, legal restrictions, and so
  363.    on.
  364.  
  365.    Section 2.5 defines a method by which a sending agent can optionally
  366.    announce, among other things, its decrypting capabilities in its
  367.    order of preference. The following method for processing and
  368.    remembering the encryption capabilities attribute in incoming signed
  369.    messages SHOULD be used.
  370.  
  371.     - If the receiving agent has not yet created a list of capabilities
  372.       for the sender's public key, then, after verifying the signature
  373.       on the incoming message and checking the timestamp, the receiving
  374.       agent SHOULD create a new list containing at least the signing
  375.       time and the symmetric capabilities.
  376.  
  377.     - If such a list already exists, the receiving agent SHOULD verify
  378.       that the signing time in the incoming message is greater than the
  379.       signing time stored in the list and that the signature is valid.
  380.       If so, the receiving agent SHOULD update both the signing time and
  381.       capabilities in the list. Values of the signing time that lie far
  382.       in the future (that is, a greater discrepancy than any reasonable
  383.       clock skew), or a capabilitie lists in messages whose signature
  384.       could not be verified, MUST NOT be accepted.
  385.  
  386.    The list of capabilities SHOULD be stored for future use in creating
  387.    messages.
  388.  
  389.    Before sending a message, the sending agent MUST decide whether it is
  390.    willing to use weak encryption for the particular data in the
  391.  
  392.  
  393.  
  394. Dusse, et. al.               Informational                      [Page 7]
  395.  
  396. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  397.  
  398.  
  399.    message. If the sending agent decides that weak encryption is
  400.    unacceptable for this data, then the sending agent MUST NOT use a
  401.    weak algorithm such as RC2/40.  The decision to use or not use weak
  402.    encryption overrides any other decision in this section about which
  403.    encryption algorithm to use.
  404.  
  405.    Sections 2.6.2.1 through 2.6.2.4 describe the decisions a sending
  406.    agent SHOULD use in deciding which type of encryption should be
  407.    applied to a message. These rules are ordered, so the sending agent
  408.    SHOULD make its decision in the order given.
  409.  
  410. 2.6.2.1 Rule 1: Known Capabilities
  411.  
  412.    If the sending agent has received a set of capabilities from the
  413.    recipient for the message the agent is about to encrypt, then the
  414.    sending agent SHOULD use that information by selecting the first
  415.    capability in the list (that is, the capability most preferred by the
  416.    intended recipient) for which the sending agent knows how to encrypt.
  417.    The sending agent SHOULD use one of the capabilities in the list if
  418.    the agent reasonably expects the recipient to be able to decrypt the
  419.    message.
  420.  
  421. 2.6.2.2 Rule 2: Unknown Capabilities, Known Use of Encryption
  422.  
  423.    If:
  424.     - the sending agent has no knowledge of the encryption capabilities
  425.       of the recipient,
  426.     - and the sending agent has received at least one message from the
  427.       recipient,
  428.     - and the last encrypted message received from the recipient had a
  429.       trusted signature on it,
  430.    then the outgoing message SHOULD use the same encryption algorithm as
  431.    was used on the last signed and encrypted message received from the
  432.    recipient.
  433.  
  434. 2.6.2.3 Rule 3: Unknown Capabilities, Risk of Failed Decryption
  435.  
  436.    If:
  437.     - the sending agent has no knowledge of the encryption capabilities
  438.       of the recipient,
  439.     - and the sending agent is willing to risk that the recipient may
  440.       not be able to decrypt the message,
  441.    then the sending agent SHOULD use tripleDES.
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Dusse, et. al.               Informational                      [Page 8]
  451.  
  452. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  453.  
  454.  
  455. 2.6.2.4 Rule 4: Unknown Capabilities, No Risk of Failed Decryption
  456.  
  457.    If:
  458.     - the sending agent has no knowledge of the encryption capabilities
  459.       of the recipient,
  460.     - and the sending agent is not willing to risk that the recipient
  461.       may not be able to decrypt the message,
  462.    then the sending agent MUST use RC2/40.
  463.  
  464. 2.6.3 Choosing Weak Encryption
  465.  
  466.    Like all algorithms that use 40 bit keys, RC2/40 is considered by
  467.    many to be weak encryption. A sending agent that is controlled by a
  468.    human SHOULD allow a human sender to determine the risks of sending
  469.    data using RC2/40 or a similarly weak encryption algorithm before
  470.    sending the data, and possibly allow the human to use a stronger
  471.    encryption method such as tripleDES.
  472.  
  473. 2.6.4 Multiple Recipients
  474.  
  475.    If a sending agent is composing an encrypted message to a group of
  476.    recipients where the encryption capabilities of some of the
  477.    recipients do not overlap, the sending agent is forced to send more
  478.    than one message. It should be noted that if the sending agent
  479.    chooses to send a message encrypted with a strong algorithm, and then
  480.    send the same message encrypted with a weak algorithm, someone
  481.    watching the communications channel can decipher the contents of the
  482.    strongly-encrypted message simply by decrypting the weakly-encrypted
  483.    message.
  484.  
  485. 3. Creating S/MIME Messages
  486.  
  487.    This section describes the S/MIME message formats and how they are
  488.    created.  S/MIME messages are a combination of MIME bodies and PKCS
  489.    objects. Several MIME types as well as several PKCS objects are used.
  490.    The data to be secured is always a canonical MIME entity. The MIME
  491.    entity and other data, such as certificates and algorithm
  492.    identifiers, are given to PKCS processing facilities which produces a
  493.    PKCS object. The PKCS object is then finally wrapped in MIME.
  494.  
  495.    S/MIME provides one format for enveloped-only data, several formats
  496.    for signed-only data, and several formats for signed and enveloped
  497.    data.  Several formats are required to accommodate several
  498.    environments, in particular for signed messages. The criteria for
  499.    choosing among these formats are also described.
  500.  
  501.    The reader of this section is expected to understand MIME as
  502.    described in [MIME-SPEC] and [MIME-SECURE].
  503.  
  504.  
  505.  
  506. Dusse, et. al.               Informational                      [Page 9]
  507.  
  508. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  509.  
  510.  
  511. 3.1 Preparing the MIME Entity for Signing or Enveloping
  512.  
  513.    S/MIME is used to secure MIME entities. A MIME entity may be a sub-
  514.    part, sub-parts of a message, or the whole message with all its sub-
  515.    parts. A MIME entity that is the whole message includes only the MIME
  516.    headers and MIME body, and does not include the RFC-822 headers. Note
  517.    that S/MIME can also be used to secure MIME entities used in
  518.    applications other than Internet mail.
  519.  
  520.    The MIME entity that is secured and described in this section can be
  521.    thought of as the "inside" MIME entity. That is, it is the
  522.    "innermost" object in what is possibly a larger MIME message.
  523.    Processing "outside" MIME entities into PKCS #7 objects is described
  524.    in Section 3.2, 3.4 and elsewhere.
  525.  
  526.    The procedure for preparing a MIME entity is given in [MIME-SPEC].
  527.    The same procedure is used here with some additional restrictions
  528.    when signing.  Description of the procedures from [MIME-SPEC] are
  529.    repeated here, but the reader should refer to that document for the
  530.    exact procedure. This section also describes additional requirements.
  531.  
  532.    A single procedure is used for creating MIME entities that are to be
  533.    signed, enveloped, or both signed and enveloped. Some additional
  534.    steps are recommended to defend against known corruptions that can
  535.    occur during mail transport that are of particular importance for
  536.    clear-signing using the multipart/signed format. It is recommended
  537.    that these additional steps be performed on enveloped messages, or
  538.    signed and enveloped messages in order that the message can be
  539.    forwarded to any environment without modification.
  540.  
  541.    These steps are descriptive rather than prescriptive. The implementor
  542.    is free to use any procedure as long as the result is the same.
  543.  
  544.      Step 1. The MIME entity is prepared according to the local
  545.              conventions
  546.  
  547.      Step 2. The leaf parts of the MIME entity are converted to
  548.              canonical form
  549.  
  550.      Step 3. Appropriate transfer encoding is applied to the leaves of
  551.              the MIME entity
  552.  
  553.    When an S/MIME message is received, the security services on the
  554.    message are removed, and the result is the MIME entity. That MIME
  555.    entity is typically passed to a MIME-capable user agent where, it is
  556.    further decoded and presented to the user or receiving application.
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Dusse, et. al.               Informational                     [Page 10]
  563.  
  564. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  565.  
  566.  
  567. 3.1.1 Canonicalization
  568.  
  569.    Each MIME entity MUST be converted to a canonical form that is
  570.    uniquely and unambiguously representable in the environment where the
  571.    signature is created and the environment where the signature will be
  572.    verified. MIME entities MUST be canonicalized for enveloping as well
  573.    as signing.
  574.  
  575.    The exact details of canonicalization depend on the actual MIME type
  576.    and subtype of an entity, and are not described here. Instead, the
  577.    standard for the particular MIME type should be consulted. For
  578.    example, canonicalization of type text/plain is different from
  579.    canonicalization of audio/basic. Other than text types, most types
  580.    have only one representation regardless of computing platform or
  581.    environment which can be considered their canonical representation.
  582.    In general, canonicalization will be performed by the sending agent
  583.    rather than the S/MIME implementation.
  584.  
  585.    The most common and important canonicalization is for text, which is
  586.    often represented differently in different environments. MIME
  587.    entities of major type "text" must have both their line endings and
  588.    character set canonicalized. The line ending must be the pair of
  589.    characters <CR><LF>, and the charset should be a registered charset
  590.    [CHARSETS]. The details of the canonicalization are specified in
  591.    [MIME-SPEC]. The chosen charset SHOULD be named in the charset
  592.    parameter so that the receiving agent can unambiguously determine the
  593.    charset used.
  594.  
  595.    Note that some charsets such as ISO-2022 have multiple
  596.    representations for the same characters. When preparing such text for
  597.    signing, the canonical representation specified for the charset MUST
  598.    be used.
  599.  
  600. 3.1.2 Transfer Encoding
  601.  
  602.    When generating any of the secured MIME entities below, except the
  603.    signing using the multipart/signed format, no transfer encoding at
  604.    all is required.  S/MIME implementations MUST be able to deal with
  605.    binary MIME objects. If no Content-Transfer-Encoding header is
  606.    present, the transfer encoding should be considered 7BIT.
  607.  
  608.    S/MIME implementations SHOULD however use transfer encoding described
  609.    in section 3.1.3 for all MIME entities they secure. The reason for
  610.    securing only 7-bit MIME entities, even for enveloped data that are
  611.    not exposed to the transport, is that it allows the MIME entity to be
  612.    handled in any environment without changing it. For example, a
  613.    trusted gateway might remove the envelope, but not the signature, of
  614.    a message, and then forward the signed message on to the end
  615.  
  616.  
  617.  
  618. Dusse, et. al.               Informational                     [Page 11]
  619.  
  620. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  621.  
  622.  
  623.    recipient so that they can verify the signatures directly. If the
  624.    transport internal to the site is not 8-bit clean, such as on a
  625.    wide-area network with a single mail gateway, verifying the signature
  626.    will not be possible unless the original MIME entity was only 7-bit
  627.    data.
  628.  
  629. 3.1.3 Transfer Encoding for Signing Using multipart/signed
  630.  
  631.    If a multipart/signed entity is EVER to be transmitted over the
  632.    standard Internet SMTP infrastructure or other transport that is
  633.    constrained to 7-bit text, it MUST have transfer encoding applied so
  634.    that it is represented as 7-bit text. MIME entities that are 7-bit
  635.    data already need no transfer encoding. Entities such as 8-bit text
  636.    and binary data can be encoded with quoted-printable or base-64
  637.    transfer encoding.
  638.  
  639.    The primary reason for the 7-bit requirement is that the Internet
  640.    mail transport infrastructure cannot guarantee transport of 8-bit or
  641.    binary data. Even though many segments of the transport
  642.    infrastructure now handle 8-bit and even binary data, it is sometimes
  643.    not possible to know whether the transport path is 8-bit clear. If a
  644.    mail message with 8-bit data were to encounter a message transfer
  645.    agent that can not transmit 8-bit or binary data, the agent has three
  646.    options, none of which are acceptable for a clear-signed message:
  647.     - The agent could change the transfer encoding; this would
  648.       invalidate the signature.
  649.     - The agent could transmit the data anyway, which would most likely
  650.       result in the 8th bit being corrupted; this too would invalidate
  651.       the signature.
  652.     - The agent could return the message to the sender.
  653.  
  654.    [MIME-SECURE] prohibits an agent from changing the transfer encoding
  655.    of the first part of a multipart/signed message. If a compliant agent
  656.    that can not transmit 8-bit or binary data encounters a
  657.    multipart/signed message with 8-bit or binary data in the first part,
  658.    it would have to return the message to the sender as undeliverable.
  659.  
  660. 3.1.4 Sample Canonical MIME Entity
  661.  
  662.    This example shows a multipart/mixed message with full transfer
  663.    encoding.  This message contains a text part and an attachment. The
  664.    sample message text includes characters that are not US-ASCII and
  665.    thus must be transfer encoded. Though not shown here, the end of each
  666.    line is <CR><LF>. The line ending of the MIME headers, the text, and
  667.    transfer encoded parts, all must be <CR><LF>.
  668.  
  669.    Note that this example is not of an S/MIME message.
  670.  
  671.  
  672.  
  673.  
  674. Dusse, et. al.               Informational                     [Page 12]
  675.  
  676. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  677.  
  678.  
  679.        Content-Type: multipart/mixed; boundary=bar
  680.  
  681.        --bar
  682.        Content-Type: text/plain; charset=iso-8859-1
  683.        Content-Transfer-Encoding: quoted-printable
  684.  
  685.        =A1Hola Michael!
  686.  
  687.        How do you like the new S/MIME specification?
  688.  
  689.        I agree. It's generally a good idea to encode lines that begin with
  690.        From=20because some mail transport agents will insert a greater-
  691.        than (>) sign, thus invalidating the signature.
  692.  
  693.        Also, in some cases it might be desirable to encode any   =20
  694.        trailing whitespace that occurs on lines in order to ensure  =20
  695.        that the message signature is not invalidated when passing =20
  696.        a gateway that modifies such whitespace (like BITNET). =20
  697.  
  698.        --bar
  699.        Content-Type: image/jpeg
  700.        Content-Transfer-Encoding: base64
  701.  
  702.        iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
  703.        jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
  704.        uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
  705.        HOxEa44b+EI=
  706.  
  707.        --bar--
  708.  
  709. 3.2 The application/pkcs7-mime Type
  710.  
  711.    The application/pkcs7-mime type is used to carry PKCS #7 objects of
  712.    several types including envelopedData and signedData. The details of
  713.    constructing these entities is described in subsequent sections. This
  714.    section describes the general characteristics of the
  715.    application/pkcs7-mime type.
  716.  
  717.    This MIME type always carries a single PKCS #7 object. The PKCS #7
  718.    object must always be BER encoding of the ASN.1 syntax describing the
  719.    object. The contentInfo field of the carried PKCS #7 object always
  720.    contains a MIME entity that is prepared as described in section 3.1.
  721.    The contentInfo field must never be empty.
  722.  
  723.    Since PKCS #7 objects are binary data, in most cases base-64 transfer
  724.    encoding is appropriate, in particular when used with SMTP transport.
  725.    The transfer encoding used depends on the transport through which the
  726.    object is to be sent, and is not a characteristic of the MIME type.
  727.  
  728.  
  729.  
  730. Dusse, et. al.               Informational                     [Page 13]
  731.  
  732. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  733.  
  734.  
  735.    Note that this discussion refers to the transfer encoding of the PKCS
  736.    #7 object or "outside" MIME entity. It is completely distinct from,
  737.    and unrelated to, the transfer encoding of the MIME entity secured by
  738.    the PKCS #7 object, the "inside" object, which is described in
  739.    section 3.1.
  740.  
  741.    Because there are several types of application/pkcs7-mime objects, a
  742.    sending agent SHOULD do as much as possible to help a receiving agent
  743.    know about the contents of the object without forcing the receiving
  744.    agent to decode the ASN.1 for the object. The MIME headers of all
  745.    application/pkcs7-mime objects SHOULD include the optional "smime-
  746.    type" parameter, as described in the following sections.
  747.  
  748. 3.2.1 The name and filename Parameters
  749.  
  750.    For the application/pkcs7-mime, sending agents SHOULD emit the
  751.    optional "name" parameter to the Content-Type field for compatibility
  752.    with older systems. Sending agents SHOULD also emit the optional
  753.    Content-Disposition field [CONTDISP] with the "filename" parameter.
  754.    If a sending agent emits the above parameters, the value of the
  755.    parameters SHOULD be a file name with the appropriate extension:
  756.  
  757.    MIME Type                      File Extension
  758.  
  759.    application/pkcs7-mime              .p7m
  760.    (signedData, envelopedData)
  761.  
  762.    application/pkcs7-mime              .p7c
  763.    (degenerate signedData
  764.    "certs-only" message)
  765.  
  766.    application/pkcs7-signature         .p7s
  767.  
  768.    application/pkcs10                  .p10
  769.  
  770.    In addition, the file name SHOULD be limited to eight characters
  771.    followed by a three letter extension. The eight character filename
  772.    base can be any distinct name; the use of the filename base "smime"
  773.    SHOULD be used to indicate that the MIME entity is associated with
  774.    S/MIME.
  775.  
  776.    Including a file name serves two purposes. It facilitates easier use
  777.    of S/MIME objects as files on disk. It also can convey type
  778.    information across gateways. When a MIME entity of type
  779.    application/pkcs7-mime (for example) arrives at a gateway that has no
  780.    special knowledge of S/MIME, it will default the entity's MIME type
  781.    to application/octet-stream and treat it as a generic attachment,
  782.    thus losing the type information. However, the suggested filename for
  783.  
  784.  
  785.  
  786. Dusse, et. al.               Informational                     [Page 14]
  787.  
  788. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  789.  
  790.  
  791.    an attachment is often carried across a gateway.  This often allows
  792.    the receiving systems to determine the appropriate application to
  793.    hand the attachment off to, in this case a stand-alone S/MIME
  794.    processing application. Note that this mechanism is provided as a
  795.    convenience for implementations in certain environments. A proper
  796.    S/MIME implementation MUST use the MIME types and MUST NOT rely on
  797.    the file extensions.
  798.  
  799. 3.3 Creating an Enveloped-only Message
  800.  
  801.    This section describes the format for enveloping a MIME entity
  802.    without signing it.
  803.  
  804.      Step 1. The MIME entity to be enveloped is prepared according to
  805.              section 3.1.
  806.  
  807.      Step 2. The MIME entity and other required data is processed into a
  808.              PKCS #7 object of type envelopedData.
  809.  
  810.      Step 3. The PKCS #7 object is inserted into an application/pkcs7-
  811.              mime MIME entity.
  812.  
  813.    The smime-type parameter for enveloped-only messages is "enveloped-
  814.    data".  The file extension for this type of message is ".p7m".
  815.  
  816.    A sample message would be:
  817.  
  818.        Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
  819.             name=smime.p7m
  820.        Content-Transfer-Encoding: base64
  821.        Content-Disposition: attachment; filename=smime.p7m
  822.  
  823.        rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
  824.        7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
  825.        f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
  826.        0GhIGfHfQbnj756YT64V
  827.  
  828. 3.4 Creating a Signed-only Message
  829.  
  830.    There are two formats for signed messages defined for S/MIME:
  831.    application/pkcs7-mime and SignedData, and multipart/signed. In
  832.    general, the multipart/signed form is preferred for sending, and
  833.    receiving agents SHOULD be able to handle both.
  834.  
  835. 3.4.1 Choosing a Format for Signed-only Messages
  836.  
  837.    There are no hard-and-fast rules when a particular signed-only format
  838.    should be chosen because it depends on the capabilities of all the
  839.  
  840.  
  841.  
  842. Dusse, et. al.               Informational                     [Page 15]
  843.  
  844. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  845.  
  846.  
  847.    receivers and the relative importance of receivers with S/MIME
  848.    facilities being able to verify the signature versus the importance
  849.    of receivers without S/MIME software being able to view the message.
  850.  
  851.    Messages signed using the multipart/signed format can always be
  852.    viewed by the receiver whether they have S/MIME software or not. They
  853.    can also be viewed whether they are using a MIME-native user agent or
  854.    they have messages translated by a gateway. In this context, "be
  855.    viewed" means the ability to process the message essentially as if it
  856.    were not a signed message, including any other MIME structure the
  857.    message might have.
  858.  
  859.    Messages signed using the signedData format cannot be viewed by a
  860.    recipient unless they have S/MIME facilities. However, if they have
  861.    S/MIME facilities, these messages can always be verified if they were
  862.    not changed in transit.
  863.  
  864. 3.4.2 Signing Using application/pkcs7-mime and SignedData
  865.  
  866.    This signing format uses the application/pkcs7-mime MIME type. The
  867.    steps to create this format are:
  868.  
  869.      Step 1. The MIME entity is prepared according to section 3.1
  870.  
  871.      Step 2. The MIME entity and other required data is processed into a
  872.              PKCS #7 object of type signedData
  873.  
  874.      Step 3. The PKCS #7 object is inserted into an
  875.              application/pkcs7-mime MIME entity
  876.  
  877.    The smime-type parameter for messages using application/pkcs7-mime
  878.    and SignedData is "signed-data". The file extension for this type of
  879.    message is ".p7m".
  880.  
  881.    A sample message would be:
  882.  
  883.        Content-Type: application/pkcs7-mime; smime-type=signed-data;
  884.             name=smime.p7m
  885.        Content-Transfer-Encoding: base64
  886.        Content-Disposition: attachment; filename=smime.p7m
  887.  
  888.        567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7
  889.        77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH
  890.        HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh
  891.        6YT64V0GhIGfHfQbnj75
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Dusse, et. al.               Informational                     [Page 16]
  899.  
  900. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  901.  
  902.  
  903. 3.4.3 Signing Using the multipart/signed Format
  904.  
  905.    This format is a clear-signing format. Recipients without any S/MIME
  906.    or PKCS processing facilities are able to view the message. It makes
  907.    use of the multipart/signed MIME type described in [MIME-SECURE]. The
  908.    multipart/signed MIME type has two parts. The first part contains the
  909.    MIME entity that is to be signed; the second part contains the
  910.    signature, which is a PKCS #7 detached signature.
  911.  
  912. 3.4.3.1 The application/pkcs7-signature MIME Type
  913.  
  914.    This MIME type always contains a single PKCS #7 object of type
  915.    signedData.  The contentInfo field of the PKCS #7 object must be
  916.    empty. The signerInfos field contains the signatures for the MIME
  917.    entity. The details of the registered type are given in Appendix D.
  918.  
  919.    The file extension for signed-only messages using application/pkcs7-
  920.    signature  is ".p7s".
  921.  
  922. 3.4.3.2 Creating a multipart/signed Message
  923.  
  924.      Step 1. The MIME entity to be signed is prepared according to
  925.              section 3.1, taking special care for clear-signing.
  926.  
  927.      Step 2. The MIME entity is presented to PKCS #7 processing in order
  928.              to obtain an object of type signedData with an empty
  929.              contentInfo field.
  930.  
  931.      Step 3. The MIME entity is inserted into the first part of a
  932.              multipart/signed message with no processing other than that
  933.              described in section 3.1.
  934.  
  935.      Step 4. Transfer encoding is applied to the detached signature and
  936.              it is inserted into a MIME entity of type
  937.              application/pkcs7-signature
  938.  
  939.      Step 5. The MIME entity of the application/pkcs7-signature is
  940.              inserted into the second part of the multipart/signed
  941.              entity
  942.  
  943.    The multipart/signed Content type has two required parameters: the
  944.    protocol parameter and the micalg parameter.
  945.  
  946.    The protocol parameter MUST be "application/pkcs7-signature". Note
  947.    that quotation marks are required around the protocol parameter
  948.    because MIME requires that the "/" character in the parameter value
  949.    MUST be quoted.
  950.  
  951.  
  952.  
  953.  
  954. Dusse, et. al.               Informational                     [Page 17]
  955.  
  956. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  957.  
  958.  
  959.    The micalg parameter allows for one-pass processing when the
  960.    signature is being verified. The value of the micalg parameter is
  961.    dependent on the message digest algorithm used in the calculation of
  962.    the Message Integrity Check. The value of the micalg parameter SHOULD
  963.    be one of the following:
  964.  
  965.    Algorithm used     Value
  966.    --------------     ---------
  967.    MD5                md5
  968.    SHA-1              sha1
  969.    any other          unknown
  970.  
  971.    (Historical note: some early implementations of S/MIME emitted and
  972.    expected "rsa-md5" and "rsa-sha1" for the micalg parameter.)
  973.    Receiving agents SHOULD be able to recover gracefully from a micalg
  974.    parameter value that they do not recognize.
  975.  
  976. 3.4.3.3 Sample multipart/signed Message
  977.  
  978.        Content-Type: multipart/signed;
  979.           protocol="application/pkcs7-signature";
  980.           micalg=sha1; boundary=boundary42
  981.  
  982.        --boundary42
  983.        Content-Type: text/plain
  984.  
  985.        This is a clear-signed message.
  986.  
  987.        --boundary42
  988.        Content-Type: application/pkcs7-signature; name=smime.p7s
  989.        Content-Transfer-Encoding: base64
  990.        Content-Disposition: attachment; filename=smime.p7s
  991.  
  992.        ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6
  993.        4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj
  994.        n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
  995.        7GhIGfHfYT64VQbnj756
  996.  
  997.        --boundary42--
  998.  
  999. 3.5 Signing and Encrypting
  1000.  
  1001.    To achieve signing and enveloping, any of the signed-only and
  1002.    encrypted-only formats may be nested. This is allowed because the
  1003.    above formats are all MIME entities, and because they all secure MIME
  1004.    entities.
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Dusse, et. al.               Informational                     [Page 18]
  1011.  
  1012. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1013.  
  1014.  
  1015.    An S/MIME implementation MUST be able to receive and process
  1016.    arbitrarily nested S/MIME within reasonable resource limits of the
  1017.    recipient computer.
  1018.  
  1019.    It is possible to either sign a message first, or to envelope the
  1020.    message first. It is up to the implementor and the user to choose.
  1021.    When signing first, the signatories are then securely obscured by the
  1022.    enveloping. When enveloping first the signatories are exposed, but it
  1023.    is possible to verify signatures without removing the enveloping.
  1024.    This may be useful in an environment were automatic signature
  1025.    verification is desired, as no private key material is required to
  1026.    verify a signature.
  1027.  
  1028. 3.6 Creating a Certificates-only Message
  1029.  
  1030.    The certificates only message or MIME entity is used to transport
  1031.    certificates, such as in response to a registration request. This
  1032.    format can also be used to convey CRLs.
  1033.  
  1034.      Step 1. The certificates are made available to the PKCS #7
  1035.              generating process which creates a PKCS #7 object of type
  1036.              signedData.  The contentInfo and signerInfos fields must be
  1037.              empty.
  1038.  
  1039.      Step 2. The PKCS #7 signedData object is enclosed in an
  1040.              application/pkcs7-mime MIME entity
  1041.  
  1042.    The smime-type parameter for a certs-only message is "certs-only".
  1043.    The file extension for this type of message is ".p7c".
  1044.  
  1045. 3.7 Creating a Registration Request
  1046.  
  1047.    A typical application which allows a user to generate cryptographic
  1048.    information has to submit that information to a certification
  1049.    authority, who transforms it into a certificate. PKCS #10 describes a
  1050.    syntax for certification requests. The application/pkcs10 body type
  1051.    MUST be used to transfer a PKCS #10 certification request.
  1052.  
  1053.    The details of certification requests and the process of obtaining a
  1054.    certificate are beyond the scope of this memo. Instead, only the
  1055.    format of data used in application/pkcs10 is defined.
  1056.  
  1057. 3.7.1 Format of the application/pkcs10 Body
  1058.  
  1059.    PKCS #10 defines the ASN.1 type CertificationRequest for use in
  1060.    submitting a certification request. Therefore, when the MIME content
  1061.    type application/pkcs10 is used, the body MUST be a
  1062.    CertificationRequest, encoded using the Basic Encoding Rules (BER).
  1063.  
  1064.  
  1065.  
  1066. Dusse, et. al.               Informational                     [Page 19]
  1067.  
  1068. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1069.  
  1070.  
  1071.    Although BER is specified, instead of the more restrictive DER, a
  1072.    typical application will use DER since the CertificationRequest's
  1073.    CertificationRequestInfo has to be DER-encoded in order to be signed.
  1074.    A robust application SHOULD output DER, but allow BER or DER on
  1075.    input.
  1076.  
  1077.    Data produced by BER or DER is 8-bit, but many transports are limited
  1078.    to 7-bit data. Therefore, a suitable 7-bit Content-Transfer-Encoding
  1079.    SHOULD be applied. The base64 Content-Transfer-Encoding SHOULD be
  1080.    used with application/pkcs10, although any 7-bit transfer encoding
  1081.    may work.
  1082.  
  1083. 3.7.2 Sending and Receiving an application/pkcs10 Body Part
  1084.  
  1085.    For sending a certificate-signing request, the application/pkcs10
  1086.    message format MUST be used to convey a PKCS #10 certificate-signing
  1087.    request. Note that for sending certificates and CRLs messages without
  1088.    any signed content, the application/pkcs7-mime message format MUST be
  1089.    used to convey a degenerate PKCS #7 signedData "certs-only" message.
  1090.  
  1091.    To send an application/pkcs10 body, the application generates the
  1092.    cryptographic information for the user. The details of the
  1093.    cryptographic information are beyond the scope of this memo.
  1094.  
  1095.      Step 1. The cryptographic information is placed within a PKCS #10
  1096.              CertificationRequest.
  1097.  
  1098.      Step 2. The CertificationRequest is encoded according to BER or DER
  1099.              (typically, DER).
  1100.  
  1101.      Step 3. As a typical step, the DER-encoded CertificationRequest is
  1102.              also base64 encoded so that it is 7-bit data suitable for
  1103.              transfer in SMTP. This then becomes the body of an
  1104.              application/pkcs10 body part.
  1105.  
  1106.    The result might look like this:
  1107.  
  1108.        Content-Type: application/pkcs10; name=smime.p10
  1109.        Content-Transfer-Encoding: base64
  1110.        Content-Disposition: attachment; filename=smime.p10
  1111.  
  1112.        rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
  1113.        7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
  1114.        f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
  1115.        0GhIGfHfQbnj756YT64V
  1116.  
  1117.    A typical application only needs to send a certification request. It
  1118.    is a certification authority that has to receive and process the
  1119.  
  1120.  
  1121.  
  1122. Dusse, et. al.               Informational                     [Page 20]
  1123.  
  1124. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1125.  
  1126.  
  1127.    request. The steps for recovering the CertificationRequest from the
  1128.    message are straightforward but are not presented here. The
  1129.    procedures for processing the certification request are beyond the
  1130.    scope of this document.
  1131.  
  1132. 3.8 Identifying an S/MIME Message
  1133.  
  1134.    Because S/MIME takes into account interoperation in non-MIME
  1135.    environments, several different mechanisms are employed to carry the
  1136.    type information, and it becomes a bit difficult to identify S/MIME
  1137.    messages. The following table lists criteria for determining whether
  1138.    or not a message is an S/MIME message. A message is considered an
  1139.    S/MIME message if it matches any below.
  1140.  
  1141.    The file suffix in the table below comes from the "name" parameter in
  1142.    the content-type header, or the "filename" parameter on the content-
  1143.    disposition header. These parameters that give the file suffix are
  1144.    not listed below as part of the parameter section.
  1145.  
  1146.    MIME type:   application/pkcs7-mime
  1147.    parameters:  any
  1148.    file suffix: any
  1149.  
  1150.    MIME type:   application/pkcs10
  1151.    parameters:  any
  1152.    file suffix: any
  1153.  
  1154.    MIME type:   multipart/signed
  1155.    parameters:  protocol="application/pkcs7-signature"
  1156.    file suffix: any
  1157.  
  1158.    MIME type:   application/octet-stream
  1159.    parameters:  any
  1160.    file suffix: p7m, p7s, aps, p7c, p10
  1161.  
  1162. 4. Certificate Processing
  1163.  
  1164.    A receiving agent MUST provide some certificate retrieval mechanism
  1165.    in order to gain access to certificates for recipients of digital
  1166.    envelopes.  This memo does not cover how S/MIME agents handle
  1167.    certificates, only what they do after a certificate has been
  1168.    validated or rejected. S/MIME certification issues are covered in a
  1169.    different document.
  1170.  
  1171.    At a minimum, for initial S/MIME deployment, a user agent could
  1172.    automatically generate a message to an intended recipient requesting
  1173.    that recipient's certificate in a signed return message. Receiving
  1174.    and sending agents SHOULD also provide a mechanism to allow a user to
  1175.  
  1176.  
  1177.  
  1178. Dusse, et. al.               Informational                     [Page 21]
  1179.  
  1180. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1181.  
  1182.  
  1183.    "store and protect" certificates for correspondents in such a way so
  1184.    as to guarantee their later retrieval.
  1185.  
  1186. 4.1 Key Pair Generation
  1187.  
  1188.    An S/MIME agent or some related administrative utility or function
  1189.    MUST be capable of generating RSA key pairs on behalf of the user.
  1190.    Each key pair MUST be generated from a good source of non-
  1191.    deterministic random input and protected in a secure fashion.
  1192.  
  1193.    A user agent SHOULD generate RSA key pairs at a minimum key size of
  1194.    768 bits and a maximum key size of 1024 bits. A user agent MUST NOT
  1195.    generate RSA key pairs less than 512 bits long. Some agents created
  1196.    in the United States have chosen to create 512 bit keys in order to
  1197.    get more advantageous export licenses. However, 512 bit keys are
  1198.    considered by many to be cryptographically insecure.
  1199.  
  1200.    Implementors should be aware that multiple (active) key pairs may be
  1201.    associated with a single individual. For example, one key pair may be
  1202.    used to support confidentiality, while a different key pair may be
  1203.    used for authentication.
  1204.  
  1205. 5. Security Considerations
  1206.  
  1207.    This entire memo discusses security. Security issues not covered in
  1208.    other parts of the memo include:
  1209.  
  1210.    40-bit encryption is considered weak by most cryptographers. Using
  1211.    weak cryptography in S/MIME offers little actual security over
  1212.    sending plaintext. However, other features of S/MIME, such as the
  1213.    specification of tripleDES and the ability to announce stronger
  1214.    cryptographic capabilities to parties with whom you communicate,
  1215.    allow senders to create messages that use strong encryption. Using
  1216.    weak cryptography is never recommended unless the only alternative is
  1217.    no cryptography. When feasible, sending and receiving agents should
  1218.    inform senders and recipients the relative cryptographic strength of
  1219.    messages.
  1220.  
  1221.    It is impossible for most software or people to estimate the value of
  1222.    a message. Further, it is impossible for most software or people to
  1223.    estimate the actual cost of decrypting a message that is encrypted
  1224.    with a key of a particular size. Further, it is quite difficult to
  1225.    determine the cost of a failed decryption if a recipient cannot
  1226.    decode a message. Thus, choosing between different key sizes (or
  1227.    choosing whether to just use plaintext) is also impossible. However,
  1228.    decisions based on these criteria are made all the time, and
  1229.    therefore this memo gives a framework for using those estimates in
  1230.    choosing algorithms.
  1231.  
  1232.  
  1233.  
  1234. Dusse, et. al.               Informational                     [Page 22]
  1235.  
  1236. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1237.  
  1238.  
  1239.    If a sending agent is sending the same message using different
  1240.    strengths of cryptography, an attacker watching the communications
  1241.    channel can determine the contents of the strongly-encrypted message
  1242.    by decrypting the weakly-encrypted version. In other words, a sender
  1243.    should not send a copy of a message using weaker cryptography than
  1244.    they would use for the original of the message.
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Dusse, et. al.               Informational                     [Page 23]
  1291.  
  1292. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1293.  
  1294.  
  1295. A. Object Identifiers and Syntax
  1296.  
  1297.    The syntax for SMIMECapability is:
  1298.  
  1299.    SMIMECapability ::= SEQUENCE {
  1300.        capabilityID OBJECT IDENTIFIER,
  1301.        parameters OPTIONAL ANY DEFINED BY capabilityID }
  1302.  
  1303.    SMIMECapabilities ::= SEQUENCE OF SMIMECapability
  1304.  
  1305. A.1 Content Encryption Algorithms
  1306.  
  1307. RC2-CBC OBJECT IDENTIFIER ::=
  1308.  {iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 2}
  1309.  
  1310. For the effective-key-bits (key size) greater than 32 and less than
  1311. 256, the RC2-CBC algorithm parameters are encoded as:
  1312.  
  1313. RC2-CBC parameter ::=  SEQUENCE {
  1314.  rc2ParameterVersion  INTEGER,
  1315.  iv                   OCTET STRING (8)}
  1316.  
  1317. For the effective-key-bits of 40, 64, and 128, the
  1318. rc2ParameterVersion values are 160, 120, 58 respectively.
  1319.  
  1320. DES-EDE3-CBC OBJECT IDENTIFIER ::=
  1321.  {iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 7}
  1322.  
  1323. For DES-CBC and DES-EDE3-CBC, the parameter should be encoded as:
  1324.  
  1325. CBCParameter :: IV
  1326.  
  1327. where IV ::= OCTET STRING -- 8 octets.
  1328.  
  1329. A.2 Digest Algorithms
  1330.  
  1331. md5 OBJECT IDENTIFIER ::=
  1332.  {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5}
  1333.  
  1334. sha-1 OBJECT IDENTIFIER ::=
  1335.  {iso(1) identified-organization(3) oiw(14) secsig(3) algorithm(2) 26}
  1336.  
  1337. A.3 Asymmetric Encryption Algorithms
  1338.  
  1339. rsaEncryption OBJECT IDENTIFIER ::=
  1340.  {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1}
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Dusse, et. al.               Informational                     [Page 24]
  1347.  
  1348. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1349.  
  1350.  
  1351. rsa OBJECT IDENTIFIER ::=
  1352.      {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1}
  1353.  
  1354. A.4 Signature Algorithms
  1355.  
  1356. md2WithRSAEncryption OBJECT IDENTIFIER ::=
  1357.      {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2}
  1358.  
  1359. md5WithRSAEncryption OBJECT IDENTIFIER ::=
  1360.      {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 4}
  1361.  
  1362. sha-1WithRSAEncryption OBJECT IDENTIFIER ::=
  1363.      {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5}
  1364.  
  1365. A.5 Signed Attributes
  1366.  
  1367. signingTime OBJECT IDENTIFIER ::=
  1368.      {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 5}
  1369.  
  1370. smimeCapabilities OBJECT IDENTIFIER ::=
  1371.     {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15}
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Dusse, et. al.               Informational                     [Page 25]
  1403.  
  1404. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1405.  
  1406.  
  1407. B. References
  1408.  
  1409.    [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES,"
  1410.    IEEE Spectrum, v. 16, n. 7, July 1979, pp40-41.
  1411.  
  1412.    [CHARSETS] Character sets assigned by IANA. See
  1413.    <ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets>.
  1414.  
  1415.    [CONTDISP] Troost, R., Dorner, S and K. Moore, "Communicating
  1416.    Presentation Information in Internet Messages:  The Content-
  1417.    Disposition Header Field", RFC 2183, August 1997.
  1418.  
  1419.    [DES] ANSI X3.106, "American National Standard for Information
  1420.    Systems-Data Link Encryption," American National Standards Institute,
  1421.    1983.
  1422.  
  1423.    [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, April
  1424.    1992.
  1425.  
  1426.    [MIME-SPEC] The primary definition of MIME.
  1427.  
  1428.    Freed, N., and N. Borenstein, "MIME Part 1: Format of Internet
  1429.    Message Bodies", RFC 2045, November 1996.
  1430.  
  1431.    Freed, N., and N. Borenstein, "MIME Part 2: Media Types", RFC 2046,
  1432.    November 1996.
  1433.  
  1434.    Moore, K., "MIME Part 3: Message Header Extensions for Non-ASCII
  1435.    Text", RFC 2047, November 1996.
  1436.  
  1437.    Freed, N., Klensin, J., and J. Postel, "MIME Part 4: Registration
  1438.    Procedures", RFC 2048, November 1996.
  1439.  
  1440.    Freed, N., and N. Borenstein, "MIME Part 5: Conformance Criteria and
  1441.    Examples", RFC 2049, November 1996.
  1442.  
  1443.    [MIME-SECURE] Galvin, J., Murphy, S., Crocker, S., and N. Freed,
  1444.    "Security Multiparts for MIME: Multipart/Signed and
  1445.    Multipart/Encrypted", RFC 1847, October 1995.
  1446.  
  1447.    [MUSTSHOULD] Bradner, S., "Key words for use in RFCs to Indicate
  1448.    Requirement Levels", BCP 14, RFC 2119, March 1997.
  1449.  
  1450.    [PKCS-1] Kaliski, B., "PKCS #1: RSA Encryption Version 1.5", RFC
  1451.    2313, March 1998.
  1452.  
  1453.    [PKCS-7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax Version
  1454.    1.5", RFC 2315, March 1998.
  1455.  
  1456.  
  1457.  
  1458. Dusse, et. al.               Informational                     [Page 26]
  1459.  
  1460. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1461.  
  1462.  
  1463.    [PKCS-10] Kaliski, B., "PKCS #10: Certification Request Syntax
  1464.    Version 1.5", RFC 2314, March 1998.
  1465.  
  1466.    [RC2] Rivest, R., "Description of the RC2(r) Encryption Algorithm",
  1467.    RFC 2268, January 1998.
  1468.  
  1469.    [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National
  1470.    Institute of Standards and Technology, U.S. Department of Commerce,
  1471.    DRAFT, 31 May 1994.
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Dusse, et. al.               Informational                     [Page 27]
  1515.  
  1516. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1517.  
  1518.  
  1519. C. Compatibility with Prior Practice in S/MIME
  1520.  
  1521.    S/MIME was originally developed by RSA Data Security, Inc. Many
  1522.    developers implemented S/MIME agents before this document was
  1523.    published. All S/MIME receiving agents SHOULD make every attempt to
  1524.    interoperate with these earlier implementations of S/MIME.
  1525.  
  1526. C.1 Early MIME Types
  1527.  
  1528.    Some early implementations of S/MIME agents used the following MIME
  1529.    types:
  1530.  
  1531.    application/x-pkcs7-mime
  1532.    application/x-pkcs7-signature
  1533.    application/x-pkcs10
  1534.  
  1535.    In each case, the "x-" subtypes correspond to the subtypes described
  1536.    in this document without the "x-".
  1537.  
  1538. C.2 Profiles
  1539.  
  1540.    Early S/MIME documentation had two profiles for encryption:
  1541.    "restricted" and "unrestricted". The difference between these
  1542.    profiles historically came about due to US Government export
  1543.    regulations, as described at the end of this section. It is expected
  1544.    that in the future, there will be few agents that only use the
  1545.    restricted profile.
  1546.  
  1547.    Briefly, the restricted profile required the ability to encrypt and
  1548.    decrypt using RSA's trade-secret RC2 algorithm in CBC mode with 40-
  1549.    bit keys. The unrestricted profile required the ability to encrypt
  1550.    and decrypt using RSA's trade-secret RC2 algorithm in CBC mode with
  1551.    40-bit keys, and to encrypt and decrypt using tripleDES. The
  1552.    restricted profile also had non-mandatory suggestions for other
  1553.    algorithms, but these were not widely implemented.
  1554.  
  1555.    It is important to note that many current implementations of S/MIME
  1556.    use the restricted profile.
  1557.  
  1558. C.2.1 Historical Reasons for the Existence of Two Encryption Profiles
  1559.  
  1560.    Due to US Government export regulations, an S/MIME agent which
  1561.    supports a strong content encryption algorithm such as DES would not
  1562.    be freely exportable outside of North America. US software
  1563.    manufacturers have been compelled to incorporate an exportable or
  1564.    "restricted" content encryption algorithm in order to create a widely
  1565.    exportable version of their product.  S/MIME agents created in the US
  1566.    and intended for US domestic use (or use under special State
  1567.  
  1568.  
  1569.  
  1570. Dusse, et. al.               Informational                     [Page 28]
  1571.  
  1572. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1573.  
  1574.  
  1575.    Department export licenses) can utilize stronger, "unrestricted"
  1576.    content encryption. However, in order to achieve interoperability,
  1577.    such agents need to support whatever exportable algorithm is
  1578.    incorporated in restricted S/MIME agents.
  1579.  
  1580.    The RC2 symmetric encryption algorithm has been approved by the US
  1581.    Government for "expedited" export licensing at certain key sizes.
  1582.    Consequently, support for the RC2 algorithm in CBC mode is required
  1583.    for baseline interoperability in all S/MIME implementations. Support
  1584.    for other strong symmetric encryption algorithms such as RC5 CBC, DES
  1585.    CBC and DES EDE3-CBC for content encryption is strongly encouraged
  1586.    where possible.
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Dusse, et. al.               Informational                     [Page 29]
  1627.  
  1628. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1629.  
  1630.  
  1631. D. Request for New MIME Subtypes
  1632.  
  1633. D.1 application/pkcs7-mime
  1634.  
  1635.    To: ietf-types@iana.org
  1636.    Subject: Registration of MIME media type application/pkcs7-mime
  1637.  
  1638.    MIME media type name: application
  1639.  
  1640.    MIME subtype name: pkcs7-mime
  1641.  
  1642.    Required parameters: none
  1643.  
  1644.    Optional parameters: name, filename, smime-type
  1645.  
  1646.    Encoding considerations: Will be binary data, therefore should use
  1647.    base64 encoding
  1648.  
  1649.    Security considerations: Described in [PKCS-7]
  1650.  
  1651.    Interoperability considerations: Designed to carry data formatted
  1652.    with PKCS-7, as described in [PKCS-7]
  1653.  
  1654.    Published specification: RFC 2311
  1655.  
  1656.    Applications which use this media type: Secure Internet mail and
  1657.    other secure data transports.
  1658.  
  1659.    Additional information:
  1660.    File extension(s): .p7m and .p7c
  1661.    Macintosh File Type Code(s):
  1662.  
  1663.    Person & email address to contact for further information:
  1664.    Steve Dusse, spock@rsa.com
  1665.  
  1666.    Intended usage: COMMON
  1667.  
  1668. D.2 application/pkcs7-signature
  1669.  
  1670.    To: ietf-types@iana.org
  1671.    Subject: Registration of MIME media type application/pkcs7-signature
  1672.  
  1673.    MIME media type name: application
  1674.  
  1675.    MIME subtype name: pkcs7-signature
  1676.  
  1677.    Required parameters: none
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Dusse, et. al.               Informational                     [Page 30]
  1683.  
  1684. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1685.  
  1686.  
  1687.    Optional parameters: name, filename
  1688.  
  1689.    Encoding considerations: Will be binary data, therefore should use
  1690.    base64 encoding
  1691.  
  1692.    Security considerations: Described in [PKCS-7]
  1693.  
  1694.    Interoperability considerations: Designed to carry digital
  1695.    signatures with PKCS-7, as described in [PKCS-7]
  1696.  
  1697.    Published specification: RFC 2311
  1698.  
  1699.    Applications which use this media type: Secure Internet mail and
  1700.    other secure data transports.
  1701.  
  1702.    Additional information:
  1703.    File extension(s): .p7s
  1704.    Macintosh File Type Code(s):
  1705.  
  1706.    Person & email address to contact for further information:
  1707.    Steve Dusse, spock@rsa.com
  1708.  
  1709.    Intended usage: COMMON
  1710.  
  1711. D.3 application/pkcs10
  1712.  
  1713.    To: ietf-types@iana.org
  1714.    Subject: Registration of MIME media type application/pkcs10
  1715.  
  1716.    MIME media type name: application
  1717.  
  1718.    MIME subtype name: pkcs10
  1719.  
  1720.    Required parameters: none
  1721.  
  1722.    Optional parameters: name, filename
  1723.  
  1724.    Encoding considerations: Will be binary data, therefore should use
  1725.    base64 encoding
  1726.  
  1727.    Security considerations: Described in [PKCS-10]
  1728.  
  1729.    Interoperability considerations: Designed to carry digital
  1730.    certificates formatted with PKCS-10, as described in [PKCS-10]
  1731.  
  1732.    Published specification: RFC 2311
  1733.  
  1734.    Applications which use this media type: Secure Internet mail and
  1735.  
  1736.  
  1737.  
  1738. Dusse, et. al.               Informational                     [Page 31]
  1739.  
  1740. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1741.  
  1742.  
  1743.    other transports where certificates are required.
  1744.  
  1745.    Additional information:
  1746.    File extension(s): .p10
  1747.    Macintosh File Type Code(s):
  1748.  
  1749.    Person & email address to contact for further information:
  1750.    Steve Dusse, spock@rsa.com
  1751.  
  1752.    Intended usage: COMMON
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Dusse, et. al.               Informational                     [Page 32]
  1795.  
  1796. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1797.  
  1798.  
  1799. E. Encapsulating Signed Messages for Internet Transport
  1800.  
  1801.    The rationale behind the multiple formats for signing has to do with
  1802.    the MIME subtype defaulting rules of the application and multipart
  1803.    top-level types, and the behavior of currently deployed gateways and
  1804.    mail user agents.
  1805.  
  1806.    Ideally, the multipart/signed format would be the only format used
  1807.    because it provides a truly backwards compatible way to sign MIME
  1808.    entities. In a pure MIME environment with very capable user agents,
  1809.    this would be possible. The world, however, is more complex than
  1810.    this.
  1811.  
  1812.    One problem with the multipart/signed format occurs with gateways to
  1813.    non-MIME environments. In these environments, the gateway will
  1814.    generally not be S/MIME aware, will not recognize the
  1815.    multipart/signed type, and will default its treatment to
  1816.    multipart/mixed as is prescribed by the MIME standard. The real
  1817.    problem occurs when the gateway also applies conversions to the MIME
  1818.    structure of the original message that is being signed and is
  1819.    contained in the first part of the multipart/signed structure, such
  1820.    as the gateway converting text and attachments to the local format.
  1821.    Because the signature is over the MIME structure of the original
  1822.    message, but the original message is now decomposed and transformed,
  1823.    the signature cannot be verified. Because MIME encoding of a
  1824.    particular set of body parts can be done in many different ways,
  1825.    there is no way to reconstruct the original MIME entity over which
  1826.    the signature was computed.
  1827.  
  1828.    A similar problem occurs when an attempt is made to combine an
  1829.    existing user agent with a stand-alone S/MIME facility. Typical user
  1830.    agents do not have the ability to make a multipart sub-entity
  1831.    available to a stand-alone application in the same way they make leaf
  1832.    MIME entities available to "viewer" applications. This user agent
  1833.    behavior is not required by the MIME standard and thus not widely
  1834.    implemented. The result is that it is impossible for most user agents
  1835.    to hand off the entire multipart/signed entity to a stand-alone
  1836.    application.
  1837.  
  1838. E.1 Solutions to the Problem
  1839.  
  1840.    To work around these two problems, the application/pkcs7-mime type
  1841.    can be used. When going through a gateway, it will be defaulted to
  1842.    the MIME type of application/octet-stream and treated as a single
  1843.    opaque entity. That is, the message will be treated as an attachment
  1844.    of unknown type, converted into the local representation for an
  1845.    attachment and thus can be made available to an S/MIME facility
  1846.    completely intact. A similar result is achieved when a user agent
  1847.  
  1848.  
  1849.  
  1850. Dusse, et. al.               Informational                     [Page 33]
  1851.  
  1852. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1853.  
  1854.  
  1855.    similarly treats the application/pkcs7-mime MIME entity as a simple
  1856.    leaf node of the MIME structure and makes it available to viewer
  1857.    applications.
  1858.  
  1859.    Another way to work around these problems is to encapsulate the
  1860.    multipart/signed MIME entity in a MIME entity that will not be
  1861.    damaged by the gateway. At the time that this memo is being written,
  1862.    there is a proposal for a MIME entity "application/mime" for this
  1863.    purpose. However, no implementations of S/MIME use this type of
  1864.    wrapping.
  1865.  
  1866. E.2 Encapsulation in an Non-MIME Environment
  1867.  
  1868.    While this document primarily addresses the Internet, it is useful to
  1869.    compose and receive S/MIME secured messages in non-MIME environments.
  1870.    This is particularly the case when it is desired that security be
  1871.    implemented end-to-end. Other discussion here addresses the receipt
  1872.    of S/MIME messages in non-MIME environments. Here the composition of
  1873.    multipart/signed entities is addressed.
  1874.  
  1875.    When a message is to be sent in such an environment, the
  1876.    multipart/signed entity is created as described above. That entity is
  1877.    then treated as an opaque stream of bits and added to the message as
  1878.    an attachment. It must have a file name that ends with ".aps", as
  1879.    this is the sole mechanism for recognizing it as an S/MIME message by
  1880.    the receiving agent.
  1881.  
  1882.    When this message arrives in a MIME environment, it is likely to have
  1883.    a MIME type of application/octet-stream, with MIME parameters giving
  1884.    the filename for the attachment. If the intervening gateway has
  1885.    carried the file type, it will end in ".aps" and be recognized as an
  1886.    S/MIME message.
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906. Dusse, et. al.               Informational                     [Page 34]
  1907.  
  1908. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1909.  
  1910.  
  1911. F. Acknowledgements
  1912.  
  1913.    Significant contributions to the content of this memo were made by
  1914.    many people, including Jim Schaad, Jeff Thompson, and Jeff Weinstein.
  1915.  
  1916. G. Authors' Addresses
  1917.  
  1918.    Steve Dusse
  1919.    RSA Data Security, Inc.
  1920.    100 Marine Parkway, #500
  1921.    Redwood City, CA  94065  USA
  1922.  
  1923.    Phone: (415) 595-8782
  1924.    EMail: spock@rsa.com
  1925.  
  1926.  
  1927.    Paul Hoffman
  1928.    Internet Mail Consortium
  1929.    127 Segre Place
  1930.    Santa Cruz, CA  95060
  1931.  
  1932.    Phone: (408) 426-9827
  1933.    EMail: phoffman@imc.org
  1934.  
  1935.  
  1936.    Blake Ramsdell
  1937.    Worldtalk
  1938.    13122 NE 20th St., Suite C
  1939.    Bellevue, WA 98005
  1940.  
  1941.    Phone: (425) 882-8861
  1942.    EMail: blaker@deming.com
  1943.  
  1944.  
  1945.    Laurence Lundblade
  1946.    QUALCOMM Incorporated
  1947.    Eudora Division
  1948.    6455 Lusk Boulevard
  1949.    San Diego, California 92121-2779
  1950.  
  1951.    Phone: (800) 238-3672
  1952.    EMail: lgl@qualcomm.com
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962. Dusse, et. al.               Informational                     [Page 35]
  1963.  
  1964. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  1965.  
  1966.  
  1967.    Lisa Repka
  1968.    Netscape Communications Corporation
  1969.    501 East Middlefield Road
  1970.    Mountain View, CA  94043
  1971.  
  1972.    Phone: (415) 254-1900
  1973.    EMail: repka@netscape.com
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Dusse, et. al.               Informational                     [Page 36]
  2019.  
  2020. RFC 2311         S/MIME Version 2 Message Specification       March 1998
  2021.  
  2022.  
  2023. H.  Full Copyright Statement
  2024.  
  2025.    Copyright (C) The Internet Society (1998).  All Rights Reserved.
  2026.  
  2027.    This document and translations of it may be copied and furnished to
  2028.    others, and derivative works that comment on or otherwise explain it
  2029.    or assist in its implementation may be prepared, copied, published
  2030.    and distributed, in whole or in part, without restriction of any
  2031.    kind, provided that the above copyright notice and this paragraph are
  2032.    included on all such copies and derivative works.  However, this
  2033.    document itself may not be modified in any way, such as by removing
  2034.    the copyright notice or references to the Internet Society or other
  2035.    Internet organizations, except as needed for the purpose of
  2036.    developing Internet standards in which case the procedures for
  2037.    copyrights defined in the Internet Standards process must be
  2038.    followed, or as required to translate it into languages other than
  2039.    English.
  2040.  
  2041.    The limited permissions granted above are perpetual and will not be
  2042.    revoked by the Internet Society or its successors or assigns.
  2043.  
  2044.    This document and the information contained herein is provided on an
  2045.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  2046.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  2047.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  2048.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  2049.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Dusse, et. al.               Informational                     [Page 37]
  2075.  
  2076.