1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
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
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
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
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
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
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
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
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
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
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
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
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
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
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
|
Network Working Group D. Moberg
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.
Moberg & Drummond Standards Track [Page 1]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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
Moberg & Drummond Standards Track [Page 2]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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
Moberg & Drummond Standards Track [Page 3]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 4]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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
Moberg & Drummond Standards Track [Page 5]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 6]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 7]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 8]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 9]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
Moberg & Drummond Standards Track [Page 10]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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
Moberg & Drummond Standards Track [Page 11]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
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.
5.2. Unused MIME Headers and Operations
5.2.1. Content-Transfer-Encoding Not Used in HTTP Transport
HTTP can handle binary data and so there is no need to use the
content transfer encodings of MIME [1]. This difference is discussed
in [3], Section 19.4.5. However, a content transfer encoding value
of binary or 8-bit is permissible but not required. The absence of
this header MUST NOT result in transaction failure. Content transfer
encoding of MIME bodyparts within the AS2 message body is also
allowed.
Moberg & Drummond Standards Track [Page 12]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
5.2.2. Message Bodies
In [3], Section 3.7.2, it is explicitly noted that multiparts MUST
have null epilogues.
In [4], Section 5.4.1, options for large file processing are
discussed for SMTP transport. For HTTP, large files SHOULD be
handled correctly by the TCP layer. However, in [3], Sections 3.5
and 3.6 discuss some options for compressing or chunking entities to
be transferred. In [3], Section 8.1.2.2 discusses a pipelining
option that is useful for segmenting large amounts of data.
5.3. Modification of MIME or Other Headers or Parameters Used
5.3.1. Content-Length
The use of the content-length header MUST follow the guidelines of
[3], specifically Sections 4.4 and 14.13.
5.3.2. Final Recipient and Original Recipient
The final and original recipient values SHOULD be the same value.
These values MUST NOT be aliases or mailing lists.
5.3.3. Message-Id and Original-Message-Id
Message-Id and Original-Message-Id is formatted as defined in RFC
2822 [9]:
"<" id-left "@" id-right ">" (RFC 2822, 3.6.4)
Message-Id length is a maximum of 998 characters. For maximum
backward compatibility, Message-Id length SHOULD be 255 characters or
less. Message-Id SHOULD be globally unique, and id-right SHOULD be
something unique to the sending host environment (e.g., a host name).
When sending a message, always include the angle brackets. Angle
brackets are not part of the Message-Id value. For maximum backward
compatibility, when receiving a message, do not check for angle
brackets. When creating the Original-Message-Id header in an MDN,
always use the exact syntax as received on the original message;
don't strip or add angle brackets.
Moberg & Drummond Standards Track [Page 13]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
5.3.4. Host Header
The host request header field MUST be included in the POST request
made when sending business data. This field is intended to allow one
server IP address to service multiple hostnames, and potentially to
conserve IP addresses. See [3], Sections 14.23 and 19.5.1.
5.4. HTTP Response Status Codes
The status codes return status concerning HTTP operations. For
example, the status code 401, together with the WWW-Authenticate
header, is used to challenge the client to repeat the request with an
Authorization header. Other explicit status codes are documented in
[3], Section 6.1.1 and throughout Section 10.
For errors in the request-URI, 400 ("Bad Request"), 404 ("Not
Found"), and similar codes are appropriate status codes. These codes
and their semantics are specified by [3]. A careful examination of
these codes and their semantics should be made before implementing
any retry functionality. Retries SHOULD NOT be made if the error is
not transient or if retries are explicitly discouraged.
5.5. HTTP Error Recovery
If the HTTP client fails to read the HTTP server response data, the
POST operation with identical content, including same Message-ID,
SHOULD be repeated, if the condition is transient.
The Message-ID on a POST operation can be reused if and only if all
of the content (including the original Date) is identical.
Details of the retry process (including time intervals to pause,
number of retries to attempt, and timeouts for retrying) are
implementation dependent. These settings are selected as part of the
trading partner agreement.
Servers SHOULD be prepared to receive a POST with a repeated
Message-ID. The MIME reply body previously sent SHOULD be resent,
including the MDN and other MIME parts.
6. Additional AS2-Specific HTTP Headers
The following headers are to be included in all AS2 messages and all
AS2 MDNs, except for asynchronous MDNs that are sent using SMTP and
that follow the AS1 semantics[4].
Moberg & Drummond Standards Track [Page 14]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
6.1. AS2 Version Header
To promote backward compatibility, AS2 includes a version header:
AS2-Version: 1.0 - Used in all implementations of this
specification. 1.x will be interpreted as 1.0 by
all implementations with the "AS2 Version: 1.0"
header. That is, only the most significant digit
is used as the version identifier for those not
implementing additional non-AS2-specified
functionality. "AS2-Version: 1.0 through 1.9" MAY
be used. All implementations MUST interpret "1.0
through 1.9" as implementing this specification.
However, an implementation MAY extend this
specification with additional functionality by
specifying versions 1.1 through 1.9. If this
mechanism is used, the additional functionality
MUST be completely transparent to implementations
with the "AS2-Version: 1.0" designation.
AS2-Version: 1.1 - Designates those implementations that support
compression as defined by RFC 3274.
Receiving systems MUST NOT fail due to the absence of the AS2-Version
header. Its absence would indicate that the message is from an
implementation based on a previous version of this specification.
6.2. AS2 System Identifiers
To aid the receiving system in identifying the sending system,
AS2-From and AS2-To headers are used.
AS2-From: < AS2-name >
AS2-To: < AS2-name >
These AS2 headers contain textual values, as described below,
identifying the sender/receiver of a data exchange. Their values may
be company specific, such as Data Universal Numbering System (DUNS)
numbers, or they may be simply identification strings agreed upon
between the trading partners.
Moberg & Drummond Standards Track [Page 15]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
AS2-text = "!" / ; printable ASCII characters
%d35-91 / ; except double-quote (%d34)
%d93-126 ; or backslash (%d92)
AS2-qtext = AS2-text / SP ; allow space only in quoted text
AS2-quoted-pair = "\" DQUOTE / ; \" or
"\" "\" ; \\
AS2-quoted-name = DQUOTE 1*128( AS2-qtext /
AS2-quoted-pair) DQUOTE
AS2-atomic-name = 1*128AS2-text
AS2-name = AS2-atomic-name / AS2-quoted-name
The AS2-From header value and the AS2-To header value MUST each be an
AS2-name, MUST each be comprised of from 1 to 128 printable ASCII
characters, and MUST NOT be folded. The value in each of these
headers is case-sensitive. The string definitions given above are in
ABNF format [14].
The AS2-quoted-name SHOULD be used only if the AS2-name does not
conform to AS2-atomic-name.
The AS2-To and AS2-From header fields MUST be present in all AS2
messages and AS2 MDNs whether asynchronous or synchronous in nature,
except for asynchronous MDNs, which are sent using SMTP.
The AS2-name for the AS2-To header in a response or MDN MUST match
the AS2-name of the AS2-From header in the corresponding request
message. Likewise, the AS2-name for the AS2-From header in a
response or MDN MUST match the AS2-name of the AS2-To header in the
corresponding AS2 request message.
The sending system may choose to limit the possible AS2-To/AS2-From
textual values but MUST not exceed them. The receiving system MUST
make no restrictions on the textual values and SHOULD handle all
possible implementations. However, implementers must be aware that
older AS2 products may not adhere to this convention. Trading
partner agreements should be made to ensure that older products can
support the system identifiers that are used.
There is no required response to a client request containing invalid
or unknown AS2-From or AS2-To header values. The receiving AS2
system MAY return an unsigned MDN with an explanation of the error,
if the sending system requested an MDN.
Moberg & Drummond Standards Track [Page 16]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
7. Structure and Processing of an MDN Message
7.1. Introduction
In order to support non-repudiation of receipt, a signed receipt,
based on digitally signing a message disposition notification, is to
be implemented by a receiving trading partner's UA. The message
disposition notification, specified by RFC 3798, is digitally signed
by a receiving trading partner as part of a multipart/signed MIME
message.
The following support for signed receipts is REQUIRED:
1. The ability to create a multipart/report; where the
report-type = disposition-notification.
2. The ability to calculate a message integrity check (MIC) on the
received message. The calculated MIC value will be returned to
the sender of the message inside the signed receipt.
3. The ability to create a multipart/signed content with the
message disposition notification as the first body part, and
the signature as the second body part.
4. The ability to return the signed receipt to the sending trading
partner.
5. The ability to return either a synchronous or an asynchronous
receipt as the sending party requests.
The signed receipt is used to notify a sending trading partner that
requested the signed receipt that:
1. The receiving trading partner acknowledges receipt of the sent
EC Interchange.
2. If the sent message was signed, then the receiving trading
partner has authenticated the sender of the EC Interchange.
3. If the sent message was signed, then the receiving trading
partner has verified the integrity of the sent EC Interchange.
Moberg & Drummond Standards Track [Page 17]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Regardless of whether the EDI/EC Interchange was sent in S/MIME
format, the receiving trading partner's UA MUST provide the following
basic processing:
1. If the sent EDI/EC Interchange is encrypted, then the encrypted
symmetric key and initialization vector (if applicable) is
decrypted using the receiver's private key.
2. The decrypted symmetric encryption key is then used to decrypt
the EDI/EC Interchange.
3. The receiving trading partner authenticates signatures in a
message using the sender's public key. The authentication
algorithm performs the following:
a. The message integrity check (MIC or Message Digest), is
decrypted using the sender's public key.
b. A MIC on the signed contents (the MIME header and encoded
EDI object, as per RFC 1767) in the message received is
calculated using the same one-way hash function that the
sending trading partner used.
c. The MIC extracted from the message that was sent and the MIC
calculated using the same one-way hash function that the
sending trading partner used are compared for equality.
4. The receiving trading partner formats the MDN and sets the
calculated MIC into the "Received-content-MIC" extension field.
5. The receiving trading partner creates a multipart/signed MIME
message according to RFC 1847.
6. The MDN is the first part of the multipart/signed message, and
the digital signature is created over this MDN, including its
MIME headers.
7. The second part of the multipart/signed message contains the
digital signature. The "protocol" option specified in the
second part of the multipart/signed is as follows:
S/MIME: protocol = "application/pkcs-7-signature"
8. The signature information is formatted according to S/MIME
specifications.
Moberg & Drummond Standards Track [Page 18]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
The EC Interchange and the RFC 1767 MIME EDI content header can
actually be part of a multi-part MIME content-type. When the EDI
Interchange is part of a multi-part MIME content-type, the MIC MUST
be calculated across the entire multi-part content, including the
MIME headers.
The signed MDN, when received by the sender of the EDI Interchange,
can be used by the sender as follows:
o As an acknowledgement that the EDI Interchange sent was
delivered and acknowledged by the receiving trading partner.
The receiver does this by returning the original-message-id
of the sent message in the MDN portion of the signed receipt.
o As an acknowledgement that the integrity of the EDI
Interchange was verified by the receiving trading partner.
The receiver does this by returning the calculated MIC of the
received EC Interchange (and 1767 MIME headers) in the
"Received-content-MIC" field of the signed MDN.
o As an acknowledgement that the receiving trading partner has
authenticated the sender of the EDI Interchange.
o As a non-repudiation of receipt when the signed MDN is
successfully verified by the sender with the receiving
trading partner's public key and the returned MIC value
inside the MDN is the same as the digest of the original
message.
7.2. Synchronous and Asynchronous MDNs
The AS2-MDN exists in two varieties: synchronous and asynchronous.
The synchronous AS2-MDN is sent as an HTTP response to an HTTP POST
or as an HTTPS response to an HTTPS POST. This form of AS2-MDN is
called synchronous because the AS2-MDN is returned to the originator
of the POST on the same TCP/IP connection.
The asynchronous AS2-MDN is sent on a separate HTTP, HTTPS, or SMTP
TCP/IP connection. Logically, the asynchronous AS2-MDN is a response
to an AS2 message. However, at the transfer-protocol layer, assuming
that no HTTP pipelining is utilized, the asynchronous AS2-MDN is
delivered on a unique TCP/IP connection, distinct from that used to
deliver the original AS2 message. When handling an asynchronous
request, the HTTP response MUST be sent back before the MDN is
processed and sent on the separate connection.
Moberg & Drummond Standards Track [Page 19]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
When an asynchronous AS2-MDN is requested by the sender of an AS2
message, the synchronous HTTP or HTTPS response returned to the
sender prior to terminating the connection MUST be a transfer-layer
response indicating the success or failure of the data transfer. The
format of such a synchronous response MAY be the same as that
response returned when no AS2-MDN is requested.
The following diagram illustrates the synchronous versus asynchronous
varieties of AS2-MDN delivery using HTTP:
Synchronous AS2-MDN
[Peer1] ----( connect )----> [Peer2]
[Peer1] -----( send )------> [Peer2] [HTTP Request [AS2-Message]]
[Peer1] <---( receive )----- [Peer2] [HTTP Response [AS2-MDN]]
Asynchronous AS2-MDN
[Peer1] ----( connect )----> [Peer2]
[Peer1] -----( send )------> [Peer2] [HTTP Request [AS2-Message]]
[Peer1] <---( receive )----- [Peer2] [HTTP Response]
[Peer1]*<---( connect )----- [Peer2]
[Peer1] <--- ( send )------- [Peer2] [HTTP Request [AS2-MDN]]
[Peer1] ----( receive )----> [Peer2] [HTTP Response]
* Note: An AS2-MDN may be directed to a host different from that of
the sender of the AS2 message. It may utilize a transfer protocol
different from that used to send the original AS2 message.
The advantage of the synchronous MDN is that it can provide the
sender of the AS2 Message with a verifiable confirmation of message
delivery within a synchronous logic flow. However, if the message is
relatively large, the time required to process this message and to
return an AS2-MDN to the sender on the same TCP/IP connection may
exceed the maximum configured time permitted for an IP connection.
The advantage of the asynchronous MDN is that it provides for the
rapid return of a transfer-layer response from the receiver,
confirming the receipt of data, therefore not requiring that a TCP/IP
connection necessarily remain open for very long. However, this
design requires that the asynchronous AS2-MDN contain enough
information to identify the original message uniquely so that, when
received by the AS2 Message originator, the status of the original
AS2 Message can be properly updated based on the contents of the
AS2-MDN.
Moberg & Drummond Standards Track [Page 20]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Synchronous or asynchronous HTTP or HTTPS MDNs are handled according
to the requirements of this specification.
However, SMTP MDNs are formatted according to the requirements of RFC
3335 [4].
7.3. Requesting a Signed Receipt
Message disposition notifications are requested as per RFC 3798. A
request that the receiving user agent issue a message disposition
notification is made by placing the following header into the message
to be sent:
MDN-request-header = "Disposition-notification-to"
":" mail-address
The following example is for requesting an MDN:
Disposition-notification-to: xxx@example.com
This syntax is a residue of the use of MDNs using SMTP transfer.
Because this specification is adjusting the functionality from SMTP
to HTTP while retaining as much as possible from the [4]
functionality, the mail-address MUST be present. The mail-address
field is specified as an RFC 2822 localpart@domain [addr-spec]
address. However, the address is not used to identify where to
return the MDN. Receiving applications MUST ignore the value and
MUST not complain about RFC 2822 address syntax violations.
When requesting MDN-based receipts, the originator supplies
additional extension headers that precede the message body. These
header "tags" are as follows:
A Message-ID header is added to support message reconciliation, so
that an Original-Message-Id value can be returned in the body part of
MDN. Other headers, especially "Subject" and "Date", SHOULD be
supplied; the values of these headers are often mentioned in the
human-readable section of a MDN to aid in identifying the original
message.
MDNs will be returned in the HTTP response when requested, unless an
asynchronous return is requested.
To request an asynchronous message disposition notification, the
following header is placed into the message that is sent:
Receipt-Delivery-Option: return-URL
Moberg & Drummond Standards Track [Page 21]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Here is an example requesting that the MDN be asynchronous:
Receipt-Delivery-Option: http://www.example.com/Path
Receipt-delivery-option syntax allows return-url to use some schemes
other than HTTP using the POST method.
The "receipt-delivery-option: return-url" string indicates the URL to
use for an asynchronous MDN. This header is NOT present if the
receipt is to be synchronous. The email value in Disposition-
notification-to is not used in this specification because it was
limited to RFC 2822 addresses; the extension header "Receipt-
delivery-option" has been introduced to provide a URL for the MDN
return by several transfer options.
The receipt-delivery-option's value MUST be a URL indicating the
delivery transport destination for the receipt.
An example request for an asynchronous MDN via an HTTP transport:
Receipt-delivery-option: http://www.example.com
An example request for an asynchronous MDN via an HTTP/S transport:
Receipt-delivery-option: https://www.example.com
An example request for an asynchronous MDN via an SMTP transport:
Receipt-delivery-option: mailto:as2@example.com
For more information on requesting SMTP MDNs, refer to RFC 3335 [4].
Finally, the header, Disposition-notification-options, identifies
characteristics of message disposition notification as in [5]. The
most important of these options is for indicating the signing options
for the MDN, as in the following example:
Disposition-notification-options:
signed-receipt-protocol=optional,pkcs7-signature;
signed-receipt-micalg=optional,sha1,md5
For signing options, consider the disposition-notification-options
syntax:
Disposition-notification-options =
"Disposition-Notification-Options" ":"
disposition-notification-parameters
Moberg & Drummond Standards Track [Page 22]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
where
disposition-notification-parameters =
parameter *(";" parameter)
where
parameter = attribute "=" importance ", " 1#value"
where
importance = "required" | "optional"
So the Disposition-notification-options string could be:
signed-receipt-protocol=optional,<protocol symbol>;
signed-receipt-micalg=optional,<micalg1>,<micalg2>,...;
The currently used value for <protocol symbol> is "pkcs7-signature"
for the S/MIME detached signature format.
The currently supported values for MIC algorithm <micalg> values are:
Algorithm Value Used
--------- -------
SHA-1 sha1
MD5 md5
The semantics of the "signed-receipt-protocol" and the "signed-
receipt-micalg" parameters are as follows:
1. The "signed-receipt-protocol" parameter is used to request a
signed receipt from the recipient trading partner. The "signed-
receipt-protocol" parameter also specifies the format in which the
signed receipt SHOULD be returned to the requester.
The "signed-receipt-micalg" parameter is a list of MIC algorithms
preferred by the requester for use in signing the returned
receipt. The list of MIC algorithms SHOULD be honored by the
recipient from left to right.
Both the "signed-receipt-protocol" and the "signed- receipt-
micalg" option parameters are REQUIRED when requesting a signed
receipt.
The lack of the presence of the "Receipt-Delivery-Option"
indicates that a receipt is synchronous in nature. The presence
of the "Receipt-Delivery-Option: return-url" indicates that an
asynchronous receipt is requested and SHOULD be sent to the
"return-url".
Moberg & Drummond Standards Track [Page 23]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
2. The "importance" attribute of "Optional" is defined in RFC 3798,
Section 2.2, and has the following meaning:
Parameters with an importance of "Optional" permit a UA that does
not understand the particular options parameter to still generate
an MDN in response to a request for a MDN.
A UA that does not understand the "signed-receipt-protocol"
parameter or the "signed-receipt-micalg" will obviously not return
a signed receipt.
The importance of "Optional" is used for the signed receipt
parameters because it is RECOMMENDED that an MDN be returned to
the requesting trading partner even if the recipient could not
sign it.
The returned MDN will contain information on the disposition of
the message and on why the MDN could not be signed. See the
Disposition field in Section 7.5 for more information.
Within an EDI trading relationship, if a signed receipt is
expected and is not returned, then the validity of the transaction
is up to the trading partners to resolve.
In general, if a signed receipt is required in the trading
relationship and is not received, the transaction will likely not
be considered valid.
7.3.1. Signed Receipt Considerations
The method used to request a receipt or a signed receipt is defined
in RFC 3798, "An Extensible Message Format for Message Disposition
Notifications".
The "rules" are as follows:
1. When a receipt is requested, explicitly specifying that the
receipt be signed, then the receipt MUST be returned with a
signature.
2. When a receipt is requested, explicitly specifying that the
receipt be signed, but the recipient cannot support either the
requested protocol format or the requested MIC algorithms, then
either a signed or unsigned receipt SHOULD be returned.
Moberg & Drummond Standards Track [Page 24]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
3. When a signature is not explicitly requested, or if the signed
receipt request parameter is not recognized by the UA, then no
receipt, an unsigned receipt, or a signed receipt MAY be returned
by the recipient.
NOTE: For Internet EDI, it is RECOMMENDED that when a signature is
not explicitly requested, or if parameters are not recognized, the UA
send back, at a minimum, an unsigned receipt. If, however, a signed
receipt was always returned as a policy, whether requested or not,
then any false unsigned receipts can be repudiated.
When a request for a signed receipt is made, but there is an error in
processing the contents of the message, a signed receipt MUST still
be returned. The request for a signed receipt SHALL still be
honored, though the transaction itself may not be valid. The reason
why the contents could not be processed MUST be set in the
"disposition-field".
When a signed receipt request is made, the "Received-content-MIC"
MUST always be returned to the requester (except when corruption
prevents computation of the digest in accordance with the following
specification). The "Received-content-MIC" MUST be calculated as
follows:
o For any signed messages, the MIC to be returned is calculated
on the RFC1767/RFC3023 MIME header and content.
Canonicalization on the MIME headers MUST be performed before
the MIC is calculated, since the sender requesting the signed
receipt was also REQUIRED to canonicalize.
o For encrypted, unsigned messages, the MIC to be returned is
calculated on the decrypted RFC 1767/RFC3023 MIME header and
content. The content after decryption MUST be canonicalized
before the MIC is calculated.
o For unsigned, unencrypted messages, the MIC MUST be calculated
over the message contents without the MIME or any other RFC
2822 headers, since these are sometimes altered or reordered by
Mail Transport Agents (MTAs).
7.4. MDN Format and Values
This section defines the format of the AS2 Message Disposition
Notification (AS2-MDN).
Moberg & Drummond Standards Track [Page 25]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
7.4.1. AS2-MDN General Formats
The AS2-MDN follows the MDN specification [5] except where noted in
this section. The modified ABNF definitions in this document use the
vertical-bar character, '|', to denote a logical "OR" construction.
This usage follows RFC 2616 [3]. HTTP entities referred to below are
not further defined in this document. Refer to RFC 2616 [3] for
complete definitions of HTTP entities. The format of the AS2-MDN is:
AS2-MDN = AS2-sync-MDN | AS2-async-http-MDN |
AS2-async-smtp-MDN
AS2-sync-MDN =
Status-Line
*(( general-header | response-header | entity-header )
CRLF )
CRLF
AS2-MDN-body
Status-Line =
HTTP-Version SP Status-Code SP Reason-Phrase CRLF
AS2-async-http-MDN =
Request-Line
*(( general-header | request-header | entity-header )
CRLF )
CRLF
AS2-MDN-body
Request-Line =
Method SP Request-URI SP HTTP-Version CRLF
AS2-async-smtp-MDN =
*(( general-header | request-header | entity-header )
CRLF )
CRLF
AS2-MDN-body
AS2-MDN-body =
AS2-signed-MDN-body | AS2-unsigned-MDN-body
7.4.2. AS2-MDN Construction
The AS2-MDN-body is formatted as a MIME multipart/report with a
report-type of "disposition-notification". When the message is
unsigned, the transfer-layer ("outermost") entity-headers of the
AS2-MDN contain the content-type header that specifies a content-type
Moberg & Drummond Standards Track [Page 26]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
of "multipart/report" and parameters indicating the report-type, and
the value of the outermost multipart boundary.
When the AS2-MDN is signed, the transfer-layer ("outermost") entity-
headers of the AS2-MDN contain a content-type header that specifies a
content-type of "multipart/signed" and parameters indicating the
algorithm used to compute the message digest, the signature-
formatting protocol (e.g., pkcs7-signature), and the value of the
outermost multipart boundary. The first part of the MIME
multipart/signed message is an embedded MIME multipart/report of type
"disposition-notification". The second part of the multipart/signed
message contains a MIME application/pkcs7-signature message.
The first part of the MIME multipart/report is a "human-readable"
portion that contains a general description of the message
disposition. The second part of the MIME multipart/report is a
"machine-readable" portion that is defined as:
AS2-disposition-notification-content =
[ reporting-ua-field CRLF ]
[ mdn-gateway-field CRLF ]
final-recipient-field CRLF
[ original-message-id-field CRLF ]
AS2-disposition-field CRLF
*( failure-field CRLF )
*( error-field CRLF )
*( warning-field CRLF )
*( extension-field CRLF )
[ AS2-received-content-MIC-field CRLF ]
7.4.3. AS2-MDN Fields
The rules for constructing the AS2-disposition-notification content
are identical to the disposition-notification-content rules provided
in Section 7 of RFC 3798 [5], except that the RFC 3798 disposition-
field has been replaced with the AS2-disposition-field and that the
AS2-received-content-MIC field has been added. The differences
between the RFC 3798 disposition-field and the AS2-disposition-field
are described below. Where there are differences between this
document and RFC 3798, those entity names have been changed by pre-
pending "AS2-". Entities that do not differ from RFC 3798 are not
necessarily further defined in this document; refer to RFC 3798,
Section 7, "Collected Grammar", for the original grammar.
Moberg & Drummond Standards Track [Page 27]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
AS2-disposition-field =
"Disposition" ":" disposition-mode ";"
AS2-disposition-type [ '/' AS2-disposition-modifier ]
disposition-mode =
action-mode "/" sending-mode
action-mode =
"manual-action" | "automatic-action"
sending-mode =
"MDN-sent-manually" | "MDN-sent-automatically"
AS2-disposition-type =
"processed" | "failed"
AS2-disposition-modifier =
( "error" | "warning" ) | AS2-disposition-modifier-extension
AS2-disposition-modifier-extension =
"error: authentication-failed" |
"error: decompression-failed" |
"error: decryption-failed" |
"error: insufficient-message-security" |
"error: integrity-check-failed" |
"error: unexpected-processing-error" |
"warning: " AS2-MDN-warning-description |
"failure: " AS2-MDN-failure-description
AS2-MDN-warning-description = *( TEXT )
AS2-MDN-failure-description = *( TEXT )
AS2-received-content-MIC-field =
"Received-content-MIC" ":" encoded-message-digest ","
digest-alg-id CRLF
encoded-message-digest =
1*( 'A'-Z' | 'a'-'z' | '0'-'9' | '/' | '+' | '=' ) (
i.e. base64( message-digest ) )
digest-alg-id = "sha1" | "md5"
"Insufficient-message-security" and "decompression-failed" are new
error codes that are not mentioned in the AS1 RFC 3335, and may not
be compatible with earlier implementations of AS2.
Moberg & Drummond Standards Track [Page 28]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
The "Received-content-MIC" extension field is set when the integrity
of the received message is verified. The MIC is the base64-encoded
message-digest computed over the received message with a hash
function. This field is required for signed receipts but optional
for unsigned receipts. For details defining the specific content
over which the message digest is to be computed, see Section 7.3.1 of
this document.
For signed messages, the algorithm used to calculate the MIC MUST be
the same as that used on the message that was signed. If the message
is not signed, then the SHA-1 algorithm SHOULD be used. This field
is set only when the contents of the message are processed
successfully. This field is used in conjunction with the recipient's
signature on the MDN so that the sender can verify non-repudiation of
receipt.
AS2-MDN field names (e.g., "Disposition:", "Final-Recipient:") are
case insensitive (cf. RFC 3798, Section 3.1.1). AS2-MDN action-
modes, sending-modes, AS2-disposition-types, and AS2-disposition-
modifier values, which are defined above, and user-supplied *( TEXT )
values are also case insensitive. AS2 implementations MUST NOT make
assumptions regarding the values supplied for AS2-MDN-warning-
description or AS2-MDN-failure-description, or for the values of any
(optional) error, warning, or failure fields.
7.4.4. Additional AS2-MDN Programming Notes
o Unlike SMTP, for HTTP transactions, Original-Recipient and Final-
Recipient SHOULD not be different. The value in Original-
Message-ID SHOULD match the original Message-ID header value.
o Refer to RFC 3798 for the formatting of the MDN, except for the
specific deviations mentioned above.
o Refer to RFC 3462 and RFC 3798 for the formatting of the content-
type entity-headers for the MDN.
o Use an action-mode of "automatic-action" when the disposition
described by the disposition type was a result of an automatic
action rather than that of an explicit instruction by the user for
this message.
o Use an action-mode of "manual-action" when the disposition
described by the disposition type was a result of an explicit
instruction by the user rather than some sort of automatically
performed action.
Moberg & Drummond Standards Track [Page 29]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
o Use a sending-mode of "MDN-sent-automatically" when the MDN is
sent because the UA had previously been configured to do so.
o Use a sending-mode of "MDN-sent-manually" when the user explicitly
gave permission for this particular MDN to be sent.
o The sending-mode "MDN-sent-manually" is meaningful ONLY with
"manual-action", not with "automatic-action".
o The "failed" disposition type MUST NOT be used for the situation
in which there is some problem in processing the message other
than interpreting the request for an MDN. The "processed" or
other disposition type with appropriate disposition modifiers is
to be used in such situations.
7.5. Disposition Mode, Type, and Modifier
7.5.1. Disposition Mode Overview
This section provides a brief overview of how "processed", "error",
"failure", and "warning" are used.
7.5.2. Successful Processing Status Indication
When the request for a receipt or signed receipt, and the received
message contents are successfully processed by the receiving EDI UA,
a receipt or MDN SHOULD be returned with the disposition-type set to
"processed". When the MDN is sent automatically by the EDI UA, and
there is no explicit way for a user to control the sending of the
MDN, then the first part of the "disposition-mode" SHOULD be set to
"automatic-action". When the MDN is being sent under user-
configurable control, then the first part of the "disposition-mode"
SHOULD be set to "manual-action". Since a request for a signed
receipt should always be honored, the user MUST not be allowed to
configure the UA not to send a signed receipt when the sender
requests one.
The second part of the disposition-mode is set to "MDN-sent-manually"
if the user gave explicit permission for the MDN to be sent. Again,
the user MUST not be allowed to explicitly refuse to send a signed
receipt when the sender requests one. The second part of the
"disposition-mode" is set to "MDN-sent-automatically" whenever the
EDI UA sends the MDN automatically, regardless of whether the sending
was under the control of a user, administrator, or software.
Because EDI content is generally handled automatically by the EDI UA,
a request for a receipt or signed receipt will generally return the
following in the "disposition-field":
Moberg & Drummond Standards Track [Page 30]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Disposition: automatic-action/MDN-sent-automatically; processed
Note that this specification does not restrict the use of the
"disposition-mode" just to automatic actions. Manual actions are
valid as long as it is kept in mind that a request for a signed
receipt MUST be honored.
7.5.3. Unsuccessful Processed Content
The request for a signed receipt requires the use of two
"disposition-notification-options", which specify the protocol format
of the returned signed receipt, and the MIC algorithm used to
calculate the MIC over the message contents. The "disposition-field"
values that should be used if the message content is being rejected
or ignored (for instance, if the EDI UA determines that a signed
receipt cannot be returned because it does not support the requested
protocol format, the EDI UA chooses not to process the message
contents itself) MUST be specified in the MDN "disposition-field" as
follows:
Disposition: "disposition-mode"; failed/Failure:
unsupported format
The "failed" AS2-disposition-type MUST be used when a failure occurs
that prevents the proper generation of an MDN. For example, this
disposition-type would apply if the sender of the message requested
the application of an unsupported message-integrity-check (MIC)
algorithm.
The "failure:" AS2-disposition-modifier-extension SHOULD be used with
an implementation-defined description of the failure. Further
information about the failure may be contained in a failure-field.
The syntax of the "failed" disposition-type is general, allowing the
sending of any textual information along with the "failed"
disposition-type. Implementations MUST support any printable textual
characters after the Failure disposition-type. For use in Internet
EDI, the following "failed" values are pre-defined and MUST be
supported:
"Failure: unsupported format"
"Failure: unsupported MIC-algorithms"
Moberg & Drummond Standards Track [Page 31]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
7.5.4. Unsuccessful Non-Content Processing
When errors occur in processing the received message (other than
content), the "disposition-field" MUST be set to the "processed"
value for disposition-type and the "error" value for disposition-
modifier.
The "error" AS2-disposition-modifier with the "processed"
disposition-type MUST be used to indicate that an error of some sort
occurred that prevented successful processing of the message.
Further information may be contained in an error-field.
An "error:" AS2-disposition-modifier-extension SHOULD be used to
combine the indication of an error with a predefined description of a
specific, well-known error. Further information about the error may
be contained in an error field.
For internet EDI use, the following "error" AS2-disposition-modifier
values are defined:
o "Error: decryption-failed" - the receiver could not
decrypt the message
contents.
o "Error: authentication-failed" - the receiver could not
authenticate the sender.
o "Error: integrity-check-failed" - the receiver could not
verify content integrity.
o "Error: unexpected-processing-error" - a catch-all for any
additional processing
errors.
An example of how the "disposition-field" would look when errors
other than those in content processing are detected is as follows:
Disposition: "disposition-mode"; processed/Error:
decryption-failed
7.5.5. Processing Warnings
Situations arise in EDI when, even if a trading partner cannot be
authenticated correctly, the trading partners still agree to continue
processing the EDI transactions. Transaction reconciliation is done
between the trading partners at a later time. In the content
Moberg & Drummond Standards Track [Page 32]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
processing warning situations as described above, the "disposition-
field" MUST be set to the "processed" disposition-type value, and the
"warning" to the "disposition-modifier" value.
The "warning" AS2-disposition-modifier MUST be used with the
"processed" disposition-type to indicate that the message was
successfully processed but that an exceptional condition occurred.
Further information may be contained in a warning-field.
A "warning:" AS2-disposition-modifier-extension SHOULD be used to
combine the indication of a warning with an implementation-defined
description of the warning. Further information about the warning
may be contained in a warning-field.
For use in Internet EDI, the following "warning"
disposition-modifier-extension value is defined:
"Warning: authentication-failed, processing continued"
An example of how the "disposition-field" would look when warning
other than those for content processing are detected is as follows:
Example:
Disposition: "disposition-mode"; processed/Warning:
authentication-failed, processing continued
7.5.6. Backward Compatibility with Disposition Type, Modifier, and
Extension
The following set of examples represents typical constructions of the
Disposition field that have been in use by AS2 implementations. This
is NOT an exhaustive list of possible constructions. However, AS2
implementations MUST accept constructions of this type to be backward
compatible with earlier AS2 versions.
Disposition: automatic-action/MDN-sent-automatically; processed
Disposition: automatic-action/MDN-sent-automatically;
processed/error: authentication-failed
Disposition: automatic-action/MDN-sent-automatically;
processed/warning: duplicate-document
Disposition: automatic-action/MDN-sent-automatically;
failed/failure: sender-equals-receiver
Moberg & Drummond Standards Track [Page 33]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
The following set of examples represents allowable constructions of
the Disposition field that combine the historic constructions above
with optional RFC 3798 error, warning, and failure fields. AS2
implementations MAY produce these constructions. However, AS2
servers are not required to recognize or process optional error,
warning, or failure fields at this time. Note that the use of the
multiple error fields in the second example below provides for the
indication of multiple error conditions.
Disposition: automatic-action/MDN-sent-automatically; processed
Disposition: automatic-action/MDN-sent-automatically;
processed/error: decryption-failed
Error: The signature did not decrypt into a valid PKCS#1
Type-2 block.
Error: The length of the decrypted key does not equal the
octet length of the modulus.
Disposition: automatic-action/MDN-sent-automatically;
processed/warning: duplicate-document
Warning: An identical message already exists at the
destination server.
Disposition: automatic-action/MDN-sent-automatically;
failed/failure: sender-equals-receiver
Failure: The AS2-To name is identical to the AS2-From name.
The following set of examples represents allowable constructions of
the Disposition field that employ pure RFC 3798 Disposition-modifiers
with optional error, warning, and failure fields. These examples are
provided as informational only. These constructions are not
guaranteed to be backward compatible with AS2 implementations prior
to version 1.1.
Disposition: automatic-action/MDN-sent-automatically; processed
Disposition: automatic-action/MDN-sent-automatically;
processed/error
Error: authentication-failed
Error: The signature did not decrypt into a valid PKCS#1 Type-2
block.
Error: The length of the decrypted key does not equal the
octet length of the modulus.
Disposition: automatic-action/MDN-sent-automatically;
processed/warning
Warning: duplicate-document
Moberg & Drummond Standards Track [Page 34]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Disposition: automatic-action/MDN-sent-automatically; failed
Failure: sender-equals-receiver
7.6. Receipt Reply Considerations in an HTTP POST
The details of the response to the POST command vary depending upon
whether a receipt has been requested.
With no extended header requesting a receipt, and with no errors
accessing the request-URI specified processing, the status line in
the Response to the POST request SHOULD be in the 200 range. Status
codes in the 200 range SHOULD also be used when an entity is returned
(a signed receipt in a multipart/signed content type or an unsigned
receipt in a multipart/report). Even when the disposition of the
data was an error condition at the authentication, decryption or
other higher level, the HTTP status code SHOULD indicate success at
the HTTP level.
The HTTP server-side application may respond with an unsolicited
multipart/report as a message body that the HTTP client might not
have solicited, but the client may discard this. Applications SHOULD
avoid emitting unsolicited receipt replies because bandwidth or
processing limitations might have led administrators to suspend
asking for acknowledgements.
Message Disposition Notifications, when used in the HTTP reply
context, will closely parallel a SMTP MDN. For example, the
disposition field is a required element in the machine-readable
second part of a multipart/report for a MDN. The final-recipient-
field ([5], Section 3.1) value SHOULD be derived from the entity
headers of the request.
In an MDN, the first part of the multipart/report (the human-readable
part) SHOULD include items such as the subject, the date, and other
information when those fields are present in entity header fields
following the POST request. An application MUST report the Message-
ID of the request in the second part of the multipart/report (the
machine-readable part). Also, an MDN SHOULD have its own unique
Message-ID HTTP header. The HTTP reply SHOULD normally omit the
third optional part of the multipart/report (used to return the
original message or its headers in the SMTP context).
8. Public Key Certificate Handling
In the near term, the exchange of public keys and certification of
these keys MUST be handled as part of the process of establishing a
trading partnership. The UA and/or EDI application interface must
maintain a database of public keys used for encryption or signatures,
Moberg & Drummond Standards Track [Page 35]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
in addition to the mapping between the EDI trading partner ID and the
RFC 2822 [9] email address and HTTP URL/URI. The procedures for
establishing a trading partnership and configuring the secure EDI
messaging system might vary among trading partners and software
packages.
X.509 certificates are REQUIRED. It is RECOMMENDED that trading
partners self-certify each other if an agreed-upon certification
authority is not used. This applicability statement does NOT require
the use of a certification authority. The use of a certification
authority is therefore OPTIONAL. Certificates may be self-signed.
It is RECOMMENDED that when trading partners are using S/MIME they
also exchange public key certificates, considering advice provided in
[12].
The message formats useful for certificate exchange are found in [7]
and [13].
In the long term, additional standards may be developed to simplify
the process of establishing a trading partnership, including the
third-party authentication of trading partners, as well as the
attributes of the trading relationship.
9. Security Considerations
This entire document is concerned with secure transport of business
to business data, and it considers both data confidentiality and
authentication issues.
Extracted from RFC 3851 [7]:
40-bit encryption is considered weak by most cryptographers. Using
weak cryptography in S/MIME offers little actual security over
sending plaintext. However, other features of S/MIME, such as the
specification of Triple DES and the ability to announce stronger
cryptographic capabilities to parties with whom you communicate,
allow senders to create messages that use strong encryption. Using
weak cryptography is never recommended unless the only alternative is
no cryptography. When feasible, sending and receiving agents SHOULD
inform senders and recipients of the relative cryptographic strength
of messages.
Extracted from RFC 3850 [12]:
When processing certificates, there are many situations where the
processing might fail. Because the processing may be done by a user
agent, a security gateway, or other program, there is no single way
to handle such failures. Just because the methods to handle the
failures have not been listed, however, the reader should not assume
Moberg & Drummond Standards Track [Page 36]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
that they are not important. The opposite is true: if a certificate
is not provably valid and associated with the message, the processing
software should take immediate and noticeable steps to inform the end
user about it.
Some of the many situations in which signature and certificate
checking might fail include the following:
o No certificate chain leads to a trusted CA.
o No ability to check the Certificate Revocation List (CRL) for a
certificate.
o An invalid CRL was received.
o The CRL being checked is expired.
o The certificate is expired.
o The certificate has been revoked.
There are certainly other instances where a certificate may be
invalid, and it is the responsibility of the processing software to
check them all thoroughly, and to decide what to do if the check
fails. See RFC 3280 for additional information on certificate path
validation.
The following are additional security considerations to those listed
in [7] and [12].
9.1. NRR Cautions
This specification seeks to provide multiple mechanisms that can be
combined in accordance with local policies to achieve a wide range of
security needs as determined by threat and risk analyses of the
business peers. It is required that all these mechanisms be
implemented by AS2 software so that the software has capabilities
that promote strong interoperability, no matter what policies are
adopted.
One strong cluster of mechanisms (the secure transmission loop) can
provide good support for meeting the evidentiary needs of non-
repudiation of receipt by the original sender and by a third party
supplied with all stated evidence. However, this specification does
not itself define non-repudiation of receipt nor enumerate its
essential properties because NRR is a business analysis and/or legal
requirement, and not relevantly defined by a technical applicability
statement.
Moberg & Drummond Standards Track [Page 37]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Some analyses observe that non-repudiation of receipt presupposes
that non-repudiation of the sender of the original message is
obtained, and further that non-repudiation should be implemented by
means of digital signature on the original message. To satisfy
strict NRR evidence, authentication and integrity MUST be provided by
some mechanism, and the RECOMMENDED mechanism is digital signatures
on both the original message and the receipt message.
Given that this specification has selected several mechanisms that
can be combined in several ways, it is important to realize that if a
digital signature is omitted from the original message, in order to
satisfy the preceding analysis of NRR requirements, some
authentication mechanism MUST accompany the request for a signed
receipt and its included Received-content-MIC value. This
authentication might come from using client-side SSL, authentication
via IPsec, or HTTP authentication (while using SSL). In any case,
records of the message content, its security basis, and the digest
value need to be retained for the NRR process.
Therefore, if NRR is one of the goals of the policy that is adopted,
by using the mechanisms of the secure transmission loop mentioned
above and by retaining appropriate records of authentication at the
original message sender site, strong evidentiary requirements
proposed for NRR can be fulfilled.
Other ways of proceeding may fall short of fulfilling the most
stringent sets of evidence required for NRR to obtain, but may
nevertheless be part of a commercial trading agreement and, as such,
are good enough for the parties involved. However, if MDNs are
returned unsigned, evidentiary requirements for NRR are weak; some
authentication of the identity of the receiver is needed.
9.2. HTTPS Remark
The following certificate types MUST be supported for SSL server-side
certificates:
o with URL in the Distinguished Name Common Name attribute
o without URL in the Distinguished Name Common Name attribute
o self-signed (self-issued)
o certification authority certified
The URL, which matches the source server identity, SHOULD be carried
in the certificate. However, it is not required that DNS checks or
reverse lookups to vouch for the accuracy of the URL or server value.
Moberg & Drummond Standards Track [Page 38]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Because server-side certificates are exchanged, and also trust is
established during the configuration of the trading partner
relationship, runtime checks are not required by implementations of
this specification.
The complete certification chain MUST be included in all
certificates. All certificate verifications MUST "chain to root" or
to an accepted trust anchor. Additionally, the certificate hash
SHOULD match the hash recomputed by the receiver.
9.3. Replay Remark
Because business data documents normally contain transaction ids,
replays (such as resends of not-yet-acknowledged messages) are
discarded as part of the normal process of duplicate detection.
Detection of duplicates by Message-Id or by business transaction
identifiers is recommended.
10. IANA Considerations
RFC 3335 registered two Disposition-Notification-Options parameters
Parameter-name: signed-receipt-protocol
Parameter-name: signed-receipt-micalg
that are also used by this specification (see Section 7.3).
RFC 3335 also registered on MDN Extension field name
Extension field name: Received-content-MIC
that is also used by this specification (see Section 7.4.3).
Registration of the above is therefore NOT needed.
10.1. Registration
This specification defines an extension to the Message Disposition
Notification (MDN) protocol for a disposition-modifier in the
Disposition field of a body of content-type "message/disposition-
notification".
10.1.1. Disposition Modifier 'warning'
Parameter-name: warning
Semantics: See Sections 7.4.3 and 7.5.5 of this document.
Moberg & Drummond Standards Track [Page 39]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
11. Acknowledgements
Carl Hage, Karen Rosenfeld, Chuck Fenton, and many others have
provided valuable suggestions that improved this applicability
statement. The authors would also like to thank the vendors who
participated in the Drummond Group Inc. AS2 interoperability testing.
Their contributions led to great improvement in the clarity of this
document.
12. References
12.1. Normative References
[1] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Bodies",
RFC 2045, November 1996.
Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Two: Media Types", RFC 2046, November
1996.
Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Five: Conformance Criteria and Examples",
RFC 2049, November 1996.
[2] Crocker, D., "MIME Encapsulation of EDI Objects", RFC 1767,
March 1995.
[3] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L.,
Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol --
HTTP/1.1", RFC 2616, June 1999.
[4] Harding, T., Drummond, R., and C. Shih, "MIME-based Secure
Peer-to-Peer Business Data Interchange over the Internet", RFC
3335, September 2002.
[5] Hansen, T. and G. Vaudreuil, "Message Disposition Notification",
RFC 3798, May 2004.
[6] Galvin, J., Murphy, S., Crocker, S., and N. Freed, "Security
Multiparts for MIME: Multipart/Signed and Multipart/Encrypted",
RFC 1847, October 1995.
[7] Ramsdell, B., "Secure/Multipurpose Internet Mail Extensions
(S/MIME) Version 3.1 Message Specification", RFC 3851, July
2004.
Moberg & Drummond Standards Track [Page 40]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
[8] Vaudreuil, G., "The Multipart/Report Content Type for the
Reporting of Mail System Administrative Messages", RFC 3462,
January 2003.
[9] Resnick, P., "Internet Message Format", RFC 2822, April 2001.
[10] Murata, M., Laurent, S. St., and D. Kohn, "XML Media Types", RFC
3023, January 2001.
[11] Bradner, S., "The Internet Standards Process -- Revision 3", BCP
9, RFC 2026, October 1996.
[12] Ramsdell, B., "Secure/Multipurpose Internet Mail Extensions
(S/MIME) Version 3.1 Certificate Handling", RFC 3850, July 2004.
[13] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 3852,
July 2004.
[14] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997.
12.2. Informative References
[15] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", RFC
2246, January 1999.
Moberg & Drummond Standards Track [Page 41]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Appendix A: Message Examples
NOTE: All examples are provided for illustration only, and are not
considered part of the protocol specification. If an example
conflicts with the protocol definitions specified above or in the
other referenced RFCs, the example is wrong.
A.1. Signed Message Requesting a Signed, Synchronous Receipt
POST /receive HTTP/1.0
Host: 10.234.160.12:80
User-Agent: AS2 Company Server
Date: Wed, 31 Jul 2002 13:34:50 GMT
From: mrAS2@example.com
AS2-Version: 1.1
AS2-From: "\" as2Name \""
AS2-To: 0123456780000
Subject: Test Case
Message-Id: <200207310834482A70BF63@\"~~foo~~\">
Disposition-Notification-To: mrAS2@example.com
Disposition-Notification-Options: signed-receipt-protocol=optional,
pkcs7-signature; signed-receipt-micalg=optional,sha1
Content-Type: multipart/signed; boundary="as2BouNdary1as2";
protocol="application/pkcs7-signature"; micalg=sha1
Content-Length: 2464
--as2BouNdary1as2
Content-Type: application/edi-x12
Content-Disposition: Attachment; filename=rfc1767.dat
[ISA ...EDI transaction data...IEA...]
--as2BouNdary1as2
Content-Type: application/pkcs7-signature
[omitted binary pkcs7 signature data]
--as2BouNdary1as2--
A.2. MDN for Message A.1, Above
HTTP/1.0 200 OK
AS2-From: 0123456780000
AS2-To: "\" as2Name \""
AS2-Version: 1.1
Message-ID: <709700825.1028122454671.JavaMail@ediXchange>
Content-Type: multipart/signed; micalg=sha1;
protocol="application/pkcs7-signature";
boundary="----=_Part_57_648441049.1028122454671"
Connection: Close
Moberg & Drummond Standards Track [Page 42]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Content-Length: 1980
------=_Part_57_648441049.1028122454671
& Content-Type: multipart/report;
& Report-Type=disposition-notification;
& boundary="----=_Part_56_1672293592.1028122454656"
&
&------=_Part_56_1672293592.1028122454656
&Content-Type: text/plain
&Content-Transfer-Encoding: 7bit
&
&MDN for -
& Message ID: <200207310834482A70BF63@\"~~foo~~\">
& From: "\" as2Name \""
& To: "0123456780000"
& Received on: 2002-07-31 at 09:34:14 (EDT)
& Status: processed
& Comment: This is not a guarantee that the message has
& been completely processed or &understood by the receiving
& translator
&
&------=_Part_56_1672293592.1028122454656
&Content-Type: message/disposition-notification
&Content-Transfer-Encoding: 7bit
&
&Reporting-UA: AS2 Server
&Original-Recipient: rfc822; 0123456780000
&Final-Recipient: rfc822; 0123456780000
&Original-Message-ID: <200207310834482A70BF63@\"~~foo~~\">
&Received-content-MIC: 7v7F++fQaNB1sVLFtMRp+dF+eG4=, sha1
&Disposition: automatic-action/MDN-sent-automatically;
& processed
&
&------=_Part_56_1672293592.1028122454656--
------=_Part_57_648441049.1028122454671
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s
MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQ
cp24hMJNbxDKHnlB9jTiQzLwSwo+/90Pc87x+Sc6EpFSUYWGAAAAAAAA
------=_Part_57_648441049.1028122454671--
Moberg & Drummond Standards Track [Page 43]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Notes:
1. The lines proceeded with "&" are what the signature is calculated
over.
2. For details on how to prepare the multipart/signed with protocol =
"application/pkcs7-signature", see the "S/MIME Message
Specification, PKCS Security Services for MIME".)
3. Note that the textual first body part of the multipart/report can
be used to include a more detailed explanation of the error
conditions reported by the disposition headers. The first body
part of the multipart/report, when used in this way, allows a
person to better diagnose a problem in detail.
4. As specified by RFC 3462 [8], returning the original or portions
of the original message in the third body part of the
multipart/report is not required. This is an optional body part.
However, it is RECOMMENDED that this body part be omitted or left
blank.
A.3. Signed, Encrypted Message Requesting a Signed, Asynchronous
Receipt
Message-ID: <#as2_company#01#a4260as2_companyout#>
Date: Thu, 19 Dec 2002 15:04:18 GMT
From: me@example.com
Subject: Async MDN request
Mime-Version: 1.0
Content-Type: application/pkcs7-mime;
smime-type=enveloped-data; name=smime.p7m
Content-Transfer-Encoding: binary
Content-Disposition: attachment; filename=smime.p7m
Recipient-Address: 10.240.1.2//
Disposition-Notification-To:
http://10.240.1.2:8201/exchange/as2_company
Disposition-Notification-Options: signed-receipt-protocol=optional,
pkcs7-signature; signed-receipt-micalg=optional,sha1
Receipt-Delivery-Option:
http://10.240.1.2:8201/exchange/as2_company
AS2-From: as2_company
AS2-To: "AS2 Test"
AS2-Version: 1.1
Host: 10.240.1.2:8101
Connection: close
Content-Length: 3428
[omitted binary encrypted data]
Moberg & Drummond Standards Track [Page 44]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
A.4. Asynchronous MDN for Message A.3, Above
POST / HTTP/1.1
Host: 10.240.1.2:8201
Connection: close, TE
TE: trailers, deflate, gzip, compress
User-Agent: RPT-HTTPClient/0.3-3I (Windows 2000)
Date: Thu, 19 Dec 2002 15:03:38 GMT
Message-ID: <AS2-20021219_030338@as2_company.dgi_th>
AS2-Version: 1.1
Mime-Version: 1.0
Recipient-Address:
http://10.240.1.2:8201/exchange/as2_company
AS2-To: as2_company
AS2-From: "AS2 Test"
Subject: Your Requested MDN Response
From: as2debug@example.com
Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress
Content-Type: multipart/signed; micalg=sha1;
protocol="application/pkcs7-signature";
boundary="----=_Part_337_6452266.1040310218750"
Content-Length: 3103
------=_Part_337_6452266.1040310218750
Content-Type: multipart/report;
report-type=disposition-notification;
boundary="----=_Part_336_6069110.1040310218718"
------=_Part_336_6069110.1040310218718
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
The message <x12.edi> sent to Recipient <AS2 Test> on Thu, 19 Dec
2002 15:04:18 GMT with Subject <async MDN request> has been received.
The EDI Interchange was successfully decrypted, and its integrity was
verified. In addition, the sender of the message, Sender
<as2_company> at Location http://10.240.1.2:8201/exchange/as2_company
was authenticated as the originator of the message. There is no
guarantee, however, that the EDI interchange was syntactically
correct, or that it was received by the EDI application/translator.
Moberg & Drummond Standards Track [Page 45]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
------=_Part_336_6069110.1040310218718
Content-Type: message/disposition-notification
Content-Transfer-Encoding: 7bit
Reporting-UA: AS2@test:8101
Original-Recipient: rfc822; "AS2 Test"
Final-Recipient: rfc822; "AS2 Test"
Original-Message-ID: <#as2_company#01#a4260as2_companyout#>
Disposition: automatic-action/MDN-sent-automatically;
processed
Received-Content-MIC: Hes6my+vIxIYxmvsA+MNpEOTPAc=, sha1
------=_Part_336_6069110.1040310218718--
------=_Part_337_6452266.1040310218750
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s
BhbWjEfbyXoTAS/H0zpnEqLqbaBh29y2v82b8bdeGw8pipBQWmf53hIcqHGM
4ZBF3CHw5Wrf1JIE+8TwOzdbal30zeChw88WfRfD7c/j1fIA8sxsujvf2d9j
UxCUga8BVdVB9kH0Geexytyt0KvWQXfaEEcgZGUAAAAAAAA=
------=_Part_337_6452266.1040310218750-
Authors' Addresses
Dale Moberg
Cyclone Commerce
8388 E. Hartford Drive, Suite 100
Scottsdale, AZ 85255 USA
EMail: dmoberg@cyclonecommerce.com
Rik Drummond
Drummond Group Inc.
4700 Bryant Irvin Court, Suite 303
Fort Worth, TX 76107 USA
EMail: rvd2@drummondgroup.com
Moberg & Drummond Standards Track [Page 46]
^L
RFC 4130 AS2 for Business Data Interchange Using HTTP July 2005
Full Copyright Statement
Copyright (C) The Internet Society (2005).
This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors
retain all their rights.
This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property
The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at ietf-
ipr@ietf.org.
Acknowledgement
Funding for the RFC Editor function is currently provided by the
Internet Society.
Moberg & Drummond Standards Track [Page 47]
^L
|