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
  
     | 
    
      <pre>Network Working Group                                             L. Zhu
Request for Comments: 4556                         Microsoft Corporation
Category: Standards Track                                        B. Tung
                                                   Aerospace Corporation
                                                               June 2006
                      <span class="h1">Public Key Cryptography for</span>
              <span class="h1">Initial Authentication in Kerberos (PKINIT)</span>
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 (2006).
Abstract
   This document describes protocol extensions (hereafter called PKINIT)
   to the Kerberos protocol specification.  These extensions provide a
   method for integrating public key cryptography into the initial
   authentication exchange, by using asymmetric-key signature and/or
   encryption algorithms in pre-authentication data fields.
Table of Contents
   <a href="#section-1">1</a>. Introduction ....................................................<a href="#page-2">2</a>
   <a href="#section-2">2</a>. Conventions Used in This Document ...............................<a href="#page-4">4</a>
   <a href="#section-3">3</a>. Extensions ......................................................<a href="#page-5">5</a>
      <a href="#section-3.1">3.1</a>. Definitions, Requirements, and Constants ...................<a href="#page-6">6</a>
           <a href="#section-3.1.1">3.1.1</a>. Required Algorithms .................................<a href="#page-6">6</a>
           <a href="#section-3.1.2">3.1.2</a>. Recommended Algorithms ..............................<a href="#page-6">6</a>
           <a href="#section-3.1.3">3.1.3</a>. Defined Message and Encryption Types ................<a href="#page-7">7</a>
           3.1.4. Kerberos Encryption Types Defined for CMS
                  Algorithm Identifiers ...............................<a href="#page-8">8</a>
      <a href="#section-3.2">3.2</a>. PKINIT Pre-authentication Syntax and Use ...................<a href="#page-9">9</a>
           <a href="#section-3.2.1">3.2.1</a>. Generation of Client Request ........................<a href="#page-9">9</a>
           <a href="#section-3.2.2">3.2.2</a>. Receipt of Client Request ..........................<a href="#page-14">14</a>
           <a href="#section-3.2.3">3.2.3</a>. Generation of KDC Reply ............................<a href="#page-18">18</a>
                  <a href="#section-3.2.3.1">3.2.3.1</a>. Using Diffie-Hellman Key Exchange .........<a href="#page-21">21</a>
                  <a href="#section-3.2.3.2">3.2.3.2</a>. Using Public Key Encryption ...............<a href="#page-23">23</a>
<span class="grey">Zhu & Tung                  Standards Track                     [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
           <a href="#section-3.2.4">3.2.4</a>. Receipt of KDC Reply ...............................<a href="#page-25">25</a>
      <a href="#section-3.3">3.3</a>. Interoperability Requirements .............................<a href="#page-26">26</a>
      <a href="#section-3.4">3.4</a>. KDC Indication of PKINIT Support ..........................<a href="#page-27">27</a>
   <a href="#section-4">4</a>. Security Considerations ........................................<a href="#page-27">27</a>
   <a href="#section-5">5</a>. Acknowledgements ...............................................<a href="#page-30">30</a>
   <a href="#section-6">6</a>. References .....................................................<a href="#page-30">30</a>
      <a href="#section-6.1">6.1</a>. Normative References ......................................<a href="#page-30">30</a>
      <a href="#section-6.2">6.2</a>. Informative References ....................................<a href="#page-32">32</a>
   <a href="#appendix-A">Appendix A</a>.  PKINIT ASN.1 Module ..................................<a href="#page-33">33</a>
   <a href="#appendix-B">Appendix B</a>.  Test Vectors .........................................<a href="#page-38">38</a>
   <a href="#appendix-C">Appendix C</a>.  Miscellaneous Information about Microsoft Windows
                PKINIT Implementations ...............................<a href="#page-40">40</a>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>.  Introduction</span>
   The Kerberos V5 protocol [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] involves use of a trusted third
   party known as the Key Distribution Center (KDC) to negotiate shared
   session keys between clients and services and provide mutual
   authentication between them.
   The corner-stones of Kerberos V5 are the Ticket and the
   Authenticator.  A Ticket encapsulates a symmetric key (the ticket
   session key) in an envelope (a public message) intended for a
   specific service.  The contents of the Ticket are encrypted with a
   symmetric key shared between the service principal and the issuing
   KDC.  The encrypted part of the Ticket contains the client principal
   name, among other items.  An Authenticator is a record that can be
   shown to have been recently generated using the ticket session key in
   the associated Ticket.  The ticket session key is known by the client
   who requested the ticket.  The contents of the Authenticator are
   encrypted with the associated ticket session key.  The encrypted part
   of an Authenticator contains a timestamp and the client principal
   name, among other items.
   As shown in Figure 1, below, the Kerberos V5 protocol consists of the
   following message exchanges between the client and the KDC, and the
   client and the application service:
    - The Authentication Service (AS) Exchange
      The client obtains an "initial" ticket from the Kerberos
      authentication server (AS), typically a Ticket Granting Ticket
      (TGT).  The AS-REQ message and the AS-REP message are the request
      and the reply message, respectively, between the client and the
      AS.
<span class="grey">Zhu & Tung                  Standards Track                     [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
    - The Ticket Granting Service (TGS) Exchange
      The client subsequently uses the TGT to authenticate and request a
      service ticket for a particular service, from the Kerberos
      ticket-granting server (TGS).  The TGS-REQ message and the TGS-REP
      message are the request and the reply message respectively between
      the client and the TGS.
    - The Client/Server Authentication Protocol (AP) Exchange
      The client then makes a request with an AP-REQ message, consisting
      of a service ticket and an authenticator that certifies the
      client's possession of the ticket session key.  The server may
      optionally reply with an AP-REP message.  AP exchanges typically
      negotiate session-specific symmetric keys.
   Usually, the AS and TGS are integrated in a single device also known
   as the KDC.
                          +--------------+
               +--------->|  KDC         |
       AS-REQ /   +-------|              |
             /   /        +--------------+
            /   /          ^           |
           /    |AS-REP   /            |
          |     |        / TGS-REQ     + TGS-REP
          |     |       /             /
          |     |      /             /
          |     |     /   +---------+
          |     |    /   /
          |     |   /   /
          |     |  /   /
          |     v /   v
         ++-------+------+             +-----------------+
         |  Client       +------------>|  Application    |
         |               |    AP-REQ   |  Server         |
         |               |<------------|                 |
         +---------------+    AP-REP   +-----------------+
       Figure 1:  The Message Exchanges in the Kerberos V5 Protocol
   In the AS exchange, the KDC reply contains the ticket session key,
   among other items, that is encrypted using a key (the AS reply key)
   shared between the client and the KDC.  The AS reply key is typically
   derived from the client's password for human users.  Therefore, for
   human users, the attack resistance strength of the Kerberos protocol
   is no stronger than the strength of their passwords.
<span class="grey">Zhu & Tung                  Standards Track                     [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   The use of asymmetric cryptography in the form of X.509 certificates
   [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] is popular for facilitating data origin authentication and
   perfect secrecy.  An established Public Key Infrastructure (PKI)
   provides key management and key distribution mechanisms that can be
   used to establish authentication and secure communication.  Adding
   public-key cryptography to Kerberos provides a nice congruence to
   public-key protocols, obviates the human users' burden to manage
   strong passwords, and allows Kerberized applications to take
   advantage of existing key services and identity management.
   The advantage afforded by the Kerberos TGT is that the client exposes
   his long-term secrets only once.  The TGT and its associated session
   key can then be used for any subsequent service ticket requests.  One
   result of this is that all further authentication is independent of
   the method by which the initial authentication was performed.
   Consequently, initial authentication provides a convenient place to
   integrate public-key cryptography into Kerberos authentication.  In
   addition, the use of symmetric cryptography after the initial
   exchange is preferred for performance.
   This document describes the methods and data formats using which the
   client and the KDC can use public and private key pairs to mutually
   authenticate in the AS exchange and negotiate the AS reply key, known
   only by the client and the KDC, to encrypt the AS-REP sent by the
   KDC.
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>.  Conventions Used in This Document</span>
   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>].
   In this protocol, both the client and the KDC have a public-private
   key pair in order to prove their identities to each other over the
   open network.  The term "signature key" is used to refer to the
   private key of the key pair being used.
   The encryption key used to encrypt the enc-part field of the KDC-REP
   in the AS-REP [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] is referred to as the AS reply key.
   An empty sequence in an optional field can be either included or
   omitted: both encodings are permitted and considered equivalent.
   The term "Modular Exponential Diffie-Hellman" is used to refer to the
   Diffie-Hellman key exchange, as described in [<a href="./rfc2631" title=""Diffie-Hellman Key Agreement Method"">RFC2631</a>], in order to
   differentiate it from other equivalent representations of the same
   key agreement algorithm.
<span class="grey">Zhu & Tung                  Standards Track                     [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>.  Extensions</span>
   This section describes extensions to [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] for supporting the use
   of public-key cryptography in the initial request for a ticket.
   Briefly, this document defines the following extensions to [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]:
   1. The client indicates the use of public-key authentication by
      including a special preauthenticator in the initial request.  This
      preauthenticator contains the client's public-key data and a
      signature.
   2. The KDC tests the client's request against its authentication
      policy and trusted Certification Authorities (CAs).
   3. If the request passes the verification tests, the KDC replies as
      usual, but the reply is encrypted using either:
      a. a key generated through a Diffie-Hellman (DH) key exchange
         [<a href="./rfc2631" title=""Diffie-Hellman Key Agreement Method"">RFC2631</a>] [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>] with the client, signed using the KDC's
         signature key; or
      b. a symmetric encryption key, signed using the KDC's signature
         key and encrypted using the client's public key.
      Any keying material required by the client to obtain the
      encryption key for decrypting the KDC reply is returned in a pre-
      authentication field accompanying the usual reply.
   4. The client validates the KDC's signature, obtains the encryption
      key, decrypts the reply, and then proceeds as usual.
   <a href="#section-3.1">Section 3.1</a> of this document enumerates the required algorithms and
   necessary extension message types.  <a href="#section-3.2">Section 3.2</a> describes the
   extension messages in greater detail.
<span class="grey">Zhu & Tung                  Standards Track                     [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>.  Definitions, Requirements, and Constants</span>
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a>.  Required Algorithms</span>
   All PKINIT implementations MUST support the following algorithms:
   o  AS reply key enctypes: aes128-cts-hmac-sha1-96 and aes256-cts-
      hmac-sha1-96 [<a href="./rfc3962" title=""Advanced Encryption Standard (AES) Encryption for Kerberos 5"">RFC3962</a>].
   o  Signature algorithm: sha-1WithRSAEncryption [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>].
   o  AS reply key delivery method: the Diffie-Hellman key delivery
      method, as described in <a href="#section-3.2.3.1">Section 3.2.3.1</a>.
   In addition, implementations of this specification MUST be capable of
   processing the Extended Key Usage (EKU) extension and the id-pkinit-
   san (as defined in <a href="#section-3.2.2">Section 3.2.2</a>) otherName of the Subject
   Alternative Name (SAN) extension in X.509 certificates [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
<span class="h4"><a class="selflink" id="section-3.1.2" href="#section-3.1.2">3.1.2</a>.  Recommended Algorithms</span>
   All PKINIT implementations SHOULD support the following algorithm:
   o  AS reply key delivery method: the public key encryption key
      delivery method, as described in <a href="#section-3.2.3.2">Section 3.2.3.2</a>.
   For implementations that support the public key encryption key
   delivery method, the following algorithms MUST be supported:
   a) Key transport algorithms identified in the keyEncryptionAlgorithm
      field of the type KeyTransRecipientInfo [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] for encrypting
      the temporary key in the encryptedKey field [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] with a
      public key, as described in <a href="#section-3.2.3.2">Section 3.2.3.2</a>: rsaEncryption (this
      is the RSAES-PKCS1-v1_5 encryption scheme) [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>] [<a href="./rfc3447" title=""Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1"">RFC3447</a>].
   b) Content encryption algorithms identified in the
      contentEncryptionAlgorithm field of the type EncryptedContentInfo
      [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] for encrypting the AS reply key with the temporary key
      contained in the encryptedKey field of the type
      KeyTransRecipientInfo [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>], as described in <a href="#section-3.2.3.2">Section 3.2.3.2</a>:
      des-ede3-cbc (three-key 3DES, CBC mode) [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>].
<span class="grey">Zhu & Tung                  Standards Track                     [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
<span class="h4"><a class="selflink" id="section-3.1.3" href="#section-3.1.3">3.1.3</a>.  Defined Message and Encryption Types</span>
   PKINIT makes use of the following new pre-authentication types:
       PA_PK_AS_REQ                                 16
       PA_PK_AS_REP                                 17
   PKINIT also makes use of the following new authorization data type:
       AD_INITIAL_VERIFIED_CAS                       9
   PKINIT introduces the following new error codes:
       KDC_ERR_CLIENT_NOT_TRUSTED                   62
       KDC_ERR_INVALID_SIG                          64
       KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED       65
       KDC_ERR_CANT_VERIFY_CERTIFICATE              70
       KDC_ERR_INVALID_CERTIFICATE                  71
       KDC_ERR_REVOKED_CERTIFICATE                  72
       KDC_ERR_REVOCATION_STATUS_UNKNOWN            73
       KDC_ERR_CLIENT_NAME_MISMATCH                 75
       KDC_ERR_INCONSISTENT_KEY_PURPOSE             77
       KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED          78
       KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED         79
       KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED   80
       KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED  81
   PKINIT uses the following typed data types for errors:
       TD_TRUSTED_CERTIFIERS                       104
       TD_INVALID_CERTIFICATES                     105
       TD_DH_PARAMETERS                            109
   The ASN.1 module for all structures defined in this document (plus
   IMPORT statements for all imported structures) is given in <a href="#appendix-A">Appendix</a>
   <a href="#appendix-A">A</a>.
   All structures defined in or imported into this document MUST be
   encoded using Distinguished Encoding Rules (DER) [<a href="#ref-X680">X680</a>] [<a href="#ref-X690" title=" Information technology - ASN.1 encoding Rules: Specification of Basic Encoding Rules (BER)">X690</a>]
   (unless otherwise noted).  All data structures carried in OCTET
   STRINGs MUST be encoded according to the rules specified in the
   specifications defining each data structure; a reference to the
   appropriate specification is provided for each data structure.
<span class="grey">Zhu & Tung                  Standards Track                     [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Interoperability note: Some implementations may not be able to decode
   wrapped Cryptographic Message Syntax (CMS) [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] objects encoded
   with BER; specifically, they may not be able to decode indefinite-
   length encodings.  To maximize interoperability, implementers SHOULD
   encode CMS objects used in PKINIT with DER.
<span class="h4"><a class="selflink" id="section-3.1.4" href="#section-3.1.4">3.1.4</a>.  Kerberos Encryption Types Defined for CMS Algorithm Identifiers</span>
   PKINIT defines the following Kerberos encryption type numbers
   [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>], which can be used in the etype field of the AS-REQ
   [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message to indicate to the KDC the client's acceptance of
   the corresponding algorithms (including key transport algorithms
   [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>], content encryption algorithms [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>], and signature
   algorithms) for use with Cryptographic Message Syntax (CMS) [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]
   [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>].
   Per [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>], the encryption types in the etype field are in the
   decreasing preference order of the client.  Note that there is no
   significance in the relative order between any two of different types
   of algorithms: key transport algorithms, content encryption
   algorithms, and signature algorithms.
   The presence of each of these encryption types in the etype field is
   equivalent to the presence of the corresponding algorithm Object
   Identifier (OID) in the supportedCMSTypes field as described in
   <a href="#section-3.2.1">Section 3.2.1</a>.  And the preference order expressed in the
   supportedCMSTypes field would override the preference order listed in
   the etype field.
    Kerberos Encryption Type Name  Num  Corresponding Algorithm OID
    ============================== === ===============================
    id-dsa-with-sha1-CmsOID         9  id-dsa-with-sha1 [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>]
    md5WithRSAEncryption-CmsOID    10  md5WithRSAEncryption [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>]
    sha-1WithRSAEncryption-CmsOID  11  sha-1WithRSAEncryption [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>]
    rc2-cbc-EnvOID                 12  rc2-cbc [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>]
    rsaEncryption-EnvOID           13  rsaEncryption [<a href="./rfc3447" title=""Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1"">RFC3447</a>][RFC3370]
    id-RSAES-OAEP-EnvOID           14  id-RSAES-OAEP [<a href="./rfc3447" title=""Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1"">RFC3447</a>][RFC3560]
    des-ede3-cbc-EnvOID            15  des-ede3-cbc [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>]
<span class="grey">Zhu & Tung                  Standards Track                     [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   The above encryption type numbers are used only to indicate support
   for the use of the corresponding algorithms in PKINIT; they do not
   correspond to actual Kerberos encryption types [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] and MUST NOT
   be used in the etype field of the Kerberos EncryptedData type
   [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].  The practice of assigning Kerberos encryption type
   numbers to indicate support for CMS algorithms is considered
   deprecated, and new numbers should not be assigned for this purpose.
   Instead, the supportedCMSTypes field should be used to identify the
   algorithms supported by the client and the preference order of the
   client.
   For maximum interoperability, however, PKINIT clients wishing to
   indicate to the KDC the support for one or more of the algorithms
   listed above SHOULD include the corresponding encryption type
   number(s) in the etype field of the AS-REQ.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>.  PKINIT Pre-authentication Syntax and Use</span>
   This section defines the syntax and use of the various pre-
   authentication fields employed by PKINIT.
<span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a>.  Generation of Client Request</span>
   The initial authentication request (AS-REQ) is sent as per [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>];
   in addition, a pre-authentication data element, whose padata-type is
   PA_PK_AS_REQ and whose padata-value contains the DER encoding of the
   type PA-PK-AS-REQ, is included.
       PA-PK-AS-REQ ::= SEQUENCE {
          signedAuthPack          [0] IMPLICIT OCTET STRING,
                   -- Contains a CMS type ContentInfo encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo
                   -- is id-signedData (1.2.840.113549.1.7.2),
                   -- and the content field is a SignedData.
                   -- The eContentType field for the type SignedData is
                   -- id-pkinit-authData (1.3.6.1.5.2.3.1), and the
                   -- eContent field contains the DER encoding of the
                   -- type AuthPack.
                   -- AuthPack is defined below.
          trustedCertifiers       [1] SEQUENCE OF
                      ExternalPrincipalIdentifier OPTIONAL,
                   -- Contains a list of CAs, trusted by the client,
                   -- that can be used to certify the KDC.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
                   -- The information contained in the
                   -- trustedCertifiers SHOULD be used by the KDC as
<span class="grey">Zhu & Tung                  Standards Track                     [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- hints to guide its selection of an appropriate
                   -- certificate chain to return to the client.
          kdcPkId                 [2] IMPLICIT OCTET STRING
                                      OPTIONAL,
                   -- Contains a CMS type SignerIdentifier encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- Identifies, if present, a particular KDC
                   -- public key that the client already has.
          ...
       }
       DHNonce ::= OCTET STRING
       ExternalPrincipalIdentifier ::= SEQUENCE {
          subjectName            [0] IMPLICIT OCTET STRING OPTIONAL,
                   -- Contains a PKIX type Name encoded according to
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- Identifies the certificate subject by the
                   -- distinguished subject name.
                   -- REQUIRED when there is a distinguished subject
                   -- name present in the certificate.
         issuerAndSerialNumber   [1] IMPLICIT OCTET STRING OPTIONAL,
                   -- Contains a CMS type IssuerAndSerialNumber encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- Identifies a certificate of the subject.
                   -- REQUIRED for TD-INVALID-CERTIFICATES and
                   -- TD-TRUSTED-CERTIFIERS.
         subjectKeyIdentifier    [2] IMPLICIT OCTET STRING OPTIONAL,
                   -- Identifies the subject's public key by a key
                   -- identifier.  When an X.509 certificate is
                   -- referenced, this key identifier matches the X.509
                   -- subjectKeyIdentifier extension value.  When other
                   -- certificate formats are referenced, the documents
                   -- that specify the certificate format and their use
                   -- with the CMS must include details on matching the
                   -- key identifier to the appropriate certificate
                   -- field.
                   -- RECOMMENDED for TD-TRUSTED-CERTIFIERS.
          ...
       }
       AuthPack ::= SEQUENCE {
          pkAuthenticator         [0] PKAuthenticator,
          clientPublicValue       [1] SubjectPublicKeyInfo OPTIONAL,
                   -- Type SubjectPublicKeyInfo is defined in
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- Specifies Diffie-Hellman domain parameters
                   -- and the client's public key value [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>].
<span class="grey">Zhu & Tung                  Standards Track                    [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- The DH public key value is encoded as a BIT
                   -- STRING according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].
                   -- This field is present only if the client wishes
                   -- to use the Diffie-Hellman key agreement method.
          supportedCMSTypes       [2] SEQUENCE OF AlgorithmIdentifier
                                      OPTIONAL,
                   -- Type AlgorithmIdentifier is defined in
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- List of CMS algorithm [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>] identifiers
                   -- that identify key transport algorithms, or
                   -- content encryption algorithms, or signature
                   -- algorithms supported by the client in order of
                   -- (decreasing) preference.
          clientDHNonce           [3] DHNonce OPTIONAL,
                   -- Present only if the client indicates that it
                   -- wishes to reuse DH keys or to allow the KDC to
                   -- do so (see <a href="#section-3.2.3.1">Section 3.2.3.1</a>).
          ...
       }
       PKAuthenticator ::= SEQUENCE {
          cusec                   [0] INTEGER (0..999999),
          ctime                   [1] KerberosTime,
                   -- cusec and ctime are used as in [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>], for
                   -- replay prevention.
          nonce                   [2] INTEGER (0..4294967295),
                   -- Chosen randomly;  this nonce does not need to
                   -- match with the nonce in the KDC-REQ-BODY.
          paChecksum              [3] OCTET STRING OPTIONAL,
                   -- MUST be present.
                   -- Contains the SHA1 checksum, performed over
                   -- KDC-REQ-BODY.
          ...
       }
   The ContentInfo [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] structure contained in the signedAuthPack
   field of the type PA-PK-AS-REQ is encoded according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] and
   is filled out as follows:
   1.  The contentType field of the type ContentInfo is id-signedData
       (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]), and the content field is a SignedData
       (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]).
<span class="grey">Zhu & Tung                  Standards Track                    [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   2.  The eContentType field for the type SignedData is id-pkinit-
       authData: { iso(1) org(3) dod(6) internet(1) security(5)
       kerberosv5(2) pkinit(3) authData(1) }.  Notes to CMS
       implementers: the signed attribute content-type MUST be present
       in this SignedData instance, and its value is id-pkinit-authData
       according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
   3.  The eContent field for the type SignedData contains the DER
       encoding of the type AuthPack.
   4.  The signerInfos field of the type SignedData contains a single
       signerInfo, which contains the signature over the type AuthPack.
   5.  The AuthPack structure contains a PKAuthenticator, the client
       public key information, the CMS encryption types supported by the
       client, and a DHNonce.  The pkAuthenticator field certifies to
       the KDC that the client has recent knowledge of the signing key
       that authenticates the client.  The clientPublicValue field
       specifies Diffie-Hellman domain parameters and the client's
       public key value.  The DH public key value is encoded as a BIT
       STRING according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].  The clientPublicValue field is
       present only if the client wishes to use the Diffie-Hellman key
       agreement method.  The supportedCMSTypes field specifies the list
       of CMS algorithm identifiers that are supported by the client in
       order of (decreasing) preference, and can be used to identify a
       signature algorithm or a key transport algorithm [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>] in the
       keyEncryptionAlgorithm field of the type KeyTransRecipientInfo,
       or a content encryption algorithm [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>] in the
       contentEncryptionAlgorithm field of the type EncryptedContentInfo
       [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] when encrypting the AS reply key as described in
       <a href="#section-3.2.3.2">Section 3.2.3.2</a>.  However, there is no significance in the
       relative order between any two of different types of algorithms:
       key transport algorithms, content encryption algorithms, and
       signature algorithms.  The clientDHNonce field is described later
       in this section.
   6.  The ctime field in the PKAuthenticator structure contains the
       current time on the client's host, and the cusec field contains
       the microsecond part of the client's timestamp.  The ctime and
       cusec fields are used together to specify a reasonably accurate
       timestamp [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].  The nonce field is chosen randomly.  The
       paChecksum field MUST be present and it contains a SHA1 checksum
       that is performed over the KDC-REQ-BODY [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].  In order to
       ease future migration from the use of SHA1, the paChecksum field
       is made optional syntactically: when the request is extended to
       negotiate hash algorithms, the new client wishing not to use SHA1
       will send the request in the extended message syntax without the
       paChecksum field.  The KDC conforming to this specification MUST
<span class="grey">Zhu & Tung                  Standards Track                    [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       return a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message with the code
       KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED (see <a href="#section-3.2.3">Section 3.2.3</a>).  That
       will allow a new client to retry with SHA1 if allowed by the
       local policy.
   7.  The certificates field of the type SignedData contains
       certificates intended to facilitate certification path
       construction, so that the KDC can verify the signature over the
       type AuthPack.  For path validation, these certificates SHOULD be
       sufficient to construct at least one certification path from the
       client certificate to one trust anchor acceptable by the KDC
       [<a href="./rfc4158" title=""Internet X.509 Public Key Infrastructure: Certification Path Building"">RFC4158</a>].  The client MUST be capable of including such a set of
       certificates if configured to do so.  The certificates field MUST
       NOT contain "root" CA certificates.
   8.  The client's Diffie-Hellman public value (clientPublicValue) is
       included if and only if the client wishes to use the Diffie-
       Hellman key agreement method.  The Diffie-Hellman domain
       parameters [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>] for the client's public key are specified
       in the algorithm field of the type SubjectPublicKeyInfo
       [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>], and the client's Diffie-Hellman public key value is
       mapped to a subjectPublicKey (a BIT STRING) according to
       [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].  When using the Diffie-Hellman key agreement method,
       implementations MUST support Oakley 1024-bit Modular Exponential
       (MODP) well-known group 2 [<a href="./rfc2412" title=""The OAKLEY Key Determination Protocol"">RFC2412</a>] and Oakley 2048-bit MODP
       well-known group 14 [<a href="./rfc3526" title=""More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)"">RFC3526</a>] and SHOULD support Oakley 4096-bit
       MODP well-known group 16 [<a href="./rfc3526" title=""More Modular Exponential (MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)"">RFC3526</a>].
       The Diffie-Hellman field size should be chosen so as to provide
       sufficient cryptographic security [<a href="./rfc3766" title=""Determining Strengths For Public Keys Used For Exchanging Symmetric Keys"">RFC3766</a>].
       When MODP Diffie-Hellman is used, the exponents should have at
       least twice as many bits as the symmetric keys that will be
       derived from them [<a href="#ref-ODL99" title=""Discrete logarithms: The past and the future, Designs, Codes, and Cryptography (1999)"">ODL99</a>].
   9.  The client may wish to reuse DH keys or to allow the KDC to do so
       (see <a href="#section-3.2.3.1">Section 3.2.3.1</a>).  If so, then the client includes the
       clientDHNonce field.  This nonce string MUST be as long as the
       longest key length of the symmetric key types that the client
       supports.  This nonce MUST be chosen randomly.
   The ExternalPrincipalIdentifier structure is used in this document to
   identify the subject's public key thereby the subject principal.
   This structure is filled out as follows:
   1.  The subjectName field contains a PKIX type Name encoded according
       to [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].  This field identifies the certificate subject by
       the distinguished subject name.  This field is REQUIRED when
<span class="grey">Zhu & Tung                  Standards Track                    [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       there is a distinguished subject name present in the certificate
       being used.
   2.  The issuerAndSerialNumber field contains a CMS type
       IssuerAndSerialNumber encoded according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].  This field
       identifies a certificate of the subject.  This field is REQUIRED
       for TD-INVALID-CERTIFICATES and TD-TRUSTED-CERTIFIERS (both
       structures are defined in <a href="#section-3.2.2">Section 3.2.2</a>).
   3.  The subjectKeyIdentifier [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] field identifies the subject's
       public key by a key identifier.  When an X.509 certificate is
       referenced, this key identifier matches the X.509
       subjectKeyIdentifier extension value.  When other certificate
       formats are referenced, the documents that specify the
       certificate format and their use with the CMS must include
       details on matching the key identifier to the appropriate
       certificate field.  This field is RECOMMENDED for TD-TRUSTED-
       CERTIFIERS (as defined in <a href="#section-3.2.2">Section 3.2.2</a>).
   The trustedCertifiers field of the type PA-PK-AS-REQ contains a list
   of CAs, trusted by the client, that can be used to certify the KDC.
   Each ExternalPrincipalIdentifier identifies a CA or a CA certificate
   (thereby its public key).
   The kdcPkId field of the type PA-PK-AS-REQ contains a CMS type
   SignerIdentifier encoded according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].  This field
   identifies, if present, a particular KDC public key that the client
   already has.
<span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a>.  Receipt of Client Request</span>
   Upon receiving the client's request, the KDC validates it.  This
   section describes the steps that the KDC MUST (unless otherwise
   noted) take in validating the request.
   The KDC verifies the client's signature in the signedAuthPack field
   according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
   If, while validating the client's X.509 certificate [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>], the
   KDC cannot build a certification path to validate the client's
   certificate, it sends back a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message with the
   code KDC_ERR_CANT_VERIFY_CERTIFICATE.  The accompanying e-data for
   this error message is a TYPED-DATA (as defined in [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]) that
   contains an element whose data-type is TD_TRUSTED_CERTIFIERS, and
   whose data-value contains the DER encoding of the type TD-TRUSTED-
   CERTIFIERS:
<span class="grey">Zhu & Tung                  Standards Track                    [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       TD-TRUSTED-CERTIFIERS ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Identifies a list of CAs trusted by the KDC.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
   Each ExternalPrincipalIdentifier (as defined in <a href="#section-3.2.1">Section 3.2.1</a>) in the
   TD-TRUSTED-CERTIFIERS structure identifies a CA or a CA certificate
   (thereby its public key) trusted by the KDC.
   Upon receiving this error message, the client SHOULD retry only if it
   has a different set of certificates (from those of the previous
   requests) that form a certification path (or a partial path) from one
   of the trust anchors acceptable by the KDC to its own certificate.
   If, while processing the certification path, the KDC determines that
   the signature on one of the certificates in the signedAuthPack field
   is invalid, it returns a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message with the code
   KDC_ERR_INVALID_CERTIFICATE.  The accompanying e-data for this error
   message is a TYPED-DATA that contains an element whose data-type is
   TD_INVALID_CERTIFICATES, and whose data-value contains the DER
   encoding of the type TD-INVALID-CERTIFICATES:
       TD-INVALID-CERTIFICATES ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Each ExternalPrincipalIdentifier identifies a
                   -- certificate (sent by the client) with an invalid
                   -- signature.
   Each ExternalPrincipalIdentifier (as defined in <a href="#section-3.2.1">Section 3.2.1</a>) in the
   TD-INVALID-CERTIFICATES structure identifies a certificate (that was
   sent by the client) with an invalid signature.
   If more than one X.509 certificate signature is invalid, the KDC MAY
   include one IssuerAndSerialNumber per invalid signature within the
   TD-INVALID-CERTIFICATES.
   The client's X.509 certificate is validated according to [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
   Depending on local policy, the KDC may also check whether any X.509
   certificates in the certification path validating the client's
   certificate have been revoked.  If any of them have been revoked, the
   KDC MUST return an error message with the code
   KDC_ERR_REVOKED_CERTIFICATE; if the KDC attempts to determine the
   revocation status but is unable to do so, it SHOULD return an error
   message with the code KDC_ERR_REVOCATION_STATUS_UNKNOWN.  The
   certificate or certificates affected are identified exactly as for
   the error code KDC_ERR_INVALID_CERTIFICATE (see above).
<span class="grey">Zhu & Tung                  Standards Track                    [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Note that the TD_INVALID_CERTIFICATES error data is only used to
   identify invalid certificates sent by the client in the request.
   The client's public key is then used to verify the signature.  If the
   signature fails to verify, the KDC MUST return an error message with
   the code KDC_ERR_INVALID_SIG.  There is no accompanying e-data for
   this error message.
   In addition to validating the client's signature, the KDC MUST also
   check that the client's public key used to verify the client's
   signature is bound to the client principal name specified in the AS-
   REQ as follows:
   1. If the KDC has its own binding between either the client's
      signature-verification public key or the client's certificate and
      the client's Kerberos principal name, it uses that binding.
   2. Otherwise, if the client's X.509 certificate contains a Subject
      Alternative Name (SAN) extension carrying a KRB5PrincipalName
      (defined below) in the otherName field of the type GeneralName
      [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>], it binds the client's X.509 certificate to that name.
      The type of the otherName field is AnotherName.  The type-id field
      of the type AnotherName is id-pkinit-san:
       id-pkinit-san OBJECT IDENTIFIER ::=
         { iso(1) org(3) dod(6) internet(1) security(5) kerberosv5(2)
           x509SanAN (2) }
      And the value field of the type AnotherName is a
      KRB5PrincipalName.
       KRB5PrincipalName ::= SEQUENCE {
           realm                   [0] Realm,
           principalName           [1] PrincipalName
       }
   If the Kerberos client name in the AS-REQ does not match a name bound
   by the KDC (the binding can be in the certificate, for example, as
   described above), or if there is no binding found by the KDC, the KDC
   MUST return an error message with the code
   KDC_ERR_CLIENT_NAME_MISMATCH.  There is no accompanying e-data for
   this error message.
   Even if the certification path is validated and the certificate is
   mapped to the client's principal name, the KDC may decide not to
   accept the client's certificate, depending on local policy.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   The KDC MAY require the presence of an Extended Key Usage (EKU)
   KeyPurposeId [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] id-pkinit-KPClientAuth in the extensions field
   of the client's X.509 certificate:
       id-pkinit-KPClientAuth OBJECT IDENTIFIER ::=
         { iso(1) org(3) dod(6) internet(1) security(5) kerberosv5(2)
           pkinit(3) keyPurposeClientAuth(4) }
              -- PKINIT client authentication.
              -- Key usage bits that MUST be consistent:
              -- digitalSignature.
   The digitalSignature key usage bit [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] MUST be asserted when
   the intended purpose of the client's X.509 certificate is restricted
   with the id-pkinit-KPClientAuth EKU.
   If this EKU KeyPurposeId is required but it is not present, or if the
   client certificate is restricted not to be used for PKINIT client
   authentication per <a href="./rfc3280#section-4.2.1.13">Section 4.2.1.13 of [RFC3280]</a>, the KDC MUST return
   an error message of the code KDC_ERR_INCONSISTENT_KEY_PURPOSE.  There
   is no accompanying e-data for this error message.  KDCs implementing
   this requirement SHOULD also accept the EKU KeyPurposeId
   id-ms-kp-sc-logon (1.3.6.1.4.1.311.20.2.2) as meeting the
   requirement, as there are a large number of X.509 client certificates
   deployed for use with PKINIT that have this EKU.
   As a matter of local policy, the KDC MAY decide to reject requests on
   the basis of the absence or presence of other specific EKU OIDs.
   If the digest algorithm used in generating the CA signature for the
   public key in any certificate of the request is not acceptable by the
   KDC, the KDC MUST return a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message with the code
   KDC_ERR_DIGEST_IN_CERT_NOT_ACCEPTED.  The accompanying e-data MUST be
   encoded in TYPED-DATA, although none is defined at this point.
   If the client's public key is not accepted with reasons other than
   those specified above, the KDC returns a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] message
   with the code KDC_ERR_CLIENT_NOT_TRUSTED.  There is no accompanying
   e-data currently defined for this error message.
   The KDC MUST check the timestamp to ensure that the request is not a
   replay, and that the time skew falls within acceptable limits.  The
   recommendations for clock skew times in [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] apply here.  If the
   check fails, the KDC MUST return error code KRB_AP_ERR_REPEAT or
   KRB_AP_ERR_SKEW, respectively.
   If the clientPublicValue is filled in, indicating that the client
   wishes to use the Diffie-Hellman key agreement method, the KDC SHOULD
   check to see if the key parameters satisfy its policy.  If they do
<span class="grey">Zhu & Tung                  Standards Track                    [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   not, it MUST return an error message with the code
   KDC_ERR_DH_KEY_PARAMETERS_NOT_ACCEPTED.  The accompanying e-data is a
   TYPED-DATA that contains an element whose data-type is
   TD_DH_PARAMETERS, and whose data-value contains the DER encoding of
   the type TD-DH-PARAMETERS:
       TD-DH-PARAMETERS ::= SEQUENCE OF AlgorithmIdentifier
                   -- Each AlgorithmIdentifier specifies a set of
                   -- Diffie-Hellman domain parameters [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>].
                   -- This list is in decreasing preference order.
   TD-DH-PARAMETERS contains a list of Diffie-Hellman domain parameters
   that the KDC supports in decreasing preference order, from which the
   client SHOULD pick one to retry the request.
   The AlgorithmIdentifier structure is defined in [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] and is
   filled in according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].  More specifically, <a href="./rfc3279#section-2.3.3">Section 2.3.3
   of [RFC3279]</a> describes how to fill in the AlgorithmIdentifier
   structure in the case where MODP Diffie-Hellman key exchange is used.
   If the client included a kdcPkId field in the PA-PK-AS-REQ and the
   KDC does not possess the corresponding key, the KDC MUST ignore the
   kdcPkId field as if the client did not include one.
   If the digest algorithm used by the id-pkinit-authData is not
   acceptable by the KDC, the KDC MUST return a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]
   message with the code KDC_ERR_DIGEST_IN_SIGNED_DATA_NOT_ACCEPTED.
   The accompanying e-data MUST be encoded in TYPED-DATA, although none
   is defined at this point.
<span class="h4"><a class="selflink" id="section-3.2.3" href="#section-3.2.3">3.2.3</a>.  Generation of KDC Reply</span>
   If the paChecksum filed in the request is not present, the KDC
   conforming to this specification MUST return a KRB-ERROR [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]
   message with the code KDC_ERR_PA_CHECKSUM_MUST_BE_INCLUDED.  The
   accompanying e-data MUST be encoded in TYPED-DATA (no error data is
   defined by this specification).
   Assuming that the client's request has been properly validated, the
   KDC proceeds as per [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>], except as follows.
   The KDC MUST set the initial flag and include an authorization data
   element of ad-type [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] AD_INITIAL_VERIFIED_CAS in the issued
   ticket.  The ad-data [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] field contains the DER encoding of the
   type AD-INITIAL-VERIFIED-CAS:
<span class="grey">Zhu & Tung                  Standards Track                    [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       AD-INITIAL-VERIFIED-CAS ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Identifies the certification path with which
                   -- the client certificate was validated.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
   The AD-INITIAL-VERIFIED-CAS structure identifies the certification
   path with which the client certificate was validated.  Each
   ExternalPrincipalIdentifier (as defined in <a href="#section-3.2.1">Section 3.2.1</a>) in the AD-
   INITIAL-VERIFIED-CAS structure identifies a CA or a CA certificate
   (thereby its public key).
   Note that the syntax for the AD-INITIAL-VERIFIED-CAS authorization
   data does permit empty SEQUENCEs to be encoded.  Such empty sequences
   may only be used if the KDC itself vouches for the user's
   certificate.
   The AS wraps any AD-INITIAL-VERIFIED-CAS data in AD-IF-RELEVANT
   containers if the list of CAs satisfies the AS' realm's local policy
   (this corresponds to the TRANSITED-POLICY-CHECKED ticket flag
   [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]).  Furthermore, any TGS MUST copy such authorization data
   from tickets used within a PA-TGS-REQ of the TGS-REQ into the
   resulting ticket.  If the list of CAs satisfies the local KDC's
   realm's policy, the TGS MAY wrap the data into the AD-IF-RELEVANT
   container; otherwise, it MAY unwrap the authorization data out of the
   AD-IF-RELEVANT container.
   Application servers that understand this authorization data type
   SHOULD apply local policy to determine whether a given ticket bearing
   such a type *not* contained within an AD-IF-RELEVANT container is
   acceptable.  (This corresponds to the AP server's checking the
   transited field when the TRANSITED-POLICY-CHECKED flag has not been
   set [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].)  If such a data type is contained within an AD-IF-
   RELEVANT container, AP servers MAY apply local policy to determine
   whether the authorization data is acceptable.
   A pre-authentication data element, whose padata-type is PA_PK_AS_REP
   and whose padata-value contains the DER encoding of the type PA-PK-
   AS-REP (defined below), is included in the AS-REP [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
       PA-PK-AS-REP ::= CHOICE {
          dhInfo                  [0] DHRepInfo,
                   -- Selected when Diffie-Hellman key exchange is
                   -- used.
          encKeyPack              [1] IMPLICIT OCTET STRING,
                   -- Selected when public key encryption is used.
                   -- Contains a CMS type ContentInfo encoded
<span class="grey">Zhu & Tung                  Standards Track                    [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo is
                   -- id-envelopedData (1.2.840.113549.1.7.3).
                   -- The content field is an EnvelopedData.
                   -- The contentType field for the type EnvelopedData
                   -- is id-signedData (1.2.840.113549.1.7.2).
                   -- The eContentType field for the inner type
                   -- SignedData (when unencrypted) is
                   -- id-pkinit-rkeyData (1.3.6.1.5.2.3.3) and the
                   -- eContent field contains the DER encoding of the
                   -- type ReplyKeyPack.
                   -- ReplyKeyPack is defined in <a href="#section-3.2.3.2">Section 3.2.3.2</a>.
          ...
       }
       DHRepInfo ::= SEQUENCE {
          dhSignedData            [0] IMPLICIT OCTET STRING,
                   -- Contains a CMS type ContentInfo encoded according
                   -- to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo is
                   -- id-signedData (1.2.840.113549.1.7.2), and the
                   -- content field is a SignedData.
                   -- The eContentType field for the type SignedData is
                   -- id-pkinit-DHKeyData (1.3.6.1.5.2.3.2), and the
                   -- eContent field contains the DER encoding of the
                   -- type KDCDHKeyInfo.
                   -- KDCDHKeyInfo is defined below.
          serverDHNonce           [1] DHNonce OPTIONAL,
                   -- Present if and only if dhKeyExpiration is
                   -- present in the KDCDHKeyInfo.
          ...
       }
       KDCDHKeyInfo ::= SEQUENCE {
          subjectPublicKey        [0] BIT STRING,
                   -- The KDC's DH public key.
                   -- The DH public key value is encoded as a BIT
                   -- STRING according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].
          nonce                   [1] INTEGER (0..4294967295),
                   -- Contains the nonce in the pkAuthenticator field
                   -- in the request if the DH keys are NOT reused,
                   -- 0 otherwise.
          dhKeyExpiration         [2] KerberosTime OPTIONAL,
                   -- Expiration time for KDC's key pair,
                   -- present if and only if the DH keys are reused.
                   -- If present, the KDC's DH public key MUST not be
                   -- used past the point of this expiration time.
                   -- If this field is omitted then the serverDHNonce
<span class="grey">Zhu & Tung                  Standards Track                    [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- field MUST also be omitted.
          ...
       }
   The content of the AS-REP is otherwise unchanged from [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].  The
   KDC encrypts the reply as usual, but not with the client's long-term
   key.  Instead, it encrypts it with either a shared key derived from a
   Diffie-Hellman exchange or a generated encryption key.  The contents
   of the PA-PK-AS-REP indicate which key delivery method is used.
   If the client does not wish to use the Diffie-Hellman key delivery
   method (the clientPublicValue field is not present in the request)
   and the KDC does not support the public key encryption key delivery
   method, the KDC MUST return an error message with the code
   KDC_ERR_PUBLIC_KEY_ENCRYPTION_NOT_SUPPORTED.  There is no
   accompanying e-data for this error message.
   In addition, the lifetime of the ticket returned by the KDC MUST NOT
   exceed that of the client's public-private key pair.  The ticket
   lifetime, however, can be shorter than that of the client's public-
   private key pair.  For the implementations of this specification, the
   lifetime of the client's public-private key pair is the validity
   period in X.509 certificates [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>], unless configured otherwise.
<span class="h5"><a class="selflink" id="section-3.2.3.1" href="#section-3.2.3.1">3.2.3.1</a>.  Using Diffie-Hellman Key Exchange</span>
   In this case, the PA-PK-AS-REP contains a DHRepInfo structure.
   The ContentInfo [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] structure for the dhSignedData field is
   filled in as follows:
   1.  The contentType field of the type ContentInfo is id-signedData
       (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]), and the content field is a SignedData
       (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]).
   2.  The eContentType field for the type SignedData is the OID value
       for id-pkinit-DHKeyData: { iso(1) org(3) dod(6) internet(1)
       security(5) kerberosv5(2) pkinit(3) DHKeyData(2) }.  Notes to CMS
       implementers: the signed attribute content-type MUST be present
       in this SignedData instance, and its value is id-pkinit-DHKeyData
       according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
   3.  The eContent field for the type SignedData contains the DER
       encoding of the type KDCDHKeyInfo.
   4.  The KDCDHKeyInfo structure contains the KDC's public key, a
       nonce, and, optionally, the expiration time of the KDC's DH key
       being reused.  The subjectPublicKey field of the type
<span class="grey">Zhu & Tung                  Standards Track                    [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       KDCDHKeyInfo field identifies KDC's DH public key.  This DH
       public key value is encoded as a BIT STRING according to
       [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].  The nonce field contains the nonce in the
       pkAuthenticator field in the request if the DH keys are NOT
       reused.  The value of this nonce field is 0 if the DH keys are
       reused.  The dhKeyExpiration field is present if and only if the
       DH keys are reused.  If the dhKeyExpiration field is present, the
       KDC's public key in this KDCDHKeyInfo structure MUST NOT be used
       past the point of this expiration time.  If this field is
       omitted, then the serverDHNonce field MUST also be omitted.
   5.  The signerInfos field of the type SignedData contains a single
       signerInfo, which contains the signature over the type
       KDCDHKeyInfo.
   6.  The certificates field of the type SignedData contains
       certificates intended to facilitate certification path
       construction, so that the client can verify the KDC's signature
       over the type KDCDHKeyInfo.  The information contained in the
       trustedCertifiers in the request SHOULD be used by the KDC as
       hints to guide its selection of an appropriate certificate chain
       to return to the client.  This field may be left empty if the KDC
       public key specified by the kdcPkId field in the PA-PK-AS-REQ was
       used for signing.  Otherwise, for path validation, these
       certificates SHOULD be sufficient to construct at least one
       certification path from the KDC certificate to one trust anchor
       acceptable by the client [<a href="./rfc4158" title=""Internet X.509 Public Key Infrastructure: Certification Path Building"">RFC4158</a>].  The KDC MUST be capable of
       including such a set of certificates if configured to do so.  The
       certificates field MUST NOT contain "root" CA certificates.
   7.  If the client included the clientDHNonce field, then the KDC may
       choose to reuse its DH keys.  If the server reuses DH keys, then
       it MUST include an expiration time in the dhKeyExpiration field.
       Past the point of the expiration time, the signature over the
       type DHRepInfo is considered expired/invalid.  When the server
       reuses DH keys then, it MUST include a serverDHNonce at least as
       long as the length of keys for the symmetric encryption system
       used to encrypt the AS reply.  Note that including the
       serverDHNonce changes how the client and server calculate the key
       to use to encrypt the reply; see below for details.  The KDC
       SHOULD NOT reuse DH keys unless the clientDHNonce field is
       present in the request.
   The AS reply key is derived as follows:
   1. Both the KDC and the client calculate the shared secret value as
      follows:
<span class="grey">Zhu & Tung                  Standards Track                    [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
          a) When MODP Diffie-Hellman is used, let DHSharedSecret be the
          shared secret value.  DHSharedSecret is the value ZZ, as
          described in <a href="./rfc2631#section-2.1.1">Section 2.1.1 of [RFC2631]</a>.
      DHSharedSecret is first padded with leading zeros such that the
      size of DHSharedSecret in octets is the same as that of the
      modulus, then represented as a string of octets in big-endian
      order.
      Implementation note: Both the client and the KDC can cache the
      triple (ya, yb, DHSharedSecret), where ya is the client's public
      key and yb is the KDC's public key.  If both ya and yb are the
      same in a later exchange, the cached DHSharedSecret can be used.
   2. Let K be the key-generation seed length [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] of the AS reply
      key whose enctype is selected according to [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
   3. Define the function octetstring2key() as follows:
           octetstring2key(x) == random-to-key(K-truncate(
                                    SHA1(0x00 | x) |
                                    SHA1(0x01 | x) |
                                    SHA1(0x02 | x) |
                                    ...
                                    ))
      where x is an octet string; | is the concatenation operator; 0x00,
      0x01, 0x02, etc. are each represented as a single octet; random-
      to-key() is an operation that generates a protocol key from a
      bitstring of length K; and K-truncate truncates its input to the
      first K bits.  Both K and random-to-key() are as defined in the
      kcrypto profile [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] for the enctype of the AS reply key.
   4. When DH keys are reused, let n_c be the clientDHNonce and n_k be
      the serverDHNonce; otherwise, let both n_c and n_k be empty octet
      strings.
   5. The AS reply key k is:
              k = octetstring2key(DHSharedSecret | n_c | n_k)
<span class="h5"><a class="selflink" id="section-3.2.3.2" href="#section-3.2.3.2">3.2.3.2</a>.  Using Public Key Encryption</span>
   In this case, the PA-PK-AS-REP contains the encKeyPack field where
   the AS reply key is encrypted.
   The ContentInfo [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>] structure for the encKeyPack field is
   filled in as follows:
<span class="grey">Zhu & Tung                  Standards Track                    [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   1.  The contentType field of the type ContentInfo is id-envelopedData
       (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]), and the content field is an
       EnvelopedData (as defined in [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>]).
   2.  The contentType field for the type EnvelopedData is id-
       signedData: { iso (1) member-body (2) us (840) rsadsi (113549)
       pkcs (1) pkcs7 (7) signedData (2) }.
   3.  The eContentType field for the inner type SignedData (when
       decrypted from the encryptedContent field for the type
       EnvelopedData) is id-pkinit-rkeyData: { iso(1) org(3) dod(6)
       internet(1) security(5) kerberosv5(2) pkinit(3) rkeyData(3) }.
       Notes to CMS implementers: the signed attribute content-type MUST
       be present in this SignedData instance, and its value is id-
       pkinit-rkeyData according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
   4.  The eContent field for the inner type SignedData contains the DER
       encoding of the type ReplyKeyPack (as described below).
   5.  The signerInfos field of the inner type SignedData contains a
       single signerInfo, which contains the signature for the type
       ReplyKeyPack.
   6.  The certificates field of the inner type SignedData contains
       certificates intended to facilitate certification path
       construction, so that the client can verify the KDC's signature
       for the type ReplyKeyPack.  The information contained in the
       trustedCertifiers in the request SHOULD be used by the KDC as
       hints to guide its selection of an appropriate certificate chain
       to return to the client.  This field may be left empty if the KDC
       public key specified by the kdcPkId field in the PA-PK-AS-REQ was
       used for signing.  Otherwise, for path validation, these
       certificates SHOULD be sufficient to construct at least one
       certification path from the KDC certificate to one trust anchor
       acceptable by the client [<a href="./rfc4158" title=""Internet X.509 Public Key Infrastructure: Certification Path Building"">RFC4158</a>].  The KDC MUST be capable of
       including such a set of certificates if configured to do so.  The
       certificates field MUST NOT contain "root" CA certificates.
   7.  The recipientInfos field of the type EnvelopedData is a SET that
       MUST contain exactly one member of type KeyTransRecipientInfo.
       The encryptedKey of this member contains the temporary key that
       is encrypted using the client's public key.
   8.  The unprotectedAttrs or originatorInfo fields of the type
       EnvelopedData MAY be present.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 24]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   If there is a supportedCMSTypes field in the AuthPack, the KDC must
   check to see if it supports any of the listed types.  If it supports
   more than one of the types, the KDC SHOULD use the one listed first.
   If it does not support any of them, it MUST return an error message
   with the code KDC_ERR_ETYPE_NOSUPP [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
   Furthermore, the KDC computes the checksum of the AS-REQ in the
   client request.  This checksum is performed over the type AS-REQ, and
   the protocol key [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] of the checksum operation is the replyKey,
   and the key usage number is 6.  If the replyKey's enctype is "newer"
   [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] [<a href="./rfc4121" title=""The Kerberos Version 5 Generic Security Service Application Program Interface (GSS-API) Mechanism: Version 2"">RFC4121</a>], the checksum operation is the required checksum
   operation [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] of that enctype.
       ReplyKeyPack ::= SEQUENCE {
          replyKey                [0] EncryptionKey,
                   -- Contains the session key used to encrypt the
                   -- enc-part field in the AS-REP, i.e., the
                   -- AS reply key.
          asChecksum              [1] Checksum,
                  -- Contains the checksum of the AS-REQ
                  -- corresponding to the containing AS-REP.
                  -- The checksum is performed over the type AS-REQ.
                  -- The protocol key [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] of the checksum is the
                  -- replyKey and the key usage number is 6.
                  -- If the replyKey's enctype is "newer" [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]
                  -- [<a href="./rfc4121" title=""The Kerberos Version 5 Generic Security Service Application Program Interface (GSS-API) Mechanism: Version 2"">RFC4121</a>], the checksum is the required
                  -- checksum operation [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] for that enctype.
                  -- The client MUST verify this checksum upon receipt
                  -- of the AS-REP.
          ...
       }
   Implementations of this RSA encryption key delivery method are
   RECOMMENDED to support RSA keys at least 2048 bits in size.
<span class="h4"><a class="selflink" id="section-3.2.4" href="#section-3.2.4">3.2.4</a>.  Receipt of KDC Reply</span>
   Upon receipt of the KDC's reply, the client proceeds as follows.  If
   the PA-PK-AS-REP contains the dhSignedData field, the client derives
   the AS reply key using the same procedure used by the KDC, as defined
   in <a href="#section-3.2.3.1">Section 3.2.3.1</a>.  Otherwise, the message contains the encKeyPack
   field, and the client decrypts and extracts the temporary key in the
   encryptedKey field of the member KeyTransRecipientInfo and then uses
   that as the AS reply key.
   If the public key encryption method is used, the client MUST verify
   the asChecksum contained in the ReplyKeyPack.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 25]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   In either case, the client MUST verify the signature in the
   SignedData according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].  The KDC's X.509 certificate MUST
   be validated according to [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].  In addition, unless the client
   can otherwise verify that the public key used to verify the KDC's
   signature is bound to the KDC of the target realm, the KDC's X.509
   certificate MUST contain a Subject Alternative Name extension
   [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] carrying an AnotherName whose type-id is id-pkinit-san (as
   defined in <a href="#section-3.2.2">Section 3.2.2</a>) and whose value is a KRB5PrincipalName that
   matches the name of the TGS of the target realm (as defined in
   <a href="./rfc4120#section-7.3">Section 7.3 of [RFC4120]</a>).
   Unless the client knows by some other means that the KDC certificate
   is intended for a Kerberos KDC, the client MUST require that the KDC
   certificate contains the EKU KeyPurposeId [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] id-pkinit-KPKdc:
       id-pkinit-KPKdc OBJECT IDENTIFIER ::=
         { iso(1) org(3) dod(6) internet(1) security(5) kerberosv5(2)
           pkinit(3) keyPurposeKdc(5) }
              -- Signing KDC responses.
              -- Key usage bits that MUST be consistent:
              -- digitalSignature.
   The digitalSignature key usage bit [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>] MUST be asserted when
   the intended purpose of the KDC's X.509 certificate is restricted
   with the id-pkinit-KPKdc EKU.
   If the KDC certificate contains the Kerberos TGS name encoded as an
   id-pkinit-san SAN, this certificate is certified by the issuing CA as
   a KDC certificate, therefore the id-pkinit-KPKdc EKU is not required.
   If all applicable checks are satisfied, the client then decrypts the
   enc-part field of the KDC-REP in the AS-REP, using the AS reply key,
   and then proceeds as described in [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
<span class="h3"><a class="selflink" id="section-3.3" href="#section-3.3">3.3</a>.  Interoperability Requirements</span>
   The client MUST be capable of sending a set of certificates
   sufficient to allow the KDC to construct a certification path for the
   client's certificate, if the correct set of certificates is provided
   through configuration or policy.
   If the client sends all the X.509 certificates on a certification
   path to a trust anchor acceptable by the KDC, and if the KDC cannot
   verify the client's public key otherwise, the KDC MUST be able to
   process path validation for the client's certificate based on the
   certificates in the request.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 26]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   The KDC MUST be capable of sending a set of certificates sufficient
   to allow the client to construct a certification path for the KDC's
   certificate, if the correct set of certificates is provided through
   configuration or policy.
   If the KDC sends all the X.509 certificates on a certification path
   to a trust anchor acceptable by the client, and the client can not
   verify the KDC's public key otherwise, the client MUST be able to
   process path validation for the KDC's certificate based on the
   certificates in the reply.
<span class="h3"><a class="selflink" id="section-3.4" href="#section-3.4">3.4</a>.  KDC Indication of PKINIT Support</span>
   If pre-authentication is required but was not present in the request,
   per [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] an error message with the code KDC_ERR_PREAUTH_FAILED
   is returned, and a METHOD-DATA object will be stored in the e-data
   field of the KRB-ERROR message to specify which pre-authentication
   mechanisms are acceptable.  The KDC can then indicate the support of
   PKINIT by including an empty element whose padata-type is
   PA_PK_AS_REQ in that METHOD-DATA object.
   Otherwise if it is required by the KDC's local policy that the client
   must be pre-authenticated using the pre-authentication mechanism
   specified in this document, but no PKINIT pre-authentication was
   present in the request, an error message with the code
   KDC_ERR_PREAUTH_FAILED SHOULD be returned.
   KDCs MUST leave the padata-value field of the PA_PK_AS_REQ element in
   the KRB-ERROR's METHOD-DATA empty (i.e., send a zero-length OCTET
   STRING), and clients MUST ignore this and any other value.  Future
   extensions to this protocol may specify other data to send instead of
   an empty OCTET STRING.
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>.  Security Considerations</span>
   The security of cryptographic algorithms is dependent on generating
   secret quantities [<a href="./rfc4086" title=""Randomness Requirements for Security"">RFC4086</a>].  The number of truly random bits is
   extremely important in determining the attack resistance strength of
   the cryptosystem; for example, the secret Diffie-Hellman exponents
   must be chosen based on n truly random bits (where n is the system
   security requirement).  The security of the overall system is
   significantly weakened by using insufficient random inputs: a
   sophisticated attacker may find it easier to reproduce the
   environment that produced the secret quantities and to search the
   resulting small set of possibilities than to locate the quantities in
   the whole of the potential number space.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 27]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Kerberos error messages are not integrity protected; as a result, the
   domain parameters sent by the KDC as TD-DH-PARAMETERS can be tampered
   with by an attacker so that the set of domain parameters selected
   could be either weaker or not mutually preferred.  Local policy can
   configure sets of domain parameters acceptable locally, or disallow
   the negotiation of DH domain parameters.
   The symmetric reply key size and Diffie-Hellman field size or RSA
   modulus size should be chosen so as to provide sufficient
   cryptographic security [<a href="./rfc3766" title=""Determining Strengths For Public Keys Used For Exchanging Symmetric Keys"">RFC3766</a>].
   When MODP Diffie-Hellman is used, the exponents should have at least
   twice as many bits as the symmetric keys that will be derived from
   them [<a href="#ref-ODL99" title=""Discrete logarithms: The past and the future, Designs, Codes, and Cryptography (1999)"">ODL99</a>].
   PKINIT raises certain security considerations beyond those that can
   be regulated strictly in protocol definitions.  We will address them
   in this section.
   PKINIT extends the cross-realm model to the public-key
   infrastructure.  Users of PKINIT must understand security policies
   and procedures appropriate to the use of Public Key Infrastructures
   [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
   In order to trust a KDC certificate that is certified by a CA as a
   KDC certificate for a target realm (for example, by asserting the TGS
   name of that Kerberos realm as an id-pkinit-san SAN and/or
   restricting the certificate usage by using the id-pkinit-KPKdc EKU,
   as described in <a href="#section-3.2.4">Section 3.2.4</a>), the client MUST verify that the KDC
   certificate's issuing CA is authorized to issue KDC certificates for
   that target realm.  Otherwise, the binding between the KDC
   certificate and the KDC of the target realm is not established.
   How to validate this authorization is a matter of local policy.  A
   way to achieve this is the configuration of specific sets of
   intermediary CAs and trust anchors, one of which must be on the KDC
   certificate's certification path [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>], and, for each CA or trust
   anchor, the realms for which it is allowed to issue certificates.
   In addition, if any CA that is trusted to issue KDC certificates can
   also issue other kinds of certificates, then local policy must be
   able to distinguish between them; for example, it could require that
   KDC certificates contain the id-pkinit-KPKdc EKU or that the realm be
   specified with the id-pkinit-san SAN.
   It is the responsibility of the PKI administrators for an
   organization to ensure that KDC certificates are only issued to KDCs,
   and that clients can ascertain this using their local policy.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 28]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Standard Kerberos allows the possibility of interactions between
   cryptosystems of varying strengths; this document adds interactions
   with public-key cryptosystems to Kerberos.  Some administrative
   policies may allow the use of relatively weak public keys.  When
   using such weak asymmetric keys to protect/exchange stronger
   symmetric Keys, the attack resistant strength of the overall system
   is no better than that of these weak keys [<a href="./rfc3766" title=""Determining Strengths For Public Keys Used For Exchanging Symmetric Keys"">RFC3766</a>].
   PKINIT requires that keys for symmetric cryptosystems be generated.
   Some such systems contain "weak" keys.  For recommendations regarding
   these weak keys, see [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
   PKINIT allows the use of the same RSA key pair for encryption and
   signing when doing RSA encryption-based key delivery.  This is not
   recommended usage of RSA keys [<a href="./rfc3447" title=""Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.1"">RFC3447</a>]; by using DH-based key
   delivery, this is avoided.
   Care should be taken in how certificates are chosen for the purposes
   of authentication using PKINIT.  Some local policies may require that
   key escrow be used for certain certificate types.  Deployers of
   PKINIT should be aware of the implications of using certificates that
   have escrowed keys for the purposes of authentication.  Because
   signing-only certificates are normally not escrowed, by using DH-
   based key delivery this is avoided.
   PKINIT does not provide for a "return routability" test to prevent
   attackers from mounting a denial-of-service attack on the KDC by
   causing it to perform unnecessary and expensive public-key
   operations.  Strictly speaking, this is also true of standard
   Kerberos, although the potential cost is not as great, because
   standard Kerberos does not make use of public-key cryptography.  By
   using DH-based key delivery and reusing DH keys, the necessary crypto
   processing cost per request can be minimized.
   When the Diffie-Hellman key exchange method is used, additional pre-
   authentication data [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>] (in addition to the PA_PK_AS_REQ, as
   defined in this specification) is not bound to the AS_REQ by the
   mechanisms discussed in this specification (meaning it may be dropped
   or added by attackers without being detected by either the client or
   the KDC).  Designers of additional pre-authentication data should
   take that into consideration if such additional pre-authentication
   data can be used in conjunction with the PA_PK_AS_REQ.  The future
   work of the Kerberos working group is expected to update the hash
   algorithms specified in this document and provide a generic mechanism
   to bind additional pre-authentication data with the accompanying
   AS_REQ.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 29]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   The key usage number 6 used by the asChecksum field is also used for
   the authenticator checksum (cksum field of AP-REQ) contained in the
   PA-TGS-REQ preauthentication data contained in a TGS-REQ [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>].
   This conflict is present for historical reasons; the reuse of key
   usage numbers is strongly discouraged.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>.  Acknowledgements</span>
   The following people have made significant contributions to this
   document: Paul Leach, Stefan Santesson, Sam Hartman, Love Hornquist
   Astrand, Ken Raeburn, Nicolas Williams, John Wray, Tom Yu, Jeffrey
   Hutzelman, David Cross, Dan Simon, Karthik Jaganathan, Chaskiel M
   Grundman, and Jeffrey Altman.
   Andre Scedrov, Aaron D. Jaggard, Iliano Cervesato, Joe-Kai Tsay, and
   Chris Walstad discovered a binding issue between the AS-REQ and AS-
   REP in draft -26; the asChecksum field was added as the result.
   Special thanks to Clifford Neuman, Matthew Hur, Ari Medvinsky, Sasha
   Medvinsky, and Jonathan Trostle who wrote earlier versions of this
   document.
   The authors are indebted to the Kerberos working group chair, Jeffrey
   Hutzelman, who kept track of various issues and was enormously
   helpful during the creation of this document.
   Some of the ideas on which this document is based arose during
   discussions over several years between members of the SAAG, the IETF
   CAT working group, and the PSRG, regarding integration of Kerberos
   and SPX.  Some ideas have also been drawn from the DASS system.
   These changes are by no means endorsed by these groups.  This is an
   attempt to revive some of the goals of those groups, and this
   document approaches those goals primarily from the Kerberos
   perspective.
   Lastly, comments from groups working on similar ideas in DCE have
   been invaluable.
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>.  References</span>
<span class="h3"><a class="selflink" id="section-6.1" href="#section-6.1">6.1</a>.  Normative References</span>
   [<a id="ref-IEEE1363">IEEE1363</a>] IEEE, "Standard Specifications for Public Key
              Cryptography", IEEE 1363, 2000.
   [<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="grey">Zhu & Tung                  Standards Track                    [Page 30]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   [<a id="ref-RFC2412">RFC2412</a>]  Orman, H., "The OAKLEY Key Determination Protocol", <a href="./rfc2412">RFC</a>
              <a href="./rfc2412">2412</a>, November 1998.
   [<a id="ref-RFC2631">RFC2631</a>]  Rescorla, E., "Diffie-Hellman Key Agreement Method", <a href="./rfc2631">RFC</a>
              <a href="./rfc2631">2631</a>, June 1999.
   [<a id="ref-RFC3279">RFC3279</a>]  Bassham, L., Polk, W., and R. Housley, "Algorithms and
              Identifiers for the Internet X.509 Public Key
              Infrastructure Certificate and Certificate Revocation List
              (CRL) Profile", <a href="./rfc3279">RFC 3279</a>, April 2002.
   [<a id="ref-RFC3280">RFC3280</a>]  Housley, R., Polk, W., Ford, W., and D. Solo, "Internet
              X.509 Public Key Infrastructure Certificate and
              Certificate Revocation List (CRL) Profile", <a href="./rfc3280">RFC 3280</a>,
              April 2002.
   [<a id="ref-RFC3370">RFC3370</a>]  Housley, R., "Cryptographic Message Syntax (CMS)
              Algorithms", <a href="./rfc3370">RFC 3370</a>, August 2002.
   [<a id="ref-RFC3447">RFC3447</a>]  Jonsson, J. and B. Kaliski, "Public-Key Cryptography
              Standards (PKCS) #1: RSA Cryptography Specifications
              Version 2.1", <a href="./rfc3447">RFC 3447</a>, February 2003.
   [<a id="ref-RFC3526">RFC3526</a>]  Kivinen, T. and M. Kojo, "More Modular Exponential (MODP)
              Diffie-Hellman groups for Internet Key Exchange (IKE)",
              <a href="./rfc3526">RFC 3526</a>, May 2003.
   [<a id="ref-RFC3560">RFC3560</a>]  Housley, R., "Use of the RSAES-OAEP Key Transport
              Algorithm in Cryptographic Message Syntax (CMS)", <a href="./rfc3560">RFC</a>
              <a href="./rfc3560">3560</a>, July 2003.
   [<a id="ref-RFC3766">RFC3766</a>]  Orman, H. and P. Hoffman, "Determining Strengths For
              Public Keys Used For Exchanging Symmetric Keys", <a href="https://www.rfc-editor.org/bcp/bcp86">BCP 86</a>,
              <a href="./rfc3766">RFC 3766</a>, April 2004.
   [<a id="ref-RFC3852">RFC3852</a>]  Housley, R., "Cryptographic Message Syntax (CMS)", <a href="./rfc3852">RFC</a>
              <a href="./rfc3852">3852</a>, July 2004.
   [<a id="ref-RFC3961">RFC3961</a>]  Raeburn, K., "Encryption and Checksum Specifications for
              Kerberos 5", <a href="./rfc3961">RFC 3961</a>, February 2005.
   [<a id="ref-RFC3962">RFC3962</a>]  Raeburn, K., "Advanced Encryption Standard (AES)
              Encryption for Kerberos 5", <a href="./rfc3962">RFC 3962</a>, February 2005.
   [<a id="ref-RFC4086">RFC4086</a>]  Eastlake, D., 3rd, Schiller, J., and S. Crocker,
              "Randomness Requirements for Security", <a href="https://www.rfc-editor.org/bcp/bcp106">BCP 106</a>, <a href="./rfc4086">RFC 4086</a>,
              June 2005.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 31]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   [<a id="ref-RFC4120">RFC4120</a>]  Neuman, C., Yu, T., Hartman, S., and K. Raeburn, "The
              Kerberos Network Authentication Service (V5)", <a href="./rfc4120">RFC 4120</a>,
              July 2005.
   [<a id="ref-X680">X680</a>]     ITU-T Recommendation X.680 (2002) | ISO/IEC 8824-1:2002,
              Information technology - Abstract Syntax Notation One
              (ASN.1): Specification of basic notation.
   [<a id="ref-X690">X690</a>]     ITU-T Recommendation X.690 (2002) | ISO/IEC 8825-1:2002,
              Information technology - ASN.1 encoding Rules:
              Specification of Basic Encoding Rules (BER), Canonical
              Encoding Rules (CER) and Distinguished Encoding Rules
              (DER).
<span class="h3"><a class="selflink" id="section-6.2" href="#section-6.2">6.2</a>.  Informative References</span>
   [<a id="ref-ODL99">ODL99</a>]    Odlyzko, A., "Discrete logarithms: The past and the
              future, Designs, Codes, and Cryptography (1999)".  April
              1999.
   [<a id="ref-RFC4121">RFC4121</a>]  Zhu, L., Jaganathan, K., and S. Hartman, "The Kerberos
              Version 5 Generic Security Service Application Program
              Interface (GSS-API) Mechanism: Version 2", <a href="./rfc4121">RFC 4121</a>, July
              2005.
   [<a id="ref-RFC4158">RFC4158</a>]  Cooper, M., Dzambasow, Y., Hesse, P., Joseph, S., and R.
              Nicholas, "Internet X.509 Public Key Infrastructure:
              Certification Path Building", <a href="./rfc4158">RFC 4158</a>, September 2005.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 32]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
<span class="h2"><a class="selflink" id="appendix-A" href="#appendix-A">Appendix A</a>.  PKINIT ASN.1 Module</span>
       KerberosV5-PK-INIT-SPEC {
               iso(1) identified-organization(3) dod(6) internet(1)
               security(5) kerberosV5(2) modules(4) pkinit(5)
       } DEFINITIONS EXPLICIT TAGS ::= BEGIN
       IMPORTS
           SubjectPublicKeyInfo, AlgorithmIdentifier
               FROM PKIX1Explicit88 { iso (1)
                 identified-organization (3) dod (6) internet (1)
                 security (5) mechanisms (5) pkix (7) id-mod (0)
                 id-pkix1-explicit (18) }
                 -- As defined in <a href="./rfc3280">RFC 3280</a>.
           KerberosTime, PrincipalName, Realm, EncryptionKey, Checksum
               FROM KerberosV5Spec2 { iso(1) identified-organization(3)
                 dod(6) internet(1) security(5) kerberosV5(2)
                 modules(4) krb5spec2(2) };
                 -- as defined in <a href="./rfc4120">RFC 4120</a>.
       id-pkinit OBJECT IDENTIFIER ::=
         { iso(1) identified-organization(3) dod(6) internet(1)
           security(5) kerberosv5(2) pkinit (3) }
       id-pkinit-authData      OBJECT IDENTIFIER  ::= { id-pkinit 1 }
       id-pkinit-DHKeyData     OBJECT IDENTIFIER  ::= { id-pkinit 2 }
       id-pkinit-rkeyData      OBJECT IDENTIFIER  ::= { id-pkinit 3 }
       id-pkinit-KPClientAuth  OBJECT IDENTIFIER  ::= { id-pkinit 4 }
       id-pkinit-KPKdc         OBJECT IDENTIFIER  ::= { id-pkinit 5 }
       id-pkinit-san OBJECT IDENTIFIER ::=
         { iso(1) org(3) dod(6) internet(1) security(5) kerberosv5(2)
           x509SanAN (2) }
       pa-pk-as-req INTEGER ::=                  16
       pa-pk-as-rep INTEGER ::=                  17
       ad-initial-verified-cas INTEGER ::=        9
       td-trusted-certifiers INTEGER ::=        104
       td-invalid-certificates INTEGER ::=      105
       td-dh-parameters INTEGER ::=             109
       PA-PK-AS-REQ ::= SEQUENCE {
          signedAuthPack          [0] IMPLICIT OCTET STRING,
                   -- Contains a CMS type ContentInfo encoded
<span class="grey">Zhu & Tung                  Standards Track                    [Page 33]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo
                   -- is id-signedData (1.2.840.113549.1.7.2),
                   -- and the content field is a SignedData.
                   -- The eContentType field for the type SignedData is
                   -- id-pkinit-authData (1.3.6.1.5.2.3.1), and the
                   -- eContent field contains the DER encoding of the
                   -- type AuthPack.
                   -- AuthPack is defined below.
          trustedCertifiers       [1] SEQUENCE OF
                      ExternalPrincipalIdentifier OPTIONAL,
                   -- Contains a list of CAs, trusted by the client,
                   -- that can be used to certify the KDC.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
                   -- The information contained in the
                   -- trustedCertifiers SHOULD be used by the KDC as
                   -- hints to guide its selection of an appropriate
                   -- certificate chain to return to the client.
          kdcPkId                 [2] IMPLICIT OCTET STRING
                                      OPTIONAL,
                   -- Contains a CMS type SignerIdentifier encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- Identifies, if present, a particular KDC
                   -- public key that the client already has.
          ...
       }
       DHNonce ::= OCTET STRING
       ExternalPrincipalIdentifier ::= SEQUENCE {
          subjectName            [0] IMPLICIT OCTET STRING OPTIONAL,
                   -- Contains a PKIX type Name encoded according to
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- Identifies the certificate subject by the
                   -- distinguished subject name.
                   -- REQUIRED when there is a distinguished subject
                   -- name present in the certificate.
         issuerAndSerialNumber   [1] IMPLICIT OCTET STRING OPTIONAL,
                   -- Contains a CMS type IssuerAndSerialNumber encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- Identifies a certificate of the subject.
                   -- REQUIRED for TD-INVALID-CERTIFICATES and
                   -- TD-TRUSTED-CERTIFIERS.
         subjectKeyIdentifier    [2] IMPLICIT OCTET STRING OPTIONAL,
                   -- Identifies the subject's public key by a key
                   -- identifier.  When an X.509 certificate is
                   -- referenced, this key identifier matches the X.509
<span class="grey">Zhu & Tung                  Standards Track                    [Page 34]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- subjectKeyIdentifier extension value.  When other
                   -- certificate formats are referenced, the documents
                   -- that specify the certificate format and their use
                   -- with the CMS must include details on matching the
                   -- key identifier to the appropriate certificate
                   -- field.
                   -- RECOMMENDED for TD-TRUSTED-CERTIFIERS.
          ...
       }
       AuthPack ::= SEQUENCE {
          pkAuthenticator         [0] PKAuthenticator,
          clientPublicValue       [1] SubjectPublicKeyInfo OPTIONAL,
                   -- Type SubjectPublicKeyInfo is defined in
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- Specifies Diffie-Hellman domain parameters
                   -- and the client's public key value [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>].
                   -- The DH public key value is encoded as a BIT
                   -- STRING according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].
                   -- This field is present only if the client wishes
                   -- to use the Diffie-Hellman key agreement method.
          supportedCMSTypes       [2] SEQUENCE OF AlgorithmIdentifier
                                      OPTIONAL,
                   -- Type AlgorithmIdentifier is defined in
                   -- [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
                   -- List of CMS algorithm [<a href="./rfc3370" title=""Cryptographic Message Syntax (CMS) Algorithms"">RFC3370</a>] identifiers
                   -- that identify key transport algorithms, or
                   -- content encryption algorithms, or signature
                   -- algorithms supported by the client in order of
                   -- (decreasing) preference.
          clientDHNonce           [3] DHNonce OPTIONAL,
                   -- Present only if the client indicates that it
                   -- wishes to reuse DH keys or to allow the KDC to
                   -- do so.
          ...
       }
       PKAuthenticator ::= SEQUENCE {
          cusec                   [0] INTEGER (0..999999),
          ctime                   [1] KerberosTime,
                   -- cusec and ctime are used as in [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>], for
                   -- replay prevention.
          nonce                   [2] INTEGER (0..4294967295),
                   -- Chosen randomly; this nonce does not need to
                   -- match with the nonce in the KDC-REQ-BODY.
          paChecksum              [3] OCTET STRING OPTIONAL,
                   -- MUST be present.
                   -- Contains the SHA1 checksum, performed over
<span class="grey">Zhu & Tung                  Standards Track                    [Page 35]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                   -- KDC-REQ-BODY.
          ...
       }
       TD-TRUSTED-CERTIFIERS ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Identifies a list of CAs trusted by the KDC.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
       TD-INVALID-CERTIFICATES ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Each ExternalPrincipalIdentifier identifies a
                   -- certificate (sent by the client) with an invalid
                   -- signature.
       KRB5PrincipalName ::= SEQUENCE {
           realm                   [0] Realm,
           principalName           [1] PrincipalName
       }
       AD-INITIAL-VERIFIED-CAS ::= SEQUENCE OF
                      ExternalPrincipalIdentifier
                   -- Identifies the certification path based on which
                   -- the client certificate was validated.
                   -- Each ExternalPrincipalIdentifier identifies a CA
                   -- or a CA certificate (thereby its public key).
       PA-PK-AS-REP ::= CHOICE {
          dhInfo                  [0] DHRepInfo,
                   -- Selected when Diffie-Hellman key exchange is
                   -- used.
          encKeyPack              [1] IMPLICIT OCTET STRING,
                   -- Selected when public key encryption is used.
                   -- Contains a CMS type ContentInfo encoded
                   -- according to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo is
                   -- id-envelopedData (1.2.840.113549.1.7.3).
                   -- The content field is an EnvelopedData.
                   -- The contentType field for the type EnvelopedData
                   -- is id-signedData (1.2.840.113549.1.7.2).
                   -- The eContentType field for the inner type
                   -- SignedData (when unencrypted) is
                   -- id-pkinit-rkeyData (1.3.6.1.5.2.3.3) and the
                   -- eContent field contains the DER encoding of the
                   -- type ReplyKeyPack.
                   -- ReplyKeyPack is defined below.
          ...
<span class="grey">Zhu & Tung                  Standards Track                    [Page 36]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
       }
       DHRepInfo ::= SEQUENCE {
          dhSignedData            [0] IMPLICIT OCTET STRING,
                   -- Contains a CMS type ContentInfo encoded according
                   -- to [<a href="./rfc3852" title=""Cryptographic Message Syntax (CMS)"">RFC3852</a>].
                   -- The contentType field of the type ContentInfo is
                   -- id-signedData (1.2.840.113549.1.7.2), and the
                   -- content field is a SignedData.
                   -- The eContentType field for the type SignedData is
                   -- id-pkinit-DHKeyData (1.3.6.1.5.2.3.2), and the
                   -- eContent field contains the DER encoding of the
                   -- type KDCDHKeyInfo.
                   -- KDCDHKeyInfo is defined below.
          serverDHNonce           [1] DHNonce OPTIONAL,
                   -- Present if and only if dhKeyExpiration is
                   -- present.
          ...
       }
       KDCDHKeyInfo ::= SEQUENCE {
          subjectPublicKey        [0] BIT STRING,
                   -- The KDC's DH public key.
                   -- The DH public key value is encoded as a BIT
                   -- STRING according to [<a href="./rfc3279" title=""Algorithms and Identifiers for the Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3279</a>].
          nonce                   [1] INTEGER (0..4294967295),
                   -- Contains the nonce in the pkAuthenticator field
                   -- in the request if the DH keys are NOT reused,
                   -- 0 otherwise.
          dhKeyExpiration         [2] KerberosTime OPTIONAL,
                   -- Expiration time for KDC's key pair,
                   -- present if and only if the DH keys are reused.
                   -- If present, the KDC's DH public key MUST not be
                   -- used past the point of this expiration time.
                   -- If this field is omitted then the serverDHNonce
                   -- field MUST also be omitted.
          ...
       }
       ReplyKeyPack ::= SEQUENCE {
          replyKey                [0] EncryptionKey,
                   -- Contains the session key used to encrypt the
                   -- enc-part field in the AS-REP, i.e., the
                   -- AS reply key.
          asChecksum              [1] Checksum,
                  -- Contains the checksum of the AS-REQ
                  -- corresponding to the containing AS-REP.
                  -- The checksum is performed over the type AS-REQ.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 37]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
                  -- The protocol key [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] of the checksum is the
                  -- replyKey and the key usage number is 6.
                  -- If the replyKey's enctype is "newer" [<a href="./rfc4120" title=""The Kerberos Network Authentication Service (V5)"">RFC4120</a>]
                  -- [<a href="./rfc4121" title=""The Kerberos Version 5 Generic Security Service Application Program Interface (GSS-API) Mechanism: Version 2"">RFC4121</a>], the checksum is the required
                  -- checksum operation [<a href="./rfc3961" title=""Encryption and Checksum Specifications for Kerberos 5"">RFC3961</a>] for that enctype.
                  -- The client MUST verify this checksum upon receipt
                  -- of the AS-REP.
          ...
       }
       TD-DH-PARAMETERS ::= SEQUENCE OF AlgorithmIdentifier
                   -- Each AlgorithmIdentifier specifies a set of
                   -- Diffie-Hellman domain parameters [<a href="#ref-IEEE1363" title=""Standard Specifications for Public Key Cryptography"">IEEE1363</a>].
                   -- This list is in decreasing preference order.
       END
<span class="h2"><a class="selflink" id="appendix-B" href="#appendix-B">Appendix B</a>.  Test Vectors</span>
   Function octetstring2key() is defined in <a href="#section-3.2.3.1">Section 3.2.3.1</a>.  This
   section describes a few sets of test vectors that would be useful for
   implementers of octetstring2key().
   Set 1:
   =====
   Input octet string x is:
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   Output of K-truncate() when the key size is 32 octets:
     5e e5 0d 67 5c 80 9f e5 9e 4a 77 62 c5 4b 65 83
     75 47 ea fb 15 9b d8 cd c7 5f fc a5 91 1e 4c 41
<span class="grey">Zhu & Tung                  Standards Track                    [Page 38]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Set 2:
   =====
   Input octet string x is:
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   Output of K-truncate() when the key size is 32 octets:
     ac f7 70 7c 08 97 3d df db 27 cd 36 14 42 cc fb
     a3 55 c8 88 4c b4 72 f3 7d a6 36 d0 7d 56 78 7e
   Set 3:
   ======
   Input octet string x is:
     00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
     10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e
     0f 10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d
     0e 0f 10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c
     0d 0e 0f 10 00 01 02 03 04 05 06 07 08 09 0a 0b
     0c 0d 0e 0f 10 00 01 02 03 04 05 06 07 08 09 0a
     0b 0c 0d 0e 0f 10 00 01 02 03 04 05 06 07 08 09
     0a 0b 0c 0d 0e 0f 10 00 01 02 03 04 05 06 07 08
   Output of K-truncate() when the key size is 32 octets:
     c4 42 da 58 5f cb 80 e4 3b 47 94 6f 25 40 93 e3
     73 29 d9 90 01 38 0d b7 83 71 db 3a cf 5c 79 7e
   Set 4:
   =====
   Input octet string x is:
     00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
     10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e
     0f 10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d
     0e 0f 10 00 01 02 03 04 05 06 07 08 09 0a 0b 0c
     0d 0e 0f 10 00 01 02 03 04 05 06 07 08
<span class="grey">Zhu & Tung                  Standards Track                    [Page 39]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
   Output of K-truncate() when the key size is 32 octets:
     00 53 95 3b 84 c8 96 f4 eb 38 5c 3f 2e 75 1c 4a
     59 0e d6 ff ad ca 6f f6 4f 47 eb eb 8d 78 0f fc
<span class="h2"><a class="selflink" id="appendix-C" href="#appendix-C">Appendix C</a>.  Miscellaneous Information about Microsoft Windows PKINIT</span>
             Implementations
   Earlier revisions of the PKINIT I-D were implemented in various
   releases of Microsoft Windows and deployed in fairly large numbers.
   To enable the community to interoperate better with systems running
   those releases, the following information may be useful.
   KDC certificates issued by Windows 2000 Enterprise CAs contain a
   dNSName SAN with the DNS name of the host running the KDC, and the
   id-kp-serverAuth EKU [<a href="./rfc3280" title=""Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"">RFC3280</a>].
   KDC certificates issued by Windows 2003 Enterprise CAs contain a
   dNSName SAN with the DNS name of the host running the KDC, the id-
   kp-serverAuth EKU, and the id-ms-kp-sc-logon EKU.
   It is anticipated that the next release of Windows is already too far
   along to allow it to support the issuing KDC certificates with id-
   pkinit-san SAN as specified in this RFC.  Instead, they will have a
   dNSName SAN containing the domain name of the KDC, and the intended
   purpose of these KDC certificates will be restricted by the presence
   of the id-pkinit-KPKdc EKU and id-kp-serverAuth EKU.
   In addition to checking that the above are present in a KDC
   certificate, Windows clients verify that the issuer of the KDC
   certificate is one of a set of allowed issuers of such certificates,
   so those wishing to issue KDC certificates need to configure their
   Windows clients appropriately.
   Client certificates accepted by Windows 2000 and Windows 2003 Server
   KDCs must contain an id-ms-san-sc-logon-upn (1.3.6.1.4.1.311.20.2.3)
   SAN and the id-ms-kp-sc-logon EKU.  The id-ms-san-sc-logon-upn SAN
   contains a UTF8-encoded string whose value is that of the Directory
   Service attribute UserPrincipalName of the client account object, and
   the purpose of including the id-ms-san-sc-logon-upn SAN in the client
   certificate is to validate the client mapping (in other words, the
   client's public key is bound to the account that has this
   UserPrincipalName value).
   It should be noted that all Microsoft Kerberos realm names are
   domain-style realm names and strictly in uppercase.  In addition, the
   UserPrincipalName attribute is globally unique in Windows 2000 and
   Windows 2003.
<span class="grey">Zhu & Tung                  Standards Track                    [Page 40]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
Authors' Addresses
   Larry Zhu
   Microsoft Corporation
   One Microsoft Way
   Redmond, WA  98052
   US
   EMail: lzhu@microsoft.com
   Brian Tung
   Aerospace Corporation
   2350 E. El Segundo Blvd.
   El Segundo, CA  90245
   US
   EMail: brian@aero.org
<span class="grey">Zhu & Tung                  Standards Track                    [Page 41]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span>
<span class="grey"><a href="./rfc4556">RFC 4556</a>                         PKINIT                        June 2006</span>
Full Copyright Statement
   Copyright (C) The Internet Society (2006).
   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 provided by the IETF
   Administrative Support Activity (IASA).
Zhu & Tung                  Standards Track                    [Page 42]
</pre>
 
     |