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
|
<pre>Network Working Group M. Terada
Request for Comments: 4154 NTT DoCoMo
Category: Informational K. Fujimura
NTT
September 2005
<span class="h1">Voucher Trading System Application Programming Interface (VTS-API)</span>
Status of This Memo
This memo provides information for the Internet community. It does
not specify an Internet standard of any kind. Distribution of this
memo is unlimited.
Copyright Notice
Copyright (C) The Internet Society (2005).
IESG Note
This document is not a candidate for any level of Internet Standard.
This document specifies the Voucher Trading System Application
Programming Interface (VTS-API), which assumes that the VTS plug-in
is trusted by its user. The application making calls to VTS-API
ought to authenticate the VTS plug-in and securely bind the plug-in
with the VTS provider information specified in the Voucher Component.
However, this document does not specify an approach to application
authentication. The VTS-API should not be used without being
augmented by an application authentication mechanism.
Abstract
This document specifies the Voucher Trading System Application
Programming Interface (VTS-API). The VTS-API allows a wallet or
other application to issue, transfer, and redeem vouchers in a
uniform manner independent of the VTS implementation. The VTS is a
system for securely transferring vouchers; e.g., coupons, tickets,
loyalty points, and gift certificates. This process is often
necessary in the course of payment and/or delivery transactions.
<span class="grey">Terada & Fujimura Informational [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Table of Contents
<a href="#section-1">1</a>. Introduction ................................................. <a href="#page-3">3</a>
<a href="#section-2">2</a>. Processing Model ............................................. <a href="#page-4">4</a>
<a href="#section-3">3</a>. Design Overview .............................................. <a href="#page-6">6</a>
<a href="#section-4">4</a>. Concepts ..................................................... <a href="#page-6">6</a>
<a href="#section-5">5</a>. Interface Definitions ........................................ <a href="#page-8">8</a>
<a href="#section-5.1">5.1</a>. VTSManager .............................................. <a href="#page-8">8</a>
<a href="#section-5.1.1">5.1.1</a>. getParticipantRepository ......................... <a href="#page-8">8</a>
<a href="#section-5.1.2">5.1.2</a>. getVoucherComponentRepository .................... <a href="#page-8">8</a>
<a href="#section-5.2">5.2</a>. ParticipantRepository ................................... <a href="#page-9">9</a>
<a href="#section-5.2.1">5.2.1</a>. lookup ........................................... <a href="#page-9">9</a>
<a href="#section-5.3">5.3</a>. Participant ............................................. <a href="#page-9">9</a>
<a href="#section-5.3.1">5.3.1</a>. getIdentifier .................................... <a href="#page-10">10</a>
<a href="#section-5.3.2">5.3.2</a>. getVTSAgent ...................................... <a href="#page-10">10</a>
<a href="#section-5.4">5.4</a>. VTSAgent ................................................ <a href="#page-10">10</a>
<a href="#section-5.4.1">5.4.1</a>. login ............................................ <a href="#page-11">11</a>
<a href="#section-5.4.2">5.4.2</a>. logout ........................................... <a href="#page-12">12</a>
<a href="#section-5.4.3">5.4.3</a>. prepare .......................................... <a href="#page-12">12</a>
<a href="#section-5.4.4">5.4.4</a>. issue ............................................ <a href="#page-13">13</a>
<a href="#section-5.4.5">5.4.5</a>. transfer ......................................... <a href="#page-14">14</a>
<a href="#section-5.4.6">5.4.6</a>. consume .......................................... <a href="#page-15">15</a>
<a href="#section-5.4.7">5.4.7</a>. present .......................................... <a href="#page-16">16</a>
<a href="#section-5.4.8">5.4.8</a>. cancel ........................................... <a href="#page-17">17</a>
<a href="#section-5.4.9">5.4.9</a>. resume ........................................... <a href="#page-18">18</a>
<a href="#section-5.4.10">5.4.10</a>. create .......................................... <a href="#page-18">18</a>
<a href="#section-5.4.11">5.4.11</a>. delete .......................................... <a href="#page-19">19</a>
<a href="#section-5.4.12">5.4.12</a>. getContents ..................................... <a href="#page-19">19</a>
<a href="#section-5.4.13">5.4.13</a>. getSessions ..................................... <a href="#page-19">19</a>
<a href="#section-5.4.14">5.4.14</a>. getLog .......................................... <a href="#page-20">20</a>
<a href="#section-5.4.15">5.4.15</a>. addReceptionListener ............................ <a href="#page-20">20</a>
<a href="#section-5.4.16">5.4.16</a>. removeReceptionListener ......................... <a href="#page-21">21</a>
<a href="#section-5.5">5.5</a>. Session ................................................. <a href="#page-21">21</a>
<a href="#section-5.5.1">5.5.1</a>. getIdentifier .................................... <a href="#page-21">21</a>
<a href="#section-5.5.2">5.5.2</a>. getVoucher ....................................... <a href="#page-22">22</a>
<a href="#section-5.5.3">5.5.3</a>. getSender ........................................ <a href="#page-22">22</a>
<a href="#section-5.5.4">5.5.4</a>. getReceiver ...................................... <a href="#page-22">22</a>
<a href="#section-5.5.5">5.5.5</a>. isPrepared ....................................... <a href="#page-22">22</a>
<a href="#section-5.5.6">5.5.6</a>. isActivated ...................................... <a href="#page-23">23</a>
<a href="#section-5.5.7">5.5.7</a>. isSuspended ...................................... <a href="#page-23">23</a>
<a href="#section-5.5.8">5.5.8</a>. isCompleted ...................................... <a href="#page-23">23</a>
<a href="#section-5.6">5.6</a>. Voucher ................................................. <a href="#page-23">23</a>
<a href="#section-5.6.1">5.6.1</a>. getIssuer ........................................ <a href="#page-23">23</a>
<a href="#section-5.6.2">5.6.2</a>. getPromise ....................................... <a href="#page-24">24</a>
<a href="#section-5.6.3">5.6.3</a>. getCount ......................................... <a href="#page-24">24</a>
<a href="#section-5.7">5.7</a>. VoucherComponentRepository .............................. <a href="#page-24">24</a>
<a href="#section-5.7.1">5.7.1</a>. register ......................................... <a href="#page-24">24</a>
<a href="#section-5.8">5.8</a>. VoucherComponent ........................................ <a href="#page-25">25</a>
<span class="grey">Terada & Fujimura Informational [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<a href="#section-5.8.1">5.8.1</a>. getIdentifier .................................... <a href="#page-25">25</a>
<a href="#section-5.8.2">5.8.2</a>. getDocument ...................................... <a href="#page-26">26</a>
<a href="#section-5.9">5.9</a>. ReceptionListener ....................................... <a href="#page-26">26</a>
<a href="#section-5.9.1">5.9.1</a>. arrive ........................................... <a href="#page-26">26</a>
<a href="#section-5.10">5.10</a>. Exceptions ............................................. <a href="#page-27">27</a>
<a href="#section-6">6</a>. Example Code ................................................. <a href="#page-28">28</a>
<a href="#section-7">7</a>. Security Considerations ...................................... <a href="#page-29">29</a>
<a href="#section-8">8</a>. Acknowledgements ............................................. <a href="#page-30">30</a>
<a href="#section-9">9</a>. Normative References ......................................... <a href="#page-30">30</a>
<a href="#section-10">10</a>. Informative References ....................................... <a href="#page-30">30</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
This document specifies the Voucher Trading System Application
Programming Interface (VTS-API). The motivation and background of
the Voucher Trading System (VTS) are described in Requirements for
Generic Voucher Trading [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>].
A voucher is a logical entity that represents a certain right, and it
is logically managed by the VTS. A voucher is generated by the
issuer, traded among users, and finally collected using VTS. The
terminology and model of the VTS are also described in [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>].
VTSes can be implemented in different ways, such as a centralized
VTS, which uses a centralized online server to store and manage all
vouchers, or a distributed VTS, which uses per-user smartcards to
maintain the vouchers owned by each user. However, the VTS-API
allows a caller application to issue, transfer, and redeem vouchers
in a uniform manner independent of the VTS implementation. Several
attempts have been made to provide a generic payment API. Java
Commerce Client [<a href="#ref-JCC" title=""The Gateway Security Model in the Java Electronic Commerce Framework"">JCC</a>] and Generic Payment Service Framework [<a href="#ref-GPSF" title=""SEMPER - Secure Electronic Marketplace for Europe,"">GPSF</a>],
for example, introduce a modular wallet architecture that permits
diverse types of payment modules to be added as plug-ins and supports
both check-like/cash-like payment models. This document is inspired
by these approaches but its scope is limited to the VTS model, in
which the cash-like payment model is assumed and vouchers are
directly or indirectly transferred between the sender (transferor)
and receiver (transferee) via the VTS. This document is not intended
to support API for SET, e-check, or other payment schemes that do not
fit the VTS model.
Unlike the APIs provided in JCC and GPSF, which are designed to
transfer only monetary values, this API enables the transfer of a
wide range of values through the use of XML-based Generic Voucher
Language [<a href="#ref-GVL" title=""XML Voucher: Generic Voucher Language"">GVL</a>]. The monetary meaning of the voucher is interpreted
by the upper application layer using the information described in the
language. This approach makes it possible to provide a simpler API
in the voucher-transfer layer and enhances runtime efficiency. The
<span class="grey">Terada & Fujimura Informational [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
API specification in this document is described in the Java language
syntax. Bindings for other programming languages may be completed in
a future version of this document or in separate related
specifications.
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 [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>]
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Processing Model</span>
This section provides the processing model in which the VTS-API is
used. A part of the text in this section has been taken from the
Generic Voucher Language specification [<a href="#ref-GVL" title=""XML Voucher: Generic Voucher Language"">GVL</a>].
There are several ways to implement VTS. For discount coupons or
event tickets, for example, a smartcard-based distributed offline VTS
is often preferred, whereas for bonds or securities, a centralized
online VTS is preferred. While distributed VTSes would utilize
public (asymmetric) key-based or shared (symmetric) key-based
cryptographic challenge-and-response protocols to trade vouchers
securely, centralized VTSes would utilize transactions that rewrite
ownerships of vouchers on their database. Therefore, it is
impractical to define standard protocols for issuing, transferring,
or redeeming vouchers at this time.
To provide implementation flexibility, this document assumes a
modular wallet architecture that allows multiple VTSes to be added as
plug-ins. In this architecture, instead of specifying a standard
voucher transfer protocol, two specifications, Voucher Component and
VTS-API, are standardized (Figure 1).
<span class="grey">Terada & Fujimura Informational [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Sender wallet/Issuing system Receiver wallet/Collecting system
+---------------------------+ +---------------------------+
| | | |
| | Voucher Component | |
| | (Specifies VTS Provider and Promise) | |
| |-------------------------------------------------------->| |
| | | | | |
| | Intention to receive and payment (option) | |
| |<- - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
| | | | | |
| | | | | |
| | Issue/transfer/ VTS | | VTS Register | |
| | redeem request plug-in | plug-in Listener(*1)| |
| |------------------>| | | |<------------------| |
| | (VTS API) |<- - - - - - - ->| (VTS API) | |
| | | VTS-specific | | |
| | | protocol if VTS | | |
| | | is distributed | | |
| | Result |<- - - - - - - ->| Notify(*2) | |
| |<------------------| | | |------------------>| |
+---------------------------+ +---------------------------+
(*1) Registration is optional. Note also that the VTS plug-ins are
usually pre-registered when the wallet or collecting system
is started.
(*2) If a listener is registered.
Figure 1. Wallet architecture with VTS plug-ins
In this architecture, a VTS provides a logical view of vouchers
called a Valid Voucher Set (VVS), which is a set that includes the
vouchers <I,P,H> managed by the VTS [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>]. A user's wallet can
access (e.g., view, transfer, and redeem) the subset of the VVS that
includes a set of vouchers owned by the user by interacting with the
VTS plug-in via the VTS-API. Likewise, an issuing system can issue a
voucher and add it to the VVS, and a collecting system can be
notified of the redemption of vouchers via the VTS-API.
After a sender and a receiver agree on what vouchers are to be traded
and which VTS is to be used, the issuing system or wallet system
requests the corresponding VTS plug-in to permit the issue, transfer,
or redemption transactions to be performed via the VTS-API. The VTS
then logically rewrites the ownership of the vouchers on the VVS
using the VTS-specific protocol. Since the VTS is responsible for
preventing illegal acts on vouchers like forgery or reproduction, as
required in [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>], the protocol would include a cryptographic
challenge-and-response (in a distributed VTS) or a transactional
<span class="grey">Terada & Fujimura Informational [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
database manipulation with adequate access controls (in a centralized
VTS). Finally, a completion event is sent to the wallet systems or
issuing/collecting systems.
This document describes the VTS-API specification. See [<a href="#ref-GVL" title=""XML Voucher: Generic Voucher Language"">GVL</a>] for the
Voucher Component specification that gives the syntax and semantics
for describing and interpreting the meaning of vouchers.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. Design Overview</span>
We have adopted the following approach to specify the VTS-API.
1) Provide an abstract and uniform API that encapsulates the VTS
implementation. For example, a common API is provided for both
centralized and distributed VTSes. Issuers and application
developers have more freedom in VTS selection.
2) To provide an abstract and uniform API, this document
introduces an interface called VTSAgent that is associated with
a holder and provides methods to manipulate vouchers held by
its holder. Vouchers are accessed through the methods provided
by the VTSAgent.
3) Use existing standards for the VTS branding mechanism
(negotiation). This document assumes that the VTS to be used
for sending a voucher has settled the VTS-APIs are called.
Negotiation can be done within the upper application layer
using other standards (e.g., [<a href="#ref-IOTP" title=""Internet Open Trading Protocol - IOTP Version 1.0"">IOTP</a>] or [<a href="#ref-ECML" title=""Electronic Commerce Modeling Language (ECML) Version 2 Specification"">ECML</a>]), if necessary.
4) Support only the push-type voucher transfer interface, in which
the voucher transfer session is initiated by the transferor
side. A pull-type voucher transfer interface can be
implemented on top of the push-type VTS interface at the
application level.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. Concepts</span>
The VTS-API consists of the following interfaces. A VTS is required
to implement all of the interfaces except ReceptionListener, which is
intended to be implemented by wallets or other applications that use
VTS.
VTSManager
Provides the starting point for using a VTS plug-in. All of
the objects needed to manipulate vouchers can be directly or
indirectly acquired via the VTSManager. A VTSManager maintains
the two repositories: a ParticipantRepository and a
VoucherComponentRepository, both of which are described below.
<span class="grey">Terada & Fujimura Informational [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
ParticipantRepository
Provides the access points of participants that are to be
trading partners. A ParticipantRepository maintains
Participants and acts as an "address book" of trading partners.
Participant
Represents a participant (such as an issuer, a holder, or a
collector). A Participant interface knows how to obtain the
corresponding VTSAgent described below.
VTSAgent (extends Participant)
Provides the access point of vouchers in the Valid Voucher Set
(VVS) that is logically managed by the VTS. A VTSAgent
provides a means of manipulating vouchers held by its holder
according to basic trading methods; i.e., issue, transfer,
consume, and present. Before calling trading methods, the
application must create a Session, which is described below.
Session
Represents the logical connection established by the trade. A
Session has references to two Participant interfaces; i.e.,
those of the sender and the receiver. After trading methods
are called using a Session, the Session holds a reference to
the Vouchers to be traded.
Voucher
Represents one or more vouchers in which all of the issuer and
promise parts of the vouchers are the same. A Voucher holds
references to the Participant interface who issued the voucher
(issuer) and to a VoucherComponent (promise), which is
described below.
VoucherComponent
Represents a Voucher Component, described in [<a href="#ref-GVL" title=""XML Voucher: Generic Voucher Language"">GVL</a>]. It defines
the promise part of the voucher.
VoucherComponentRepository
Provides the access points of VoucherComponents. A
VoucherComponentRepository maintains VoucherComponents and acts
as a "voucher type book" managed by the VTS. This document
assumes that a set of VoucherComponents has been acquired and
stored in this repository. Delivery of VoucherComponents is
beyond the scope of this document. It may be delivered within
the VTS from the trading partners or manually acquired from a
trusted third party (see Section 3 of [<a href="#ref-GVL" title=""XML Voucher: Generic Voucher Language"">GVL</a>]).
<span class="grey">Terada & Fujimura Informational [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
ReceptionListener
Provides a listener function with regard to the receipt of a
voucher by a VTSAgent to wallets or other applications that
implement this interface. (This interface may not be
implemented as part of the VTS.)
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. Interface Definitions</span>
The interfaces defined in this document reside in the package named
"org.ietf.vts". Wallets or other applications that use this API,
should import this package as "import org.ietf.vts.*;".
<span class="h3"><a class="selflink" id="section-5.1" href="#section-5.1">5.1</a>. VTSManager</span>
public interface VTSManager
Provides the starting point for using a VTS plug-in.
All of the objects needed to manipulate vouchers can be directly
or indirectly acquired via a VTSManager so that wallets or other
applications can make the VTS available by instantiating an object
implementing this interface.
A class that implements the VTSManager interface must have a
public default constructor (a constructor without any parameters).
The VTS provides a name for such a constructor so that the
implementation class can bootstrap the interface.
<span class="h4"><a class="selflink" id="section-5.1.1" href="#section-5.1.1">5.1.1</a>. getParticipantRepository</span>
public ParticipantRepository getParticipantRepository()
Returns a repository that maintains Participants.
Returns:
the ParticipantRepository of the VTS, or null if no
ParticipantRepository is available.
<span class="h4"><a class="selflink" id="section-5.1.2" href="#section-5.1.2">5.1.2</a>. getVoucherComponentRepository</span>
public VoucherComponentRepository getVoucherComponentRepository()
Returns a repository that maintains VoucherComponents.
<span class="grey">Terada & Fujimura Informational [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Returns:
the VoucherComponentRepository of the VTS, or null if no
VoucherComponentRepository is available.
<span class="h3"><a class="selflink" id="section-5.2" href="#section-5.2">5.2</a>. ParticipantRepository</span>
public interface ParticipantRepository
Provides the access points of Participants. A
ParticipantRepository maintains Participants and acts as an
"address book" of trading partners.
The object implementing this interface maintains Participants (or
holds a reference to an object maintaining Participants), which
are to be trading partners.
The implementation of a ParticipantRepository may be either (an
adaptor to) "yellow pages", which is a network-wide directory
service like LDAP, or "pocket address book", which maintains only
personal acquaintances.
<span class="h4"><a class="selflink" id="section-5.2.1" href="#section-5.2.1">5.2.1</a>. lookup</span>
public Participant lookup(String id)
Retrieves the participant that has the specified id.
Returns:
the participant associated with the specified id, or null if the
id is null or the corresponding participant cannot be found.
<span class="h3"><a class="selflink" id="section-5.3" href="#section-5.3">5.3</a>. Participant</span>
public interface Participant
Represents the participants (such as issuers, holders, and
collectors).
This interface is used as a representation of the trade partners
and issuers of vouchers. Anyone can retrieve objects that
implement Participants from the participant repository.
<span class="grey">Terada & Fujimura Informational [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.3.1" href="#section-5.3.1">5.3.1</a>. getIdentifier</span>
public String getIdentifier()
Returns the identifier of the participant. Each participant must
have a unique identifier.
The identifier can be used for looking up and retrieving the
participant via the ParticipantRepository.
The format of the identifier is implementation-specific.
Returns:
the identifier string of the participant.
<span class="h4"><a class="selflink" id="section-5.3.2" href="#section-5.3.2">5.3.2</a>. getVTSAgent</span>
VTSAgent getVTSAgent()
Returns a VTSAgent, whose identifier is the same as the identifier
of the participant.
Returns:
an object that implements the VTSAgent.
<span class="h3"><a class="selflink" id="section-5.4" href="#section-5.4">5.4</a>. VTSAgent</span>
public interface VTSAgent extends Participant
Represents contact points to access vouchers in a Valid Voucher
Set (VVS) that is managed by the VTS.
Each VTSAgent is associated with a holder and provides a means for
managing vouchers owned by the holder. The holder must be
authenticated using the login() method before being called by any
other method, otherwise, a VTSSecurityException will be issued.
Before any trading method is called, e.g., issue(), transfer(),
consume(), and present(), the application must establish a session
by the prepare() method.
Due to network failure, sessions may often be suspended when the
voucher is sent via a network. The suspended sessions can be
restarted by the resume() method. Details on the state management
of a session are described in <a href="#section-5.5">Section 5.5</a>.
<span class="grey">Terada & Fujimura Informational [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Some VTSAgents may not have all of the trading methods; a voucher
collecting system doesn't require its VTSAgent to provide a method
for issuing or creating vouchers. A VTSAgent returns a
FeatureNotAvailableException when an unsupported method is
invoked.
<span class="h4"><a class="selflink" id="section-5.4.1" href="#section-5.4.1">5.4.1</a>. login</span>
public void login(String passphrase)
throws VTSException
Authenticates the VTSAgent. The passphrase is specified if the
VTS requires it for authentication, otherwise it must be null.
Nothing is performed if the VTSAgent has already been logged-in.
The authentication scheme is implementation-specific. Examples of
the implementation are as follows:
1) Vouchers are managed on a remote centralized server
(centralized VTS), which requires a password to login. In this
case, the application may prompt the user to input the password
and the password can be given to the VTSAgent through this
method. For further information, see the Implementation Notes
below.
2) Vouchers are managed on a remote centralized server
(centralized VTS), which requires challenge-and-response
authentication using smartcards held by users. In this case,
the passphrase may be null because access to the smartcard can
be done without contacting the application or user (i.e., the
VTSAgent receives the challenge from the server, sends the
challenge to the smartcard (within the VTS), and returns the
response from the smartcard to the server). Note that a PIN to
unlock the smartcard may be given through this method,
depending on the implementation.
3) Each user holds their own smartcard in which their own vouchers
are stored (distributed VTS). In this case, the passphrase may
be null because no authentication is required. Note that a PIN
to unlock the smartcard may be given, though this depends on
the implementation.
Implementation Notes:
A VTS is responsible for providing secure ways for users to
login(). It is strongly recommended that secure communication
channels such as [<a href="#ref-TLS" title=""The TLS Protocol Version 1.0"">TLS</a>] be used if secret or private information
is sent via networks. Fake server attacks, including the so-
called MITM (man-in-the-middle), must be considered as well.
<span class="grey">Terada & Fujimura Informational [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Throws:
VTSSecurityException - if authentication fails.
<span class="h4"><a class="selflink" id="section-5.4.2" href="#section-5.4.2">5.4.2</a>. logout</span>
public void logout()
throws VTSException
Voids the authentication performed by the login() method.
After this method is called, calling any other method (except
login()) will cause a VTSSecurityException.
The VTSAgent can login again by the login() method.
Throws:
VTSSecurityException - if the VTSAgent is not authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.3" href="#section-5.4.3">5.4.3</a>. prepare</span>
public Session prepare(Participant receiver)
throws VTSException
Establishes a session that is required for trading vouchers. The
trading partner who receives the vouchers is specified as the
receiver. The vouchers to be traded will be specified later (when
a trading method is called).
The establishment of a session is implementation-specific. A
centralized VTS implementation may start a transaction, while a
distributed VTS implementation may get the challenge needed to
create an authentic response from the receiver in the following
trading method.
If the VTSAgent does not have the ability to establish a session
with the specified receiver (permanent error), the VTSAgent throws
an InvalidParticipantExeption. If the VTSAgent cannot establish a
session due to network failure (transient error), the VTSAgent
throws a CannotProceedException.
Parameters:
receiver - the trading partner who receives vouchers.
<span class="grey">Terada & Fujimura Informational [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Returns:
an established session whose state is "prepared" (see <a href="#section-5.5">Section</a>
<a href="#section-5.5">5.5</a>).
Throws:
CannotProceedException - if the preparation of the session is
aborted (e.g., network failures).
FeatureNotAvailableException - if the VTSAgent does not provide
any trading methods.
InvalidParticipantException - if the specified participant is
invalid.
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.4" href="#section-5.4.4">5.4.4</a>. issue</span>
public void issue(Session session,
VoucherComponent promise,
java.lang.Number num)
throws VTSException
Issues vouchers. This method creates the specified number of
vouchers <this, promise, receiver> and adds them to the VVS. If
the VTS is distributed, this method would create a "response" that
corresponds to the challenge received in the prepare() method and
send it to the receiver. Note that the receiver is specified when
prepare() is called. Nothing is performed if the specified number
is 0.
The session MUST be "prepared" when calling this method. The
state of the session will be "activated" when the vouchers are
created, and it will be "completed" when the transaction is
successfully completed or "suspended" if the transaction is
interrupted abnormally (e.g., network failures).
Parameters:
session - the session used by the issue transaction.
promise - the promise part of the voucher.
num - the number of vouchers to be issued.
<span class="grey">Terada & Fujimura Informational [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Throws:
CannotProceedException - if the transaction cannot be successfully
completed.
FeatureNotAvailableException - if the VTSAgent does not provide a
means of issuing vouchers.
InvalidStateException - if the session is not "prepared".
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.5" href="#section-5.4.5">5.4.5</a>. transfer</span>
public void transfer(Session session,
Participant issuer,
VoucherComponent promise,
java.lang.Number num)
throws VTSException
Transfers vouchers. This method rewrites the specified number of
vouchers <issuer, promise, this> to <issuer, promise, receiver> in
the VVS; i.e., deletes the vouchers from the sender and stores
them for the receiver. Similar to issue(), this method would
create and send the response to the receiver if the VTS is
distributed. The VTSAgent must have sufficient vouchers in the
VVS. Nothing is performed if the specified number is 0.
The session MUST be "prepared" when calling this method. The
state of the session will be "activated" when the voucher are
retrieved from the sender, and it will be "completed" when the
transaction is successfully completed or "suspended" if the
transaction is interrupted abnormally (e.g., network failures).
If null is specified for the issuer parameter, it indicates "any
issuer". This method selects vouchers to be transferred from the
set of vouchers returned by the getContents(null, promise).
<span class="grey">Terada & Fujimura Informational [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Parameters:
session - the session used by the transfer transaction.
issuer - the issuer part of the voucher, or null.
promise - the promise part of the voucher.
num - the number of vouchers to be transferred.
Throws:
CannotProceedException - if the transaction cannot be successfully
completed.
FeatureNotAvailableException - if the VTSAgent does not provide a
means of transferring vouchers.
InsufficientVoucherException - if the VTSAgent does not have a
sufficient number of vouchers to transfer.
InvalidStateException - if the session is not "prepared".
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.6" href="#section-5.4.6">5.4.6</a>. consume</span>
public void consume(Session session,
Participant issuer,
VoucherComponent promise,
java.lang.Number num)
throws VTSException
Consumes vouchers. This method deletes the specified number of
vouchers <issuer, promise, this> from the VVS and notifies the
receiver of the deletion. Similar to issue() and transfer(), the
response would be created and sent to the receiver if the VTS is
distributed so that the receiver can obtain proof of the deletion.
The VTSAgent must have a sufficient number of vouchers in the VVS.
Nothing is performed if the specified number is 0.
The session MUST be "prepared" when this method is called. The
state of the session will be "activated" when the vouchers are
deleted, and it will be "completed" when the transaction is
successfully completed or "suspended" if the transaction is
interrupted abnormally (e.g., network failures).
<span class="grey">Terada & Fujimura Informational [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
If null is specified for the issuer parameter, it indicates "any
issuer". This method selects vouchers to be consumed from the set
of vouchers returned by the getContents(null, promise).
Parameters:
session - the session used by the consume transaction.
issuer - the issuer part of the voucher, or null.
promise - the promise part of the voucher.
num - the number of vouchers to be consumed.
Throws:
CannotProceedException - if the transaction cannot be successfully
completed.
FeatureNotAvailableException - if the VTSAgent does not provide a
means of consuming vouchers.
InsufficientVoucherException - if the VTSAgent does not have a
sufficient number of vouchers to consume.
InvalidStateException - if the session is not "prepared".
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.7" href="#section-5.4.7">5.4.7</a>. present</span>
public void present(Session session,
Participant issuer,
VoucherComponent promise,
java.lang.Number num)
throws VTSException
Presents vouchers. This method shows that the sender has the
specified number of vouchers <issuer, promise, this> in the VVS to
the receiver of the session; no modification is performed to the
VVS. However, the response would be sent to the receiver as well
as consume() in order to prove that the VTS has been distributed.
The VTSAgent must have a sufficient number of vouchers in the VVS.
Nothing is performed if the specified number is 0.
The session MUST be "prepared" when this method is called. The
state of the session will be "activated" when the vouchers are
<span class="grey">Terada & Fujimura Informational [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
retrieved, and it will be "completed" when the transaction is
successfully completed or "suspended" if the transaction is
interrupted abnormally (e.g., by network failures).
If null is specified for the issuer parameter, it indicates "any
issuer". This method selects vouchers to be presented from the
set of vouchers returned by the getContents(null, promise).
Parameters:
session - the session used by the present transaction.
issuer - the issuer part of the voucher, or null.
promise - the promise part of the voucher.
num - the number of the voucher to be presented.
Throws:
CannotProceedException - if the transaction cannot be successfully
completed.
InsufficientVoucherException - if the VTSAgent does not have a
sufficient number of vouchers to present.
InvalidStateException - if the session is not "prepared".
FeatureNotAvailableException - if the VTSAgent does not provide a
means of presenting vouchers.
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.8" href="#section-5.4.8">5.4.8</a>. cancel</span>
public void cancel(Session session)
throws VTSException
Releases the session. "Prepared" sessions MUST be canceled. An
implementation MAY be permitted to cancel "activated" or
"suspended" sessions.
Throws:
InvalidStateException - if the state of the session cannot be
canceled.
<span class="grey">Terada & Fujimura Informational [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.9" href="#section-5.4.9">5.4.9</a>. resume</span>
public void resume(Session session)
throws VTSException
Restarts the session. Only "suspended" sessions can be resumed.
The state of the session will be re-"activated" immediately, and
it will be "completed" when the transaction is successfully
completed or "suspended" again if the transaction is interrupted
abnormally (e.g., network failures).
Throws:
CannotProceedException - if the transaction cannot be successfully
completed.
InvalidStateException - if the session is not "suspended".
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.10" href="#section-5.4.10">5.4.10</a>. create</span>
public void create(VoucherComponent promise, java.lang.Number num)
throws VTSException
Creates vouchers where the issuer is the VTSAgent itself. This
method creates the specified number of vouchers <this, promise,
this> and adds them to the VVS. Nothing is performed if the
specified number is 0.
Throws:
FeatureNotAvailableException - if the VTSAgent does not provide a
means of creating vouchers.
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="grey">Terada & Fujimura Informational [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.4.11" href="#section-5.4.11">5.4.11</a>. delete</span>
public void delete(Participant issuer, VoucherComponent promise,
java.lang.Number num)
throws VTSException
Deletes vouchers. This method deletes the specified number of
vouchers <issuer, promise, this> from the VVS. The VTSAgent must
have sufficient vouchers in the VVS. Nothing is performed if the
specified number is 0.
Throws:
InsufficientVoucherException - if the VTSAgent does not have a
sufficient number of vouchers to delete.
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.12" href="#section-5.4.12">5.4.12</a>. getContents</span>
public java.util.Set getContents(Participant issuer,
VoucherComponent promise)
throws VTSException
Returns the set of vouchers whose issuer and promise both match
the issuer and promise specified in the parameters.
If null is specified for the issuer or promise parameter, it
indicates "any issuer" or "any promise", respectively. If null is
specified for both parameters, this method selects all vouchers
owned by the holder from the VVS.
Returns:
the set of vouchers held by the holder of the VTSAgent.
Throws:
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.13" href="#section-5.4.13">5.4.13</a>. getSessions</span>
public java.util.Set getSessions()
throws VTSException
Returns a set of incomplete sessions prepared by the VTSAgent.
<span class="grey">Terada & Fujimura Informational [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Returns:
the set of sessions prepared by the VTSAgent that are not yet
completed.
Throws:
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.14" href="#section-5.4.14">5.4.14</a>. getLog</span>
public java.util.Set getLog()
throws VTSException
Returns a set of completed sessions prepared or received by the
VTSAgent. This set represents the trading log of the VTSAgent. A
VTS may delete an old log eventually, so that the entire log may
not be returned; the amount of the log kept by the VTSAgent is
implementation-specific.
Returns:
the set of completed sessions prepared or received by the
VTSAgent.
Throws:
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h4"><a class="selflink" id="section-5.4.15" href="#section-5.4.15">5.4.15</a>. addReceptionListener</span>
public void addReceptionListener(ReceptionListener l)
throws VTSException
Adds a ReceptionListener to the listener list.
After a ReceptionListener l is registered by this method,
l.arrive() will be called whenever the VTSAgent receives a
voucher.
Nothing is performed if the specified listener is null.
Throws:
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="grey">Terada & Fujimura Informational [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.4.16" href="#section-5.4.16">5.4.16</a>. removeReceptionListener</span>
public void removeReceptionListener(ReceptionListener l)
throws VTSException
Removes a ReceptionListener from the listener list.
Nothing is performed when the specified listener is null or not
registered.
Throws:
VTSSecurityException - if the VTSAgent cannot be authenticated
correctly.
<span class="h3"><a class="selflink" id="section-5.5" href="#section-5.5">5.5</a>. Session</span>
public interface Session
Represents the logical connection established by the trade.
Sessions are established by VTSAgent#prepare().
A session has four states: prepared, activated, suspended, and
completed. The initial state of a session is "prepared", and the
session will be "activated" immediately when any of the trading
methods of VTSAgent is called. The "activated" session will be
"completed" after the trading method is successfully completed.
If the trading method fails transiently (e.g., network failure),
the session will be "suspended". Suspended sessions can be re-
"activated" and restarted by calling VTSAgent#resume().
A completed session may disappear from the VTSAgent; the session
will be collected by the GC unless other objects keep its
reference.
<span class="h4"><a class="selflink" id="section-5.5.1" href="#section-5.5.1">5.5.1</a>. getIdentifier</span>
public String getIdentifier()
Returns the identifier of the session. The generation scheme of
the identifier is implementation-specific. An implementation may
use a transaction ID as the identifier of the session.
Returns:
the string of the identifier of the session.
<span class="grey">Terada & Fujimura Informational [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.5.2" href="#section-5.5.2">5.5.2</a>. getVoucher</span>
public Voucher getVoucher()
Returns the voucher to be traded using the session, or returns
null if the session has not been activated.
Returns:
the voucher to be traded, or null if the state of the session is
"prepared".
<span class="h4"><a class="selflink" id="section-5.5.3" href="#section-5.5.3">5.5.3</a>. getSender</span>
public Participant getSender()
Returns the sender of the session (i.e., the creator who prepared
the session).
Returns:
the sender of the session.
<span class="h4"><a class="selflink" id="section-5.5.4" href="#section-5.5.4">5.5.4</a>. getReceiver</span>
public Participant getReceiver()
Returns the receiver of the session (i.e., the participant
specified when preparing the session (by the VTSAgent#prepare()
method)).
Returns:
the receiver of the session.
<span class="h4"><a class="selflink" id="section-5.5.5" href="#section-5.5.5">5.5.5</a>. isPrepared</span>
public boolean isPrepared()
Verifies if the session is "prepared".
Returns:
true if the session is in the "prepared" state, otherwise, false.
<span class="grey">Terada & Fujimura Informational [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.5.6" href="#section-5.5.6">5.5.6</a>. isActivated</span>
public boolean isActivated()
Verifies if the session is "activated".
Returns:
true if the session is in the "activated" state, otherwise, false.
<span class="h4"><a class="selflink" id="section-5.5.7" href="#section-5.5.7">5.5.7</a>. isSuspended</span>
public boolean isSuspended()
Verifies if the session is "suspended".
Returns:
true if the session is in the "suspended" state, otherwise, false.
<span class="h4"><a class="selflink" id="section-5.5.8" href="#section-5.5.8">5.5.8</a>. isCompleted</span>
public boolean isCompleted()
Verifies if the session is "completed".
Returns:
true if the session is in the "completed" state, otherwise, false.
<span class="h3"><a class="selflink" id="section-5.6" href="#section-5.6">5.6</a>. Voucher</span>
public interface Voucher
Represents voucher(s) described in [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>]. An object implementing
this interface can represent more than one voucher if all of the
issuer part and the promise part of the vouchers are the same.
<span class="h4"><a class="selflink" id="section-5.6.1" href="#section-5.6.1">5.6.1</a>. getIssuer</span>
public Participant getIssuer()
Returns the issuer part of the voucher(s).
Returns:
the participant who issued the voucher(s).
<span class="grey">Terada & Fujimura Informational [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.6.2" href="#section-5.6.2">5.6.2</a>. getPromise</span>
public VoucherComponent getPromise()
Returns the promise part of the voucher(s).
Returns:
the voucher component that defines the promise of the voucher.
<span class="h4"><a class="selflink" id="section-5.6.3" href="#section-5.6.3">5.6.3</a>. getCount</span>
public java.lang.Number getCount()
Returns the number of the voucher(s).
Returns:
the positive (>0) number of the voucher(s).
<span class="h3"><a class="selflink" id="section-5.7" href="#section-5.7">5.7</a>. VoucherComponentRepository</span>
public interface VoucherComponentRepository
Maintains VoucherComponents.
An object implementing VoucherComponentRepository provides a means
of retrieving the voucher components that are the promises of
vouchers in the VVS.
Before issuing a voucher, the promise of the voucher must be
registered with this repository. The repository can be
implemented as either a network-wide directory service or personal
storage like the ParticipantRepository.
<span class="h4"><a class="selflink" id="section-5.7.1" href="#section-5.7.1">5.7.1</a>. register</span>
public VoucherComponent register(org.w3c.dom.Document document)
Creates a voucher component associated with the specified DOM
object and registers the voucher component with the repository.
A voucher component of the voucher to be issued must be registered
using this method.
Nothing is performed (and the method returns null) if the
specified document is null or the syntax of the document does not
conform to the VTS.
<span class="grey">Terada & Fujimura Informational [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
The method returns the registered voucher component if the
specified DOM object has been already registered (no new voucher
component is created in this case).
Returns:
a registered voucher component associated with the specified
document, or null if the document is null or has wrong syntax.
<span class="h3"><a class="selflink" id="section-5.8" href="#section-5.8">5.8</a>. VoucherComponent</span>
public interface VoucherComponent
Represents the voucher component that defines the promise of the
voucher.
Each VoucherComponent object has its own unique identifier and is
associated with an XML document that describes the promise made by
the issuer of the voucher (e.g., goods or services can be claimed
in exchange for redeeming the voucher).
This interface can be implemented as sort of a "smart pointer" to
the XML document. An implementation may have a reference to a
voucher component repository instead of the voucher component, and
it may retrieve the document dynamically from the repository when
the getDocument() method is called.
<span class="h4"><a class="selflink" id="section-5.8.1" href="#section-5.8.1">5.8.1</a>. getIdentifier</span>
public String getIdentifier()
Returns the identifier of the voucher component. Each voucher
component must have a unique identifier. The identifier may be
used to check for equivalence of voucher components.
The format of the identifier is implementation-specific, however,
it is RECOMMENDED that the hash value of the voucher component in
the identifier be included to assure uniqueness. For generating
the hash value, it is desirable to use a secure hash function
(e.g., [<a href="#ref-SHA-1" title=""FIPS PUB 180-1. Secure Hash Standard. U.S."">SHA-1</a>]) and to apply a canonicalization function (e.g.,
[<a href="#ref-EXC-C14N" title=""Exclusive XML Canonicalization Version 1.0"">EXC-C14N</a>]) before applying the hash function to minimize the
impact of insignificant format changes to the voucher component,
(e.g., line breaks or character encoding).
Returns:
the identifier string of the voucher component.
<span class="grey">Terada & Fujimura Informational [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
<span class="h4"><a class="selflink" id="section-5.8.2" href="#section-5.8.2">5.8.2</a>. getDocument</span>
public org.w3c.dom.Document getDocument()
Returns a Document Object Model [<a href="#ref-DOM" title=""Document Object Model (DOM) Level 1 Specification"">DOM</a>] representation of the
document associated with the voucher component by the
VoucherComponentRepository#register() method.
The DOM object to be returned may be retrieved from a
VoucherComponentRepository on demand, instead of the
VoucherComponent always keeping a reference to the DOM object.
The VTS must guarantee that the getDocument method will eventually
return the DOM object, provided that the voucher associated with
the corresponding voucher component exists in the VVS.
Returns:
a DOM representation of the document associated with the voucher
component.
Throws:
DocumentNotFoundException - if the associated DOM object cannot be
retrieved.
<span class="h3"><a class="selflink" id="section-5.9" href="#section-5.9">5.9</a>. ReceptionListener</span>
public interface ReceptionListener extends java.util.EventListener
Provides a listener interface with a notification that a VTSAgent
has received a voucher.
When a voucher arrives at the VTSAgent, the VTSAgent invokes the
arrive() method of each registered ReceptionListener.
ReceptionListeners can obtain a Session object, which contains
information about the received voucher and the sender of the
voucher.
This interface is intended to provide a means of notifying a
wallet that "You have new vouchers", so that this interface may be
implemented by wallets or other applications that use VTS.
<span class="h4"><a class="selflink" id="section-5.9.1" href="#section-5.9.1">5.9.1</a>. arrive</span>
public void arrive(Session session)
Provides notification of the arrival of a voucher.
<span class="grey">Terada & Fujimura Informational [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
After the listener is registered to a VTSAgent (by the
VTSAgent#addReceptionListener() method), the VTSAgent invokes this
method whenever it receives a voucher.
The specified session is equivalent to the session used by the
sender to trade the voucher. The state of the session is
"completed" when this method is called.
<span class="h3"><a class="selflink" id="section-5.10" href="#section-5.10">5.10</a>. Exceptions</span>
java.lang.Exception
+-- VTSException
+-- CannotProceedException
+-- DocumentNotFoundException
+-- FeatureNotAvailableException
+-- InsufficientVoucherException
+-- InvalidParticipantException
+-- InvalidStateException
+-- VTSSecurityException
VTSException
This is the superclass of all exceptions thrown by the methods in
the interfaces that construct the VTS-API.
CannotProceedException
This exception is thrown when a trading is interrupted by network
failures or other errors.
DocumentNotFoundException
This exception is thrown when the document associated with a
voucher component cannot be found.
FeatureNotAvailableException
This exception is thrown when the invoked method is not supported.
InsufficientVoucherException
This exception is thrown when the number of the voucher is less
than the number specified for trading.
InvalidParticipantException
This exception is thrown when the specified participant cannot be
located.
InvalidStateException
This exception is thrown when the state of the session is invalid
and the operation cannot proceed.
<span class="grey">Terada & Fujimura Informational [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
VTSSecurityException
This exception is thrown when authentication fails, or when a
method that requires authentication in advance is called without
authentication.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Example Code</span>
// Issue a voucher
VTSManager vts = new FooVTSManager();
ParticipantRepository addrBook = vts.getParticipantRepository();
VoucherComponentRepository vcr = vts.getVoucherComponentRepository();
Participant you = addrBook.lookup("http://example.org/foo");
// looks up a trading partner identified as
// "http://example.org/foo".
VTSAgent me = addrBook.lookup("myName").getVTSAgent();
// a short-cut name may be used if VTS implementation allows.
VoucherComponent promise = vcr.register(anXMLVoucherDocument);
// registers a voucher component that corresponds to the voucher
// to be issued.
try {
me.login();
// sets up the issuer's smartcard (assuming distributed VTS).
s = me.prepare(you);
// receives a challenge from the partner.
me.issue(s, promise, 1);
// sends a voucher using the received challenge.
me.logout();
} catch (VTSException e) {
// if an error (e.g., a network trouble) occurs...
System.err.println("Sorry.");
e.printStackTrace();
// this example simply prints a stack trace, but a real wallet
// may prompt the user to retry (or cancel).
}
// Transfer all my vouchers
VTSManager vts = new FooVTSManager();
ParticipantRepository addrBook = vts.getParticipantRepository();
Participant you = addrBook.lookup("8f42 5aab ffff cafe babe...");
// some VTS implementations would use a hash value of a public key
// (aka fingerprint) as an identifier of a participant.
VTSAgent me = addrBook.lookup("myName").getVTSAgent();
<span class="grey">Terada & Fujimura Informational [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
try {
me.login();
Iterator i = me.getContents(null, null).iterator();
while (i.hasNext()) {
Voucher v = (Voucher) i.next();
s = me.prepare(you);
me.transfer(s, v.getIssuer(), v.getPromise(), v.getCount());
}
me.logout();
} catch (VTSException e) {
System.err.println("Sorry.");
e.printStackTrace();
}
// Register an incoming voucher notifier (biff)
VTSManager vts = new FooVTSManager();
ParticipantRepository addrBook = vts.getParticipantRepository();
VTSAgent me = addrBook.lookup("myName").getVTSAgent();
ReceptionListener listener = new ReceptionListener() {
public void arrive(Session s) {
System.out.println("You got a new voucher.");
}
};
try {
me.login();
me.addReceptionListener(listener);
me.logout();
} catch (VTSException e) {
System.err.println("Sorry.");
e.printStackTrace();
}
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Security Considerations</span>
Security is very important for trading vouchers. VTS implementations
are responsible for preventing illegal acts upon vouchers (as
described in [<a href="#ref-VTS" title=""Requirements and Design for Voucher Trading System (VTS)"">VTS</a>]), as well as preventing malicious access from
invalid users and fake server attacks, including man-in-the-middle
attacks.
The means to achieve the above requirements are not specified in this
document because they depend on VTS implementation. However,
<span class="grey">Terada & Fujimura Informational [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
securing communication channels (e.g., using TLS) between client VTS
plug-ins and the central server in a centralized VTS (as described in
5.4.1 login()), and applying cryptographic challenge-and-response
techniques in a distributed VTS are likely to be helpful and are
strongly recommended to implement a secure VTS.
This document assumes that the VTS plug-in is trusted by its user.
The caller application of a VTS should authenticate the VTS plug-in
and bind it securely using the VTS Provider information specified in
the Voucher Component. This document, however, does not specify any
application authentication scheme and it is assumed to be specified
by other related standards. Until various VTS systems are deployed,
it is enough to manually check and install VTS plug-ins like other
download applications.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. Acknowledgements</span>
The following persons, in alphabetic order, contributed substantially
to the material herein:
Donald Eastlake 3rd
Iguchi Makoto
Yoshitaka Nakamura
Ryuji Shoda
<span class="h2"><a class="selflink" id="section-9" href="#section-9">9</a>. Normative References</span>
[<a id="ref-DOM">DOM</a>] V. Apparao, S. Byrne, M. Champion, S. Isaacs, I. Jacobs,
A. Le Hors, G. Nicol, J. Robie, R. Sutor, C. Wilson, and
L. Wood. "Document Object Model (DOM) Level 1
Specification", W3C Recommendation, October 1998,
<<a href="http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/">http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/</a>>
[<a id="ref-GVL">GVL</a>] Fujimura, K. and M. Terada, "XML Voucher: Generic Voucher
Language", <a href="./rfc4153">RFC 4153</a>, September 2005.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
<span class="h2"><a class="selflink" id="section-10" href="#section-10">10</a>. Informative References</span>
[<a id="ref-ECML">ECML</a>] Eastlake 3rd, D., "Electronic Commerce Modeling Language
(ECML) Version 2 Specification", <a href="./rfc4112">RFC 4112</a>, June 2005.
[<a id="ref-EXC-C14N">EXC-C14N</a>] J. Boyer, D. Eastlake, and J. Reagle, "Exclusive XML
Canonicalization Version 1.0", W3C Recommendation, July
2002, <<a href="http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/">http://www.w3.org/TR/2002/REC-xml-exc-c14n-</a>
<a href="http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/">20020718/</a>>
<span class="grey">Terada & Fujimura Informational [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
[<a id="ref-GPSF">GPSF</a>] G. Lacoste, B. Pfitzmann, M. Steiner, and M. Waidner
(Eds.), "SEMPER - Secure Electronic Marketplace for
Europe," LNCS 1854, Springer-Verlag, 2000.
[<a id="ref-IOTP">IOTP</a>] Burdett, D., "Internet Open Trading Protocol - IOTP
Version 1.0", <a href="./rfc2801">RFC 2801</a>, April 2000.
[<a id="ref-JCC">JCC</a>] T. Goldstein, "The Gateway Security Model in the Java
Electronic Commerce Framework", Proc. of Financial
Cryptography '97, 1997.
[<a id="ref-SHA-1">SHA-1</a>] Department of Commerce/National Institute of Standards and
Technology, "FIPS PUB 180-1. Secure Hash Standard. U.S.",
<<a href="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf">http://csrc.nist.gov/publications/fips/fips180-2/</a>
<a href="http://csrc.nist.gov/publications/fips/fips180-2/fips180-2withchangenotice.pdf">fips180-2withchangenotice.pdf</a>>
[<a id="ref-TLS">TLS</a>] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0",
<a href="./rfc2246">RFC 2246</a>, January 1999.
[<a id="ref-VTS">VTS</a>] Fujimura, K. and D. Eastlake, "Requirements and Design for
Voucher Trading System (VTS)", <a href="./rfc3506">RFC 3506</a>, March 2003.
Authors' Addresses
Masayuki Terada
NTT DoCoMo, Inc.
3-5 Hikari-no-oka, Yokosuka-shi, Kanagawa, 239-8536 JAPAN
Phone: +81-(0)46-840-3809
Fax: +81-(0)46-840-3705
EMail: te@rex.yrp.nttdocomo.co.jp
Ko Fujimura
NTT Corporation
1-1 Hikari-no-oka, Yokosuka-shi, Kanagawa, 239-0847 JAPAN
Phone: +81-(0)46-859-3053
Fax: +81-(0)46-859-1730
EMail: fujimura.ko@lab.ntt.co.jp
<span class="grey">Terada & Fujimura Informational [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc4154">RFC 4154</a> VTS-API September 2005</span>
Full Copyright Statement
Copyright (C) The Internet Society (2005).
This document is subject to the rights, licenses and restrictions
contained in <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a>, 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 <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and <a href="https://www.rfc-editor.org/bcp/bcp79">BCP 79</a>.
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
<a href="http://www.ietf.org/ipr">http://www.ietf.org/ipr</a>.
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.
Terada & Fujimura Informational [Page 32]
</pre>
|