Request for Comments: 4130 Cyclone Commerce
Category: Standards Track R. Drummond
Drummond Group Inc.
July 2005
MIME-Based Secure Peer-to-Peer
Business Data Interchange Using HTTP,
Applicability Statement 2 (AS2)
Status of This Memo
This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2005).
Abstract
This document provides an applicability statement (RFC 2026, Section
3.2) that describes how to exchange structured business data securely
using the HTTP transfer protocol, instead of SMTP; the applicability
statement for SMTP is found in RFC 3335. Structured business data
may be XML; Electronic Data Interchange (EDI) in either the American
National Standards Committee (ANSI) X12 format or the UN Electronic
Data Interchange for Administration, Commerce, and Transport
(UN/EDIFACT) format; or other structured data formats. The data is
packaged using standard MIME structures. Authentication and data
confidentiality are obtained by using Cryptographic Message Syntax
with S/MIME security body parts. Authenticated acknowledgements make
use of multipart/signed Message Disposition Notification (MDN)
responses to the original HTTP message. This applicability statement
is informally referred to as "AS2" because it is the second
applicability statement, produced after "AS1", RFC 3335.
Table of Contents
1. Introduction ....................................................3
1.1. Applicable RFCs ............................................3
1.2. Terms ......................................................3
2. Overview ........................................................5
2.1. Overall Operation ..........................................5
2.2. Purpose of a Security Guideline for MIME EDI ...............5
2.3. Definitions ................................................5
2.4. Assumptions ................................................7
3. Referenced RFCs and Their Contributions .........................9
3.1. RFC 2616 HTTP v1.1 [3] .....................................9
3.2. RFC 1847 MIME Security Multiparts [6] ......................9
3.3. RFC 3462 Multipart/Report [8] .............................10
3.4. RFC 1767 EDI Content [2] ..................................10
3.5. RFC 2045, 2046, and 2049 MIME [1] .........................10
3.6. RFC 3798 Message Disposition Notification [5] .............10
3.7. RFC 3851 and 3852 S/MIME Version 3.1 Message
Specifications and Cryptographic Message Syntax (CMS) [7]..10
3.8. RFC 3023 XML Media Types [10] .............................10
4. Structure of an AS2 Message ....................................10
4.1. Introduction ..............................................10
4.2. Structure of an Internet EDI MIME Message .................11
5. HTTP Considerations ............................................12
5.1. Sending EDI in HTTP POST Requests .........................12
5.2. Unused MIME Headers and Operations ........................12
5.3. Modification of MIME or Other Headers or Parameters Used ..13
5.4. HTTP Response Status Codes ................................14
5.5. HTTP Error Recovery .......................................14
6. Additional AS2-Specific HTTP Headers ...........................14
6.1. AS2 Version Header ........................................15
6.2. AS2 System Identifiers ....................................15
7. Structure and Processing of an MDN Message .....................17
7.1. Introduction ..............................................17
7.2. Synchronous and Asynchronous MDNs .........................19
7.3. Requesting a Signed Receipt ...............................21
7.4. MDN Format and Values .....................................25
7.5. Disposition Mode, Type, and Modifier ......................30
7.6. Receipt Reply Considerations in an HTTP POST ..............35
8. Public Key Certificate Handling ................................35
9. Security Considerations ........................................36
9.1. NRR Cautions ..............................................37
9.2. HTTPS Remark ..............................................38
9.3. Replay Remark .............................................39
10. IANA Considerations ...........................................39
10.1. Registration ............................................39
11. Acknowledgements ..............................................40
12. References ....................................................40
12.1. Normative References ....................................40
12.2. Informative References ..................................41
Appendix A: Message Examples ......................................42
1. Introduction
1.1. Applicable RFCs
Previous work on Internet EDI focused on specifying MIME content
types for EDI data [2] and extending this work to support secure
EC/EDI transport over SMTP [4]. This document expands on RFC 1767 to
specify a comprehensive set of data security features, specifically
data confidentiality, data integrity/authenticity, non-repudiation of
origin, and non-repudiation of receipt over HTTP. This document also
recognizes contemporary RFCs and is attempting to "re-invent" as
little as possible. Although this document focuses on EDI data, any
other data types describable in a MIME format are also supported.
Internet MIME-based EDI can be accomplished by using and complying
with the following RFCs:
o RFC 2616 Hyper Text Transfer Protocol
o RFC 1767 EDI Content Type
o RFC 3023 XML Media Types
o RFC 1847 Security Multiparts for MIME
o RFC 3462 Multipart/Report
o RFC 2045 to 2049 MIME RFCs
o RFC 3798 Message Disposition Notification
o RFC 3851, 3852 S/MIME v3.1 Specification
Our intent here is to define clearly and precisely how these are used
together, and what is required by user agents to be compliant with
this document.
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 RFC 2119 [13].
1.2. Terms
AS2: Applicability Statement 2 (this document); see RFC 2026
[11], Section 3.2
EDI: Electronic Data Interchange
EC: Business-to-Business Electronic Commerce
B2B: Business to Business
Receipt: The functional message that is sent from a receiver to a
sender to acknowledge receipt of an EDI/EC interchange.
This message may be either synchronous or asynchronous in
nature.
Signed Receipt: A receipt with a digital signature.
Synchronous Receipt: A receipt returned to the sender during the same
HTTP session as the sender’s original message.
Asynchronous Receipt: A receipt returned to the sender on a different
communication session than the sender’s original message
session.
Message Disposition Notification (MDN): The Internet messaging format
used to convey a receipt. This term is used interchangeably
with receipt. A MDN is a receipt.
Non-repudiation of receipt (NRR): A "legal event" that occurs when
the original sender of an signed EDI/EC interchange has
verified the signed receipt coming back from the receiver.
The receipt contains data identifying the original message
for which it is a receipt, including the message-ID and a
cryptographic hash (MIC). The original sender must retain
suitable records providing evidence concerning the message
content, its message-ID, and its hash value. The original
sender verifies that the retained hash value is the same as
the digest of the original message, as reported in the
signed receipt. NRR is not considered a technical message,
but instead is thought of as an outcome of possessing
relevant evidence.
S/MIME: A format and protocol for adding cryptographic signature
and/or encryption services to Internet MIME messages.
Cryptographic Message Syntax (CMS): An encapsulation syntax used to
digitally sign, digest, authenticate, or encrypt arbitrary
messages.
SHA-1: A secure, one-way hash algorithm used in conjunction with
digital signature. This is the recommended algorithm for
AS2.
MD5: A secure, one-way hash algorithm used in conjunction with
digital signature. This algorithm is allowed in AS2.
MIC: The message integrity check (MIC), also called the message
digest, is the digest output of the hash algorithm used by
the digital signature. The digital signature is computed
over the MIC.
User Agent (UA): The application that handles and processes the AS2
request.
2. Overview
2.1. Overall Operation
A HTTP POST operation [3] is used to send appropriately packaged EDI,
XML, or other business data. The Request-URI ([3], Section 9.5)
identifies a process for unpacking and handling the message data and
for generating a reply for the client that contains a message
disposition acknowledgement (MDN), either signed or unsigned. The
MDN is either returned in the HTTP response message body or by a new
HTTP POST operation to a URL for the original sender.
This request/reply transactional interchange can provide secure,
reliable, and authenticated transport for EDI or other business data
using HTTP as a transfer protocol.
The security protocols and structures used also support auditable
records of these document data transmissions, acknowledgements, and
authentication.
2.2. Purpose of a Security Guideline for MIME EDI
The purpose of these specifications is to ensure interoperability
between B2B EC user agents, invoking some or all of the commonly
expected security features. This document is also NOT limited to
strict EDI use; it applies to any electronic commerce application for
which business data needs to be exchanged over the Internet in a
secure manner.
2.3. Definitions
2.3.1. The Secure Transmission Loop
This document’s focus is on the formats and protocols for exchanging
EDI/EC content securely in the Internet’s HTTP environment.
In the "secure transmission loop" for EDI/EC, one organization sends
a signed and encrypted EDI/EC interchange to another organization and
requests a signed receipt, and later the receiving organization sends
this signed receipt back to the sending organization. In other
words, the following transpires:
o The organization sending EDI/EC data signs and encrypts the
data using S/MIME. In addition, the message will request that
a signed receipt be returned to the sender. To support NRR,
the original sender retains records of the message, message-ID,
and digest (MIC) value.
o The receiving organization decrypts the message and verifies
the signature, resulting in verified integrity of the data and
authenticity of the sender.
o The receiving organization then returns a signed receipt using
the HTTP reply body or a separate HTTP POST operation to the
sending organization in the form of a signed message
disposition notification. This signed receipt will contain the
hash of the received message, allowing the original sender to
have evidence that the received message was authenticated
and/or decrypted properly by the receiver.
The above describes functionality that, if implemented, will satisfy
all security requirements and implement non-repudiation of receipt
for the exchange. This specification, however, leaves full
flexibility for users to decide the degree to which they want to
deploy those security features with their trading partners.
2.3.2. Definition of Receipts
The term used for both the functional activity and the message for
acknowledging delivery of an EDI/EC interchange is "receipt" or
"signed receipt". The first term is used if the acknowledgment is
for an interchange resulting in a receipt that is NOT signed. The
second term is used if the acknowledgement is for an interchange
resulting in a receipt that IS signed.
The term non-repudiation of receipt (NRR) is often used in
combination with receipts. NRR refers to a legal event that occurs
only when the original sender of an interchange has verified the
signed receipt coming back from recipient of the message, and has
verified that the returned MIC value inside the MDN matches the
previously recorded value for the original message.
NRR is best established when both the original message and the
receipt make use of digital signatures. See the Security
Considerations section for some cautions regarding NRR.
For information on how to format and process receipts in AS2, refer
to Section 7.
2.4. Assumptions
2.4.1. EDI/EC Process Assumptions
o Encrypted object is an EDI/EC Interchange.
This specification assumes that a typical EDI/EC interchange is the
lowest-level object that will be subject to security services.
Specifically, in EDI ANSI X12, this means that anything between and
including, segments ISA and IEA is secured. In EDIFACT, this means
that anything between, and including, segments UNA/UNB and UNZ is
secured. In other words, the EDI/EC interchanges including envelope
segments remain intact and unreadable during fully secured transport.
o EDI envelope headers are encrypted.
Congruent with the above statement, EDI envelope headers are NOT
visible in the MIME package.
In order to optimize routing from existing commercial EDI networks
(called Value Added Networks or VANs) to the Internet, it would be
useful to make some envelope information visible. This
specification, however, provides no support for this optimization.
o X12.58 and UN/EDIFACT Security Considerations
The most common EDI standards bodies, ANSI X12 and EDIFACT, have
defined internal provisions for security. X12.58 is the security
mechanism for ANSI X12, and AUTACK provides security for EDIFACT.
This specification does NOT dictate use or non-use of these security
standards. They are both fully compatible, though possibly
redundant, with this specification.
2.4.2. Flexibility Assumptions
o Encrypted or Unencrypted Data
This specification allows for EDI/EC message exchange in which the
EDI/EC data can be either unprotected or protected by means of
encryption.
o Signed or Unsigned Data
This specification allows for EDI/EC message exchange with or without
digital signature of the original EDI transmission.
o Optional Use of Receipt
This specification allows for EDI/EC message transmission with or
without a request for receipt notification. A signed receipt
notification is requested; however, a MIC value is REQUIRED as part
of the returned receipt, except when a severe error condition
prevents computation of the digest value. In the exceptional case, a
signed receipt should be returned with an error message that
effectively explains why the MIC is absent.
o Use of Synchronous or Asynchronous Receipts
In addition to a receipt request, this specification allows the
specification of the type of receipt that should be returned. It
supports synchronous or asynchronous receipts in the MDN format
specified in Section 7 of this document.
o Security Formatting
This specification relies on the guidelines set forth in RFC
3851/3852 [7] "S/MIME Version 3.1 Message Specification;
Cryptographic Message Syntax".
o Hash Function, Message Digest Choices
When a signature is used, it is RECOMMENDED that the SHA-1 hash
algorithm be used for all outgoing messages, and that both MD5 and
SHA-1 be supported for incoming messages.
o Permutation Summary
In summary, the following twelve security permutations are possible
in any given trading relationship:
1. Sender sends un-encrypted data and does NOT request a receipt.
2. Sender sends un-encrypted data and requests an unsigned receipt.
Receiver sends back the unsigned receipt.
3. Sender sends un-encrypted data and requests a signed receipt.
Receiver sends back the signed receipt.
4. Sender sends encrypted data and does NOT request a receipt.
5. Sender sends encrypted data and requests an unsigned receipt.
Receiver sends back the unsigned receipt.
6. Sender sends encrypted data and requests a signed receipt.
Receiver sends back the signed receipt.
7. Sender sends signed data and does NOT request a signed or
unsigned receipt.
8. Sender sends signed data and requests an unsigned receipt.
Receiver sends back the unsigned receipt.
9. Sender sends signed data and requests a signed receipt.
Receiver sends back the signed receipt.
10. Sender sends encrypted and signed data and does NOT request a
signed or unsigned receipt.
11. Sender sends encrypted and signed data and requests an unsigned
receipt. Receiver sends back the unsigned receipt.
12. Sender sends encrypted and signed data and requests a signed
receipt. Receiver sends back the signed receipt.
Users can choose any of the twelve possibilities, but only the last
example (12), when a signed receipt is requested, offers the whole
suite of security features described in Section 2.3.1, "The Secure
Transmission Loop".
Additionally, the receipts discussed above may be either synchronous
or asynchronous depending on the type requested. The use of either
the synchronous or asynchronous receipts does not change the nature
of the secure transmission loop in support of NRR.
3. Referenced RFCs and Their Contributions
3.1. RFC 2616 HTTP v1.1 [3]
This document specifies how data is transferred using HTTP.
3.2. RFC 1847 MIME Security Multiparts [6]
This document defines security multipart for MIME:
multipart/encrypted and multipart/signed.
3.3. RFC 3462 Multipart/Report [8]
This RFC defines the use of the multipart/report content type,
something that the MDN RFC 3798 builds upon.
3.4. RFC 1767 EDI Content [2]
This RFC defines the use of content type "application" for ANSI X12
(application/EDI-X12), EDIFACT (application/EDIFACT), and mutually
defined EDI (application/EDI-Consent).
3.5. RFC 2045, 2046, and 2049 MIME [1]
These are the basic MIME standards, upon which all MIME related RFCs
build, including this one. Key contributions include definitions of
"content type", "sub-type", and "multipart", as well as encoding
guidelines, which establish 7-bit US-ASCII as the canonical character
set to be used in Internet messaging.
3.6. RFC 3798 Message Disposition Notification [5]
This Internet RFC defines how an MDN is requested, and the format and
syntax of the MDN. The MDN is the basis upon which receipts and
signed receipts are defined in this specification.
3.7. RFC 3851 and 3852 S/MIME Version 3.1 Message Specifications and
Cryptographic Message Syntax (CMS) [7]
This specification describes how S/MIME will carry CMS Objects.
3.8. RFC 3023 XML Media Types [10]
This RFC defines the use of content type "application" for XML
(application/xml).
4. Structure of an AS2 Message
4.1. Introduction
The basic structure of an AS2 message consists of MIME format inside
an HTTP message with a few additional specific AS2 headers. The
structures below are described hierarchically in terms of which RFCs
are applied to form the specific structure. For details of how to
code in compliance with all RFCs involved, turn directly to the RFCs
referenced. Any difference between AS2 implantations and RFCs are
mentioned specifically in the sections below.
4.2. Structure of an Internet EDI MIME Message
No encryption, no signature
-RFC2616/2045
-RFC1767/RFC3023 (application/EDIxxxx or /xml)
No encryption, signature
-RFC2616/2045
-RFC1847 (multipart/signed)
-RFC1767/RFC3023 (application/EDIxxxx or /xml)
-RFC3851 (application/pkcs7-signature)
Encryption, no signature
-RFC2616/2045
-RFC3851 (application/pkcs7-mime)
-RFC1767/RFC3023 (application/EDIxxxx or /xml)(encrypted)
Encryption, signature
-RFC2616/2045
-RFC3851 (application/pkcs7-mime)
-RFC1847 (multipart/signed)(encrypted)
-RFC1767/RFC3023 (application/EDIxxxx or /xml)(encrypted)
-RFC3851 (application/pkcs7-signature)(encrypted)
MDN over HTTP, no signature
-RFC2616/2045
-RFC3798 (message/disposition-notification)
MDN over HTTP, signature
-RFC2616/2045
-RFC1847 (multipart/signed)
-RFC3798 (message/disposition-notification)
-RFC3851 (application/pkcs7-signature)
MDN over SMTP, no signature
MDN over SMTP, signature
Refer to the EDI over SMTP standard [4].
Although all MIME content types SHOULD be supported, the following
MIME content types MUST be supported:
Content-type: multipart/signed
Content-Type: multipart/report
Content-type: message/disposition-notification
Content-Type: application/PKCS7-signature
Content-Type: application/PKCS7-mime
Content-Type: application/EDI-X12
Content-Type: application/EDIFACT
Content-Type: application/edi-consent
Content-Type: application/XML
5. HTTP Considerations
5.1. Sending EDI in HTTP POST Requests
The request line will have the form: "POST Request-URI HTTP/1.1",
with spaces and followed by a CRLF. The Request URI is typically
exchanged out of band, as part of setting up a bilateral trading
partner agreement. Applications SHOULD be prepared to deal with an
initial reply containing a status indicating a need for
authentication of the usual types used for authorizing access to the
Request-URI ([3], Section 10.4.2 and elsewhere).
The request line is followed by entity headers specifying content
length ([3], Section 14.14) and content type ([3], Section 14.18).
The Host request header ([3], Sections 9 and 14.23) is also included.
When using Transport Layer Security [15] or SSLv3, the request-URI
SHOULD indicate the appropriate scheme value, HTTPS. Usually only a
multipart/signed message body would be sent using TLS, as encrypted
message bodies would be redundant. However, encrypted message bodies
are not prohibited.
The receiving AS2 system MAY disconnect from the sending AS2 system
before completing the reception of the entire entity if it determines
that the entity being sent is too large to process.
For HTTP version 1.1, TCP persistent connections are the default,
([3] Sections 8.1.2, 8.2, and 19.7.1). A number of other differences
exist because HTTP does not conform to MIME [1] as used in SMTP
transport. Relevant differences are summarized below.