Internet-Draft | JMAP extension for S/MIME | November 2023 |
Melnikov | Expires 19 May 2024 | [Page] |
This document specifies an extension to JMAP for sending S/MIME signed and/or S/MIME encrypted messages, as well as automatic decryption of received S/MIME messages.¶
[[This version presents an alternative syntax to revision 04 of https://datatracker.ietf.org/doc/draft-ietf-jmap-smime-sender-extensions/]]¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 19 May 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
[RFC8621] is a JSON based application protocol for synchronising email data between a client and a server.¶
This document describes an extension to JMAP for sending S/MIME signed and/or encrypted messages, as well as automatic decryption of received S/MIME messages. It allows JMAP server to sign/encrypt messages on user's behalf.¶
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 [RFC2119].¶
The capabilities object is returned as part of the standard JMAP Session object; see the JMAP spec. Servers supporting _this_ specification MUST add a property called "urn:ietf:params:jmap:smime-advanced" to the capabilities object.¶
The value of this property is an empty object in both the JMAP session _capabilities_ property and an account's _accountCapabilities_ property.¶
[RFC8621] defines Email/set method for creating new email messages. This document defines the following additional Email/set argument that can be used to create S/MIME signed and/or encrypted messages:¶
smimeOperations: SmimeOperation[]|null (default: null). The list of S/MIME operations to perform, in the order specified. If none are specified, or if this property is omitted, no S/MIME operation is performed. If multiple messages are specified in the "create" argument, these operations apply to each of them.¶
The SmimeOperation object contains the following attributes:¶
operation: "String". S/MIME operation to perform. This document only defines 2 possible values: "sign" and "encrypt". Future documents might add further values.¶
options: "SignOptions"|"EncryptOptions"|null (default: null). Options controlling aspects of S/MIME signing or S/MIME encryption. If this attributes includes SignOptions when the operation attribute has the value "encrypt" or if this attributes includes EncryptOptions when the operation attribute has the value "sign", then JMAP server ignores content of this attribute. [[Or should we define a new error code instead?]]¶
The SignOptions object contains the following attributes:¶
algorithm: "String"|null (default: null). The value represents the signature algorithm that the JMAP server should use to sign this message. If the algorithm is unspecified, this property is omitted, or an unrecognized algorithm string is specified, the JMAP server chooses the most appropriate algorithm to use. [[Alternatively make this an error and define a new error code.]] Currently specified algorithms are "ecdsa_secp256r1_sha256", "ed25519", "rsa_pkcs1_sha256", "rsa_pss_pss_sha256". [[Alexey: probably need to define a new IANA registry or reference an existing one.]]¶
opaque: "Boolean" (default: true). If the value is "true", this requests the JMAP server to use application/pkcs7-mime [RFC8551] media type for S/MIME signing, otherwise multipart/signed [RFC1847] media type.¶
headersToProtect: "String[]"|"all"|"none"|null (default: null). The list of header fields which should be protected by the smimeOperations specified. If the value is "all", all header fields of the original message should be protected. If the value is "none", no header fields should be protected. If the value is null, or if this property is omitted, the set of header fields to be protected is left up to the JMAP server.¶
The EncryptOptions object contains the following attributes:¶
keyEncryptionAlgorithm: "String"|null (default: null). The value represents the key encryption algorithm that the JMAP server should use when encrypting this message. If the algorithm is unspecified, this property is omitted, or an unrecognized algorithm string is specified, the JMAP server chooses the most appropriate algorithm to use. [[Need a new IANA registry or a link to an existing one here.]]¶
contentEncryptionAlgorithm: "String"|null (default: null). The value represents the data encryption algorithm that the JMAP server should use when encrypting this message. If the algorithm is unspecified, this property is omitted, or an unrecognized algorithm string is specified, the JMAP server chooses the most appropriate algorithm to use. [[Need a new IANA registry or a link to an existing one here.]]¶
[[For the following attribute: is this the right object or should it be moved to SignOptions (or even directly into the Email/set)? Logically it is related to encryption. But the result of this attribute is going to be in the inner S/MIME signed object.]]¶
headersToObscure: "String[String]"|"none"|null (default: null). If smimeOperations contains an "encrypt" operation, this specifies the list of header fields to obscure, as well as their obscured representation (see [draft-ietf-lamps-header-protection]). If the value is the string "none", no header field should be obscured. If the value is null, or if this property is omitted, the set of header fields to be protected is left up to the JMAP server. If any header fields are explicitly specified in this attribute, the headersToProtect attribute of the SignOptions object MUST also contain that header field, or be set to "none" or null.¶
When the operation attribute value is "sign", JMAP server constructs the S/MIME signed message from the original message (if this is the first operation) or the result of the previous operation, taking into considerations the SignOptions object (if present) or its defaults. The signature's private key/certificate is associated with the email address in the Sender header field, if present; otherwise, it is associated with the email address in the From header field, if present. If multiple addresses are present in one of these header fields, or there is more than one Sender/From header field, the server SHOULD reject the Email/set as invalid with the "invalidEmail" error code; otherwise, it MUST take the first address in the last Sender/From header field. If JMAP account is not authorized to sign message as the selected sender (as above), it SHOULD return "signedSenderNotAllowed" error code.¶
When the operation is "encrypt", JMAP server constructs the S/MIME encrypted message from the original message (if this is the first operation) or the result of the previous operation, taking into considerations the EncryptOptions object (if present) or its defaults. This is done by encapsulating the message inside application/pkcs7-mime [RFC8551] media type. The message MUST be encrypted to the sender and all To/Cc/Bcc recipients. This extension assumes that there is some kind of per user or organizational addressbook, that can be used to lookup public keys of recipients. If lookup of a particular public key fails, or results in an expired or revoked certificate, the Email/set operation MUST fail with the "validEncryptionKeyNotFound" error code.¶
(Note that this extension doesn't allow management of private keys/certificates. How private keys are managed or configured for a particular user is out of scope for this document.)¶
[RFC8621] defines Email/get method for retrieving information about email messages. This document defines the following additional request arguments of the "bodyProperties" object that can be used to facilitate decryption of S/MIME encrypted messages:¶
smimeBlobId: "Id|null". The id representing the raw octets of the decrypted contents of the part. When processing this request argument, the server first removes the Content-Transfer-Encoding (see then "blobId" request argument in RFC 8621). If the Content-Transfer-Encoding is supported by the server, the content is then S/MIME decrypted. The resulting Id can be used in Email/parse method to import the decrypted message. If the body part is not encrypted, the returned smimeBlobId attribute has the same value as the "blobId" attribute.¶
[[Extend Email/get with isSigned and isEncrypted Boolean server set properties?]]¶
[RFC8621] defines Email/query method for searching for email messages. This document defines the following additional request arguments to the *FilterCondition* object that can be used to search for S/MIME encrypted messages:¶
isEncrypted: "Boolean" (default: false)¶
If isEncrypted is true, then an Email matches this condition if its top level body part has content type "application/pkcs7-mime" with smime-type parameter that has the case-insensitive value "enveloped-data" or "authEnveloped-data". [[Alexey: Do we want to limit this to S/MIME encryption and not OpenPGP?]]¶
isNotEncrypted: "Boolean" (default: false)¶
If isNotEncrypted is true, then an Email matches this condition if its top level body part has any content type other than "application/pkcs7-mime", or its top level body part has content type "application/pkcs7-mime" but the smime-type parameter has the case-insensitive value other than "enveloped-data" or "authEnveloped-data". [[Alexey: what if smime-type is absent? It is defined as optional! Shall we make compliant server implementations test the inner CMS structure type?]]¶
isSigned: "Boolean" (default: false)¶
If isSigned is true, then an Email matches this condition if it satisfies one of the following conditions:¶
the top level body part has content type "application/pkcs7-mime" with "smime-type" parameter that has the case-insensitive value "signed-data".¶
the top level body part has content type "multipart/signed" with the "protocol" parameter set to case-insensitive value "application/pkcs7-signature".¶
[[Alexey: Do we want to limit this to S/MIME signing and not OpenPGP?]]¶
isNotSigned: "Boolean" (default: false)¶
If isNotSigned is true, then an Email matches this condition if its top level body part has any content type other than "application/pkcs7-mime" or "multipart/signed", or its top level body part has content type "application/pkcs7-mime" but the "smime-type" parameter has the case-insensitive value other than "signed-data". [[Alexey: what if smime-type is absent? It is defined as optional! Shall we make compliant server implementations test the inner CMS structure type?]]¶
IANA is requested to register the "smime" JMAP Capability as follows:¶
Capability Name: "urn:ietf:params:jmap:smime-advanced"¶
Specification document: this document¶
Intended use: common¶
Change Controller: IETF¶
Security and privacy considerations: this document, Section 7¶
JMAP Error Code: signedSenderNotAllowed¶
Intended use: common¶
Change controller: IETF¶
Reference: This document, Section 4¶
Description: JMAP account is not authorized to S/MIME sign message as the specified sender.¶
JMAP Error Code: validEncryptionKeyNotFound¶
Intended use: common¶
Change controller: IETF¶
Reference: This document, Section 4¶
Description: S/MIME encrypted message can't be generated because no valid certificate (non expired and non revoked) can be found for one of recipients.¶
This JMAP extension assumes trust between the user and the JMAP server for purposes of signing and encrypting messages on user's behalf.¶
This JMAP extension also relies on access to user's (or organization's) addressbook which contain up-to-date certificates for recipients.¶
This JMAP extension doesn't support management of user's private keys and corresponding certificates.¶
Thank you to Phillip Tao for suggestions, comments and corrections on this document.¶