1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997
// =================================================================
//
// * WARNING *
//
// This file is generated!
//
// Changes made to this file will be overwritten. If changes are
// required to the generated code, the service_crategen project
// must be updated to generate the changes.
//
// =================================================================
use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl AcmPcaClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request = SignedRequest::new(http_method, "acm-pca", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
/// <p>Contains information about the certificate subject. The <code>Subject</code> field in the certificate identifies the entity that owns or controls the public key in the certificate. The entity can be a user, computer, device, or service. The <code>Subject </code>must contain an X.500 distinguished name (DN). A DN is a sequence of relative distinguished names (RDNs). The RDNs are separated by commas in the certificate.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct ASN1Subject {
/// <p>For CA and end-entity certificates in a private PKI, the common name (CN) can be any string within the length limit. </p> <p>Note: In publicly trusted certificates, the common name must be a fully qualified domain name (FQDN) associated with the certificate subject.</p>
#[serde(rename = "CommonName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub common_name: Option<String>,
/// <p>Two-digit code that specifies the country in which the certificate subject located.</p>
#[serde(rename = "Country")]
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
/// <p>Disambiguating information for the certificate subject.</p>
#[serde(rename = "DistinguishedNameQualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distinguished_name_qualifier: Option<String>,
/// <p>Typically a qualifier appended to the name of an individual. Examples include Jr. for junior, Sr. for senior, and III for third.</p>
#[serde(rename = "GenerationQualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub generation_qualifier: Option<String>,
/// <p>First name.</p>
#[serde(rename = "GivenName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub given_name: Option<String>,
/// <p>Concatenation that typically contains the first letter of the <b>GivenName</b>, the first letter of the middle name if one exists, and the first letter of the <b>Surname</b>.</p>
#[serde(rename = "Initials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initials: Option<String>,
/// <p>The locality (such as a city or town) in which the certificate subject is located.</p>
#[serde(rename = "Locality")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locality: Option<String>,
/// <p>Legal name of the organization with which the certificate subject is affiliated. </p>
#[serde(rename = "Organization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization: Option<String>,
/// <p>A subdivision or unit of the organization (such as sales or finance) with which the certificate subject is affiliated.</p>
#[serde(rename = "OrganizationalUnit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organizational_unit: Option<String>,
/// <p>Typically a shortened version of a longer <b>GivenName</b>. For example, Jonathan is often shortened to John. Elizabeth is often shortened to Beth, Liz, or Eliza.</p>
#[serde(rename = "Pseudonym")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pseudonym: Option<String>,
/// <p>The certificate serial number.</p>
#[serde(rename = "SerialNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub serial_number: Option<String>,
/// <p>State in which the subject of the certificate is located.</p>
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
/// <p>Family name. In the US and the UK, for example, the surname of an individual is ordered last. In Asian cultures the surname is typically ordered first.</p>
#[serde(rename = "Surname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub surname: Option<String>,
/// <p>A title such as Mr. or Ms., which is pre-pended to the name to refer formally to the certificate subject.</p>
#[serde(rename = "Title")]
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}
/// <p>Provides access information used by the <code>authorityInfoAccess</code> and <code>subjectInfoAccess</code> extensions described in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AccessDescription {
/// <p>The location of <code>AccessDescription</code> information.</p>
#[serde(rename = "AccessLocation")]
pub access_location: GeneralName,
/// <p>The type and format of <code>AccessDescription</code> information.</p>
#[serde(rename = "AccessMethod")]
pub access_method: AccessMethod,
}
/// <p>Describes the type and format of extension access. Only one of <code>CustomObjectIdentifier</code> or <code>AccessMethodType</code> may be provided. Providing both results in <code>InvalidArgsException</code>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct AccessMethod {
/// <p>Specifies the <code>AccessMethod</code>.</p>
#[serde(rename = "AccessMethodType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_method_type: Option<String>,
/// <p>An object identifier (OID) specifying the <code>AccessMethod</code>. The OID must satisfy the regular expression shown below. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
#[serde(rename = "CustomObjectIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_object_identifier: Option<String>,
}
/// <p>Contains X.509 certificate information to be placed in an issued certificate. An <code>APIPassthrough</code> or <code>APICSRPassthrough</code> template variant must be selected, or else this parameter is ignored. </p> <p>If conflicting or duplicate certificate information is supplied from other sources, ACM Private CA applies <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/UsingTemplates.html#template-order-of-operations">order of operation rules</a> to determine what information is used.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ApiPassthrough {
/// <p>Specifies X.509 extension information for a certificate.</p>
#[serde(rename = "Extensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extensions: Option<Extensions>,
#[serde(rename = "Subject")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject: Option<ASN1Subject>,
}
/// <p>Contains information about your private certificate authority (CA). Your private CA can issue and revoke X.509 digital certificates. Digital certificates verify that the entity named in the certificate <b>Subject</b> field owns or controls the public key contained in the <b>Subject Public Key Info</b> field. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action to create your private CA. You must then call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCertificate.html">GetCertificateAuthorityCertificate</a> action to retrieve a private CA certificate signing request (CSR). Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA certificate. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action to import the signed certificate into AWS Certificate Manager (ACM). </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CertificateAuthority {
/// <p>Amazon Resource Name (ARN) for your private certificate authority (CA). The format is <code> <i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
/// <p>Your private CA configuration.</p>
#[serde(rename = "CertificateAuthorityConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authority_configuration: Option<CertificateAuthorityConfiguration>,
/// <p>Date and time at which your private CA was created.</p>
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
/// <p>Reason the request to create your private CA failed.</p>
#[serde(rename = "FailureReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failure_reason: Option<String>,
/// <p>Defines a cryptographic key management compliance standard used for handling CA keys. </p> <p>Default: FIPS_140_2_LEVEL_3_OR_HIGHER</p> <p>Note: AWS Region ap-northeast-3 supports only FIPS_140_2_LEVEL_2_OR_HIGHER. You must explicitly specify this parameter and value when creating a CA in that Region. Specifying a different value (or no value) results in an <code>InvalidArgsException</code> with the message "A certificate authority cannot be created in this region with the specified security standard."</p>
#[serde(rename = "KeyStorageSecurityStandard")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_storage_security_standard: Option<String>,
/// <p>Date and time at which your private CA was last updated.</p>
#[serde(rename = "LastStateChangeAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_state_change_at: Option<f64>,
/// <p>Date and time after which your private CA certificate is not valid.</p>
#[serde(rename = "NotAfter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not_after: Option<f64>,
/// <p>Date and time before which your private CA certificate is not valid.</p>
#[serde(rename = "NotBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not_before: Option<f64>,
/// <p>The AWS account ID that owns the certificate authority.</p>
#[serde(rename = "OwnerAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner_account: Option<String>,
/// <p>The period during which a deleted CA can be restored. For more information, see the <code>PermanentDeletionTimeInDays</code> parameter of the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthorityRequest.html">DeleteCertificateAuthorityRequest</a> action. </p>
#[serde(rename = "RestorableUntil")]
#[serde(skip_serializing_if = "Option::is_none")]
pub restorable_until: Option<f64>,
/// <p>Information about the certificate revocation list (CRL) created and maintained by your private CA. </p>
#[serde(rename = "RevocationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revocation_configuration: Option<RevocationConfiguration>,
/// <p>Serial number of your private CA.</p>
#[serde(rename = "Serial")]
#[serde(skip_serializing_if = "Option::is_none")]
pub serial: Option<String>,
/// <p>Status of your private CA.</p>
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// <p>Type of your private CA.</p>
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
/// <p>Contains configuration information for your private certificate authority (CA). This includes information about the class of public key algorithm and the key pair that your private CA creates when it issues a certificate. It also includes the signature algorithm that it uses when issuing certificates, and its X.500 distinguished name. You must specify this information when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CertificateAuthorityConfiguration {
/// <p>Specifies information to be added to the extension section of the certificate signing request (CSR).</p>
#[serde(rename = "CsrExtensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub csr_extensions: Option<CsrExtensions>,
/// <p>Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA.</p>
#[serde(rename = "KeyAlgorithm")]
pub key_algorithm: String,
/// <p>Name of the algorithm your private CA uses to sign certificate requests.</p> <p>This parameter should not be confused with the <code>SigningAlgorithm</code> parameter used to sign certificates when they are issued.</p>
#[serde(rename = "SigningAlgorithm")]
pub signing_algorithm: String,
/// <p>Structure that contains X.500 distinguished name information for your private CA.</p>
#[serde(rename = "Subject")]
pub subject: ASN1Subject,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateCertificateAuthorityAuditReportRequest {
/// <p>The format in which to create the report. This can be either <b>JSON</b> or <b>CSV</b>.</p>
#[serde(rename = "AuditReportResponseFormat")]
pub audit_report_response_format: String,
/// <p>The Amazon Resource Name (ARN) of the CA to be audited. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>The name of the S3 bucket that will contain the audit report.</p>
#[serde(rename = "S3BucketName")]
pub s3_bucket_name: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateCertificateAuthorityAuditReportResponse {
/// <p>An alphanumeric string that contains a report identifier.</p>
#[serde(rename = "AuditReportId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit_report_id: Option<String>,
/// <p>The <b>key</b> that uniquely identifies the report file in your S3 bucket.</p>
#[serde(rename = "S3Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_key: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateCertificateAuthorityRequest {
/// <p>Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.</p>
#[serde(rename = "CertificateAuthorityConfiguration")]
pub certificate_authority_configuration: CertificateAuthorityConfiguration,
/// <p>The type of the certificate authority.</p>
#[serde(rename = "CertificateAuthorityType")]
pub certificate_authority_type: String,
/// <p>Custom string that can be used to distinguish between calls to the <b>CreateCertificateAuthority</b> action. Idempotency tokens for <b>CreateCertificateAuthority</b> time out after five minutes. Therefore, if you call <b>CreateCertificateAuthority</b> multiple times with the same idempotency token within five minutes, ACM Private CA recognizes that you are requesting only certificate authority and will issue only one. If you change the idempotency token for each call, PCA recognizes that you are requesting multiple certificate authorities.</p>
#[serde(rename = "IdempotencyToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub idempotency_token: Option<String>,
/// <p>Specifies a cryptographic key management compliance standard used for handling CA keys.</p> <p>Default: FIPS_140_2_LEVEL_3_OR_HIGHER</p> <p>Note: <code>FIPS_140_2_LEVEL_3_OR_HIGHER</code> is not supported in Region ap-northeast-3. When creating a CA in the ap-northeast-3, you must provide <code>FIPS_140_2_LEVEL_2_OR_HIGHER</code> as the argument for <code>KeyStorageSecurityStandard</code>. Failure to do this results in an <code>InvalidArgsException</code> with the message, "A certificate authority cannot be created in this region with the specified security standard."</p>
#[serde(rename = "KeyStorageSecurityStandard")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_storage_security_standard: Option<String>,
/// <p>Contains a Boolean value that you can use to enable a certification revocation list (CRL) for the CA, the name of the S3 bucket to which ACM Private CA will write the CRL, and an optional CNAME alias that you can use to hide the name of your bucket in the <b>CRL Distribution Points</b> extension of your CA certificate. For more information, see the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CrlConfiguration.html">CrlConfiguration</a> structure. </p>
#[serde(rename = "RevocationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revocation_configuration: Option<RevocationConfiguration>,
/// <p>Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with IAM to manage permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateCertificateAuthorityResponse {
/// <p>If successful, the Amazon Resource Name (ARN) of the certificate authority (CA). This is of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authority_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreatePermissionRequest {
/// <p>The actions that the specified AWS service principal can use. These include <code>IssueCertificate</code>, <code>GetCertificate</code>, and <code>ListPermissions</code>.</p>
#[serde(rename = "Actions")]
pub actions: Vec<String>,
/// <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can find the ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>The AWS service or identity that receives the permission. At this time, the only valid principal is <code>acm.amazonaws.com</code>.</p>
#[serde(rename = "Principal")]
pub principal: String,
/// <p>The ID of the calling account.</p>
#[serde(rename = "SourceAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_account: Option<String>,
}
/// <p>Contains configuration information for a certificate revocation list (CRL). Your private certificate authority (CA) creates base CRLs. Delta CRLs are not supported. You can enable CRLs for your new or an existing private CA by setting the <b>Enabled</b> parameter to <code>true</code>. Your private CA writes CRLs to an S3 bucket that you specify in the <b>S3BucketName</b> parameter. You can hide the name of your bucket by specifying a value for the <b>CustomCname</b> parameter. Your private CA copies the CNAME or the S3 bucket name to the <b>CRL Distribution Points</b> extension of each certificate it issues. Your S3 bucket policy must give write permission to ACM Private CA. </p> <p>ACM Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCreateCa.html#crl-encryption">Encrypting Your CRLs</a>.</p> <p>Your private CA uses the value in the <b>ExpirationInDays</b> parameter to calculate the <b>nextUpdate</b> field in the CRL. The CRL is refreshed at 1/2 the age of next update or when a certificate is revoked. When a certificate is revoked, it is recorded in the next CRL that is generated and in the next audit report. Only time valid certificates are listed in the CRL. Expired certificates are not included. </p> <p>CRLs contain the following fields:</p> <ul> <li> <p> <b>Version</b>: The current version number defined in RFC 5280 is V2. The integer value is 0x1. </p> </li> <li> <p> <b>Signature Algorithm</b>: The name of the algorithm used to sign the CRL.</p> </li> <li> <p> <b>Issuer</b>: The X.500 distinguished name of your private CA that issued the CRL.</p> </li> <li> <p> <b>Last Update</b>: The issue date and time of this CRL.</p> </li> <li> <p> <b>Next Update</b>: The day and time by which the next CRL will be issued.</p> </li> <li> <p> <b>Revoked Certificates</b>: List of revoked certificates. Each list item contains the following information.</p> <ul> <li> <p> <b>Serial Number</b>: The serial number, in hexadecimal format, of the revoked certificate.</p> </li> <li> <p> <b>Revocation Date</b>: Date and time the certificate was revoked.</p> </li> <li> <p> <b>CRL Entry Extensions</b>: Optional extensions for the CRL entry.</p> <ul> <li> <p> <b>X509v3 CRL Reason Code</b>: Reason the certificate was revoked.</p> </li> </ul> </li> </ul> </li> <li> <p> <b>CRL Extensions</b>: Optional extensions for the CRL.</p> <ul> <li> <p> <b>X509v3 Authority Key Identifier</b>: Identifies the public key associated with the private key used to sign the certificate.</p> </li> <li> <p> <b>X509v3 CRL Number:</b>: Decimal sequence number for the CRL.</p> </li> </ul> </li> <li> <p> <b>Signature Algorithm</b>: Algorithm used by your private CA to sign the CRL.</p> </li> <li> <p> <b>Signature Value</b>: Signature computed over the CRL.</p> </li> </ul> <p>Certificate revocation lists created by ACM Private CA are DER-encoded. You can use the following OpenSSL command to list a CRL.</p> <p> <code>openssl crl -inform DER -text -in <i>crl_path</i> -noout</code> </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CrlConfiguration {
/// <p>Name inserted into the certificate <b>CRL Distribution Points</b> extension that enables the use of an alias for the CRL distribution point. Use this value if you don't want the name of your S3 bucket to be public.</p>
#[serde(rename = "CustomCname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_cname: Option<String>,
/// <p>Boolean value that specifies whether certificate revocation lists (CRLs) are enabled. You can use this value to enable certificate revocation for a new CA when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action or for an existing CA when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action. </p>
#[serde(rename = "Enabled")]
pub enabled: bool,
/// <p>Validity period of the CRL in days.</p>
#[serde(rename = "ExpirationInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expiration_in_days: Option<i64>,
/// <p>Name of the S3 bucket that contains the CRL. If you do not provide a value for the <b>CustomCname</b> argument, the name of your S3 bucket is placed into the <b>CRL Distribution Points</b> extension of the issued certificate. You can change the name of your bucket by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action. You must specify a <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCreateCa.html#s3-policies">bucket policy</a> that allows ACM Private CA to write the CRL to your bucket.</p>
#[serde(rename = "S3BucketName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket_name: Option<String>,
/// <p>Determines whether the CRL will be publicly readable or privately held in the CRL Amazon S3 bucket. If you choose PUBLIC_READ, the CRL will be accessible over the public internet. If you choose BUCKET_OWNER_FULL_CONTROL, only the owner of the CRL S3 bucket can access the CRL, and your PKI clients may need an alternative method of access. </p> <p>If no value is specified, the default is <code>PUBLIC_READ</code>.</p> <p> <i>Note:</i> This default can cause CA creation to fail in some circumstances. If you have have enabled the Block Public Access (BPA) feature in your S3 account, then you must specify the value of this parameter as <code>BUCKET_OWNER_FULL_CONTROL</code>, and not doing so results in an error. If you have disabled BPA in S3, then you can specify either <code>BUCKET_OWNER_FULL_CONTROL</code> or <code>PUBLIC_READ</code> as the value.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCreateCa.html#s3-bpa">Blocking public access to the S3 bucket</a>.</p>
#[serde(rename = "S3ObjectAcl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_object_acl: Option<String>,
}
/// <p>Describes the certificate extensions to be added to the certificate signing request (CSR).</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct CsrExtensions {
/// <p>Indicates the purpose of the certificate and of the key contained in the certificate.</p>
#[serde(rename = "KeyUsage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_usage: Option<KeyUsage>,
/// <p>For CA certificates, provides a path to additional information pertaining to the CA, such as revocation and policy. For more information, see <a href="https://tools.ietf.org/html/rfc5280#section-4.2.2.2">Subject Information Access</a> in RFC 5280.</p>
#[serde(rename = "SubjectInformationAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_information_access: Option<Vec<AccessDescription>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteCertificateAuthorityRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default.</p>
#[serde(rename = "PermanentDeletionTimeInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub permanent_deletion_time_in_days: Option<i64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeletePermissionRequest {
/// <p>The Amazon Resource Number (ARN) of the private CA that issued the permissions. You can find the CA's ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>The AWS service or identity that will have its CA permissions revoked. At this time, the only valid service principal is <code>acm.amazonaws.com</code> </p>
#[serde(rename = "Principal")]
pub principal: String,
/// <p>The AWS account that calls this action.</p>
#[serde(rename = "SourceAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_account: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeletePolicyRequest {
/// <p>The Amazon Resource Number (ARN) of the private CA that will have its policy deleted. You can find the CA's ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. The ARN value must have the form <code>arn:aws:acm-pca:region:account:certificate-authority/01234567-89ab-cdef-0123-0123456789ab</code>. </p>
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeCertificateAuthorityAuditReportRequest {
/// <p>The report ID returned by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action.</p>
#[serde(rename = "AuditReportId")]
pub audit_report_id: String,
/// <p>The Amazon Resource Name (ARN) of the private CA. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeCertificateAuthorityAuditReportResponse {
/// <p>Specifies whether report creation is in progress, has succeeded, or has failed.</p>
#[serde(rename = "AuditReportStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit_report_status: Option<String>,
/// <p>The date and time at which the report was created.</p>
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
/// <p>Name of the S3 bucket that contains the report.</p>
#[serde(rename = "S3BucketName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_bucket_name: Option<String>,
/// <p>S3 <b>key</b> that uniquely identifies the report file in your S3 bucket.</p>
#[serde(rename = "S3Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s3_key: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeCertificateAuthorityRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeCertificateAuthorityResponse {
/// <p>A <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CertificateAuthority.html">CertificateAuthority</a> structure that contains information about your private CA.</p>
#[serde(rename = "CertificateAuthority")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authority: Option<CertificateAuthority>,
}
/// <p>Describes an Electronic Data Interchange (EDI) entity as described in as defined in <a href="https://tools.ietf.org/html/rfc5280">Subject Alternative Name</a> in RFC 5280.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EdiPartyName {
/// <p>Specifies the name assigner.</p>
#[serde(rename = "NameAssigner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_assigner: Option<String>,
/// <p>Specifies the party name.</p>
#[serde(rename = "PartyName")]
pub party_name: String,
}
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ExtendedKeyUsage {
/// <p>Specifies a custom <code>ExtendedKeyUsage</code> with an object identifier (OID).</p>
#[serde(rename = "ExtendedKeyUsageObjectIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extended_key_usage_object_identifier: Option<String>,
/// <p>Specifies a standard <code>ExtendedKeyUsage</code> as defined as in <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.12">RFC 5280</a>.</p>
#[serde(rename = "ExtendedKeyUsageType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extended_key_usage_type: Option<String>,
}
/// <p>Contains X.509 extension information for a certificate.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Extensions {
/// <p>Contains a sequence of one or more policy information terms, each of which consists of an object identifier (OID) and optional qualifiers. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p> <p>In an end-entity certificate, these terms indicate the policy under which the certificate was issued and the purposes for which it may be used. In a CA certificate, these terms limit the set of policies for certification paths that include this certificate.</p>
#[serde(rename = "CertificatePolicies")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_policies: Option<Vec<PolicyInformation>>,
/// <p>Specifies additional purposes for which the certified public key may be used other than basic purposes indicated in the <code>KeyUsage</code> extension.</p>
#[serde(rename = "ExtendedKeyUsage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extended_key_usage: Option<Vec<ExtendedKeyUsage>>,
#[serde(rename = "KeyUsage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_usage: Option<KeyUsage>,
/// <p>The subject alternative name extension allows identities to be bound to the subject of the certificate. These identities may be included in addition to or in place of the identity in the subject field of the certificate.</p>
#[serde(rename = "SubjectAlternativeNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_alternative_names: Option<Vec<GeneralName>>,
}
/// <p>Describes an ASN.1 X.400 <code>GeneralName</code> as defined in <a href="https://tools.ietf.org/html/rfc5280">RFC 5280</a>. Only one of the following naming options should be provided. Providing more than one option results in an <code>InvalidArgsException</code> error.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct GeneralName {
#[serde(rename = "DirectoryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_name: Option<ASN1Subject>,
/// <p>Represents <code>GeneralName</code> as a DNS name.</p>
#[serde(rename = "DnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_name: Option<String>,
/// <p>Represents <code>GeneralName</code> as an <code>EdiPartyName</code> object.</p>
#[serde(rename = "EdiPartyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub edi_party_name: Option<EdiPartyName>,
/// <p>Represents <code>GeneralName</code> as an IPv4 or IPv6 address.</p>
#[serde(rename = "IpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
/// <p>Represents <code>GeneralName</code> using an <code>OtherName</code> object.</p>
#[serde(rename = "OtherName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub other_name: Option<OtherName>,
/// <p> Represents <code>GeneralName</code> as an object identifier (OID).</p>
#[serde(rename = "RegisteredId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub registered_id: Option<String>,
/// <p>Represents <code>GeneralName</code> as an <a href="https://tools.ietf.org/html/rfc822">RFC 822</a> email address.</p>
#[serde(rename = "Rfc822Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rfc_822_name: Option<String>,
/// <p>Represents <code>GeneralName</code> as a URI.</p>
#[serde(rename = "UniformResourceIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub uniform_resource_identifier: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCertificateAuthorityCertificateRequest {
/// <p>The Amazon Resource Name (ARN) of your private CA. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCertificateAuthorityCertificateResponse {
/// <p>Base64-encoded certificate authority (CA) certificate.</p>
#[serde(rename = "Certificate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate: Option<String>,
/// <p>Base64-encoded certificate chain that includes any intermediate certificates and chains up to root certificate that you used to sign your private CA certificate. The chain does not include your private CA certificate. If this is a root CA, the value will be null.</p>
#[serde(rename = "CertificateChain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_chain: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCertificateAuthorityCsrRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCertificateAuthorityCsrResponse {
/// <p>The base64 PEM-encoded certificate signing request (CSR) for your private CA certificate.</p>
#[serde(rename = "Csr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub csr: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetCertificateRequest {
/// <p>The ARN of the issued certificate. The ARN contains the certificate serial number and must be in the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>/certificate/<i>286535153982981100925020015808220737245</i> </code> </p>
#[serde(rename = "CertificateArn")]
pub certificate_arn: String,
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetCertificateResponse {
/// <p>The base64 PEM-encoded certificate specified by the <code>CertificateArn</code> parameter.</p>
#[serde(rename = "Certificate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate: Option<String>,
/// <p>The base64 PEM-encoded certificate chain that chains up to the root CA certificate that you used to sign your private CA certificate. </p>
#[serde(rename = "CertificateChain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_chain: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetPolicyRequest {
/// <p>The Amazon Resource Number (ARN) of the private CA that will have its policy retrieved. You can find the CA's ARN by calling the ListCertificateAuthorities action. </p>
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetPolicyResponse {
/// <p>The policy attached to the private CA as a JSON document.</p>
#[serde(rename = "Policy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ImportCertificateAuthorityCertificateRequest {
/// <p>The PEM-encoded certificate for a private CA. This may be a self-signed certificate in the case of a root CA, or it may be signed by another CA that you control.</p>
#[serde(rename = "Certificate")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub certificate: bytes::Bytes,
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>A PEM-encoded file that contains all of your certificates, other than the certificate you're importing, chaining up to your root CA. Your ACM Private CA-hosted or on-premises root certificate is the last in the chain, and each certificate in the chain signs the one preceding. </p> <p>This parameter must be supplied when you import a subordinate CA. When you import a root CA, there is no chain.</p>
#[serde(rename = "CertificateChain")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_chain: Option<bytes::Bytes>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct IssueCertificateRequest {
/// <p>Specifies X.509 certificate information to be included in the issued certificate. An <code>APIPassthrough</code> or <code>APICSRPassthrough</code> template variant must be selected, or else this parameter is ignored. For more information about using these templates, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/UsingTemplates.html">Understanding Certificate Templates</a>.</p> <p>If conflicting or duplicate certificate information is supplied during certificate issuance, ACM Private CA applies <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/UsingTemplates.html#template-order-of-operations">order of operation rules</a> to determine what information is used.</p>
#[serde(rename = "ApiPassthrough")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api_passthrough: Option<ApiPassthrough>,
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>The certificate signing request (CSR) for the certificate you want to issue. As an example, you can use the following OpenSSL command to create the CSR and a 2048 bit RSA private key. </p> <p> <code>openssl req -new -newkey rsa:2048 -days 365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr</code> </p> <p>If you have a configuration file, you can then use the following OpenSSL command. The <code>usr_cert</code> block in the configuration file contains your X509 version 3 extensions. </p> <p> <code>openssl req -new -config openssl_rsa.cnf -extensions usr_cert -newkey rsa:2048 -days -365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr</code> </p> <p>Note: A CSR must provide either a <i>subject name</i> or a <i>subject alternative name</i> or the request will be rejected. </p>
#[serde(rename = "Csr")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub csr: bytes::Bytes,
/// <p>Alphanumeric string that can be used to distinguish between calls to the <b>IssueCertificate</b> action. Idempotency tokens for <b>IssueCertificate</b> time out after one minute. Therefore, if you call <b>IssueCertificate</b> multiple times with the same idempotency token within one minute, ACM Private CA recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, PCA recognizes that you are requesting multiple certificates.</p>
#[serde(rename = "IdempotencyToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub idempotency_token: Option<String>,
/// <p>The name of the algorithm that will be used to sign the certificate to be issued. </p> <p>This parameter should not be confused with the <code>SigningAlgorithm</code> parameter used to sign a CSR in the <code>CreateCertificateAuthority</code> action.</p>
#[serde(rename = "SigningAlgorithm")]
pub signing_algorithm: String,
/// <p>Specifies a custom configuration template to use when issuing a certificate. If this parameter is not provided, ACM Private CA defaults to the <code>EndEntityCertificate/V1</code> template. For CA certificates, you should choose the shortest path length that meets your needs. The path length is indicated by the PathLen<i>N</i> portion of the ARN, where <i>N</i> is the <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaTerms.html#terms-cadepth">CA depth</a>.</p> <p>Note: The CA depth configured on a subordinate CA certificate must not exceed the limit set by its parents in the CA hierarchy.</p> <p>For a list of <code>TemplateArn</code> values supported by ACM Private CA, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/UsingTemplates.html">Understanding Certificate Templates</a>.</p>
#[serde(rename = "TemplateArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub template_arn: Option<String>,
/// <p>Information describing the end of the validity period of the certificate. This parameter sets the “Not After” date for the certificate.</p> <p>Certificate validity is the period of time during which a certificate is valid. Validity can be expressed as an explicit date and time when the certificate expires, or as a span of time after issuance, stated in days, months, or years. For more information, see <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.5">Validity</a> in RFC 5280. </p> <p>This value is unaffected when <code>ValidityNotBefore</code> is also specified. For example, if <code>Validity</code> is set to 20 days in the future, the certificate will expire 20 days from issuance time regardless of the <code>ValidityNotBefore</code> value.</p> <p>The end of the validity period configured on a certificate must not exceed the limit set on its parents in the CA hierarchy.</p>
#[serde(rename = "Validity")]
pub validity: Validity,
/// <p>Information describing the start of the validity period of the certificate. This parameter sets the “Not Before" date for the certificate.</p> <p>By default, when issuing a certificate, ACM Private CA sets the "Not Before" date to the issuance time minus 60 minutes. This compensates for clock inconsistencies across computer systems. The <code>ValidityNotBefore</code> parameter can be used to customize the “Not Before” value. </p> <p>Unlike the <code>Validity</code> parameter, the <code>ValidityNotBefore</code> parameter is optional.</p> <p>The <code>ValidityNotBefore</code> value is expressed as an explicit date and time, using the <code>Validity</code> type value <code>ABSOLUTE</code>. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_Validity.html">Validity</a> in this API reference and <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.5">Validity</a> in RFC 5280.</p>
#[serde(rename = "ValidityNotBefore")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validity_not_before: Option<Validity>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct IssueCertificateResponse {
/// <p>The Amazon Resource Name (ARN) of the issued certificate and the certificate serial number. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>/certificate/<i>286535153982981100925020015808220737245</i> </code> </p>
#[serde(rename = "CertificateArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_arn: Option<String>,
}
/// <p>Defines one or more purposes for which the key contained in the certificate can be used. Default value for each option is false.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct KeyUsage {
/// <p>Key can be used to sign CRLs.</p>
#[serde(rename = "CRLSign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub crl_sign: Option<bool>,
/// <p>Key can be used to decipher data.</p>
#[serde(rename = "DataEncipherment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_encipherment: Option<bool>,
/// <p>Key can be used only to decipher data.</p>
#[serde(rename = "DecipherOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub decipher_only: Option<bool>,
/// <p> Key can be used for digital signing.</p>
#[serde(rename = "DigitalSignature")]
#[serde(skip_serializing_if = "Option::is_none")]
pub digital_signature: Option<bool>,
/// <p>Key can be used only to encipher data.</p>
#[serde(rename = "EncipherOnly")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encipher_only: Option<bool>,
/// <p>Key can be used in a key-agreement protocol.</p>
#[serde(rename = "KeyAgreement")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_agreement: Option<bool>,
/// <p>Key can be used to sign certificates.</p>
#[serde(rename = "KeyCertSign")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_cert_sign: Option<bool>,
/// <p>Key can be used to encipher data.</p>
#[serde(rename = "KeyEncipherment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key_encipherment: Option<bool>,
/// <p>Key can be used for non-repudiation.</p>
#[serde(rename = "NonRepudiation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub non_repudiation: Option<bool>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListCertificateAuthoritiesRequest {
/// <p>Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. If additional items exist beyond the number you specify, the <code>NextToken</code> element is sent in the response. Use this <code>NextToken</code> value in a subsequent request to retrieve additional items.</p>
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
/// <p>Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the <code>NextToken</code> parameter from the response you just received.</p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
/// <p>Use this parameter to filter the returned set of certificate authorities based on their owner. The default is SELF.</p>
#[serde(rename = "ResourceOwner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_owner: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListCertificateAuthoritiesResponse {
/// <p>Summary information about each certificate authority you have created.</p>
#[serde(rename = "CertificateAuthorities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authorities: Option<Vec<CertificateAuthority>>,
/// <p>When the list is truncated, this value is present and should be used for the <code>NextToken</code> parameter in a subsequent pagination request.</p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListPermissionsRequest {
/// <p>The Amazon Resource Number (ARN) of the private CA to inspect. You can find the ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. This must be of the form: <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> You can get a private CA's ARN by running the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action.</p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>When paginating results, use this parameter to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the <b>NextToken</b> element is sent in the response. Use this <b>NextToken</b> value in a subsequent request to retrieve additional items.</p>
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
/// <p>When paginating results, use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <b>NextToken</b> from the response you just received.</p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListPermissionsResponse {
/// <p>When the list is truncated, this value is present and should be used for the <b>NextToken</b> parameter in a subsequent pagination request. </p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
/// <p>Summary information about each permission assigned by the specified private CA, including the action enabled, the policy provided, and the time of creation.</p>
#[serde(rename = "Permissions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub permissions: Option<Vec<Permission>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListTagsRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>Use this parameter when paginating results to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the <b>NextToken</b> element is sent in the response. Use this <b>NextToken</b> value in a subsequent request to retrieve additional items.</p>
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
/// <p>Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of <b>NextToken</b> from the response you just received.</p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsResponse {
/// <p>When the list is truncated, this value is present and should be used for the <b>NextToken</b> parameter in a subsequent pagination request. </p>
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
/// <p>The tags associated with your private CA.</p>
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
/// <p>Defines a custom ASN.1 X.400 <code>GeneralName</code> using an object identifier (OID) and value. The OID must satisfy the regular expression shown below. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct OtherName {
/// <p>Specifies an OID. </p>
#[serde(rename = "TypeId")]
pub type_id: String,
/// <p>Specifies an OID value.</p>
#[serde(rename = "Value")]
pub value: String,
}
/// <p>Permissions designate which private CA actions can be performed by an AWS service or entity. In order for ACM to automatically renew private certificates, you must give the ACM service principal all available permissions (<code>IssueCertificate</code>, <code>GetCertificate</code>, and <code>ListPermissions</code>). Permissions can be assigned with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html">CreatePermission</a> action, removed with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html">DeletePermission</a> action, and listed with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html">ListPermissions</a> action.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Permission {
/// <p>The private CA actions that can be performed by the designated AWS service.</p>
#[serde(rename = "Actions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub actions: Option<Vec<String>>,
/// <p>The Amazon Resource Number (ARN) of the private CA from which the permission was issued.</p>
#[serde(rename = "CertificateAuthorityArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authority_arn: Option<String>,
/// <p>The time at which the permission was created.</p>
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<f64>,
/// <p>The name of the policy that is associated with the permission.</p>
#[serde(rename = "Policy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy: Option<String>,
/// <p>The AWS service or entity that holds the permission. At this time, the only valid principal is <code>acm.amazonaws.com</code>.</p>
#[serde(rename = "Principal")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal: Option<String>,
/// <p>The ID of the account that assigned the permission.</p>
#[serde(rename = "SourceAccount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_account: Option<String>,
}
/// <p>Defines the X.509 <code>CertificatePolicies</code> extension.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PolicyInformation {
/// <p>Specifies the object identifier (OID) of the certificate policy under which the certificate was issued. For more information, see NIST's definition of <a href="https://csrc.nist.gov/glossary/term/Object_Identifier">Object Identifier (OID)</a>.</p>
#[serde(rename = "CertPolicyId")]
pub cert_policy_id: String,
/// <p>Modifies the given <code>CertPolicyId</code> with a qualifier. ACM Private CA supports the certification practice statement (CPS) qualifier.</p>
#[serde(rename = "PolicyQualifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_qualifiers: Option<Vec<PolicyQualifierInfo>>,
}
/// <p>Modifies the <code>CertPolicyId</code> of a <code>PolicyInformation</code> object with a qualifier. ACM Private CA supports the certification practice statement (CPS) qualifier.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PolicyQualifierInfo {
/// <p>Identifies the qualifier modifying a <code>CertPolicyId</code>.</p>
#[serde(rename = "PolicyQualifierId")]
pub policy_qualifier_id: String,
/// <p>Defines the qualifier type. ACM Private CA supports the use of a URI for a CPS qualifier in this field.</p>
#[serde(rename = "Qualifier")]
pub qualifier: Qualifier,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct PutPolicyRequest {
/// <p>The path and file name of a JSON-formatted IAM policy to attach to the specified private CA resource. If this policy does not contain all required statements or if it includes any statement that is not allowed, the <code>PutPolicy</code> action returns an <code>InvalidPolicyException</code>. For information about IAM policy and statement structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json">Overview of JSON Policies</a>.</p>
#[serde(rename = "Policy")]
pub policy: String,
/// <p><p>The Amazon Resource Number (ARN) of the private CA to associate with the policy. The ARN of the CA can be found by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action.</p> <p/></p>
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
/// <p>Defines a <code>PolicyInformation</code> qualifier. ACM Private CA supports the <a href="https://tools.ietf.org/html/rfc5280#section-4.2.1.4">certification practice statement (CPS) qualifier</a> defined in RFC 5280. </p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Qualifier {
/// <p>Contains a pointer to a certification practice statement (CPS) published by the CA.</p>
#[serde(rename = "CpsUri")]
pub cps_uri: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct RestoreCertificateAuthorityRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
}
/// <p>Certificate revocation information used by the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> and <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> actions. Your private certificate authority (CA) can create and maintain a certificate revocation list (CRL). A CRL contains information about certificates revoked by your CA. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html">RevokeCertificate</a>.</p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct RevocationConfiguration {
/// <p>Configuration of the certificate revocation list (CRL), if any, maintained by your private CA.</p>
#[serde(rename = "CrlConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub crl_configuration: Option<CrlConfiguration>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct RevokeCertificateRequest {
/// <p>Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial number by calling <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html">GetCertificate</a> with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The <b>GetCertificate</b> action retrieves the certificate in the PEM format. You can use the following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. </p> <p> <code>openssl x509 -in <i>file_path</i> -text -noout</code> </p> <p>You can also copy the serial number from the console or use the <a href="https://docs.aws.amazon.com/acm/latest/APIReference/API_DescribeCertificate.html">DescribeCertificate</a> action in the <i>AWS Certificate Manager API Reference</i>. </p>
#[serde(rename = "CertificateSerial")]
pub certificate_serial: String,
/// <p>Specifies why you revoked the certificate.</p>
#[serde(rename = "RevocationReason")]
pub revocation_reason: String,
}
/// <p>Tags are labels that you can use to identify and organize your private CAs. Each tag consists of a key and an optional value. You can associate up to 50 tags with a private CA. To add one or more tags to a private CA, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html">TagCertificateAuthority</a> action. To remove a tag, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html">UntagCertificateAuthority</a> action. </p>
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Tag {
/// <p>Key (name) of the tag.</p>
#[serde(rename = "Key")]
pub key: String,
/// <p>Value of the tag.</p>
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagCertificateAuthorityRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>List of tags to be associated with the CA.</p>
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagCertificateAuthorityRequest {
/// <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>List of tags to be removed from the CA.</p>
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateCertificateAuthorityRequest {
/// <p>Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
#[serde(rename = "CertificateAuthorityArn")]
pub certificate_authority_arn: String,
/// <p>Revocation information for your private CA.</p>
#[serde(rename = "RevocationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revocation_configuration: Option<RevocationConfiguration>,
/// <p>Status of your private CA.</p>
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
/// <p>Validity specifies the period of time during which a certificate is valid. Validity can be expressed as an explicit date and time when the validity of a certificate starts or expires, or as a span of time after issuance, stated in days, months, or years. For more information, see <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.5">Validity</a> in RFC 5280.</p> <p>ACM Private CA API consumes the <code>Validity</code> data type differently in two distinct parameters of the <code>IssueCertificate</code> action. The required parameter <code>IssueCertificate</code>:<code>Validity</code> specifies the end of a certificate's validity period. The optional parameter <code>IssueCertificate</code>:<code>ValidityNotBefore</code> specifies a customized starting time for the validity period.</p>
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct Validity {
/// <p>Determines how <i>ACM Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output. </p> <p> <code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p> <ul> <li> <p>Sample input value: 491231235959 (UTCTime format)</p> </li> <li> <p>Output expiration date/time: 12/31/2049 23:59:59</p> </li> </ul> <p> <code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch. </p> <ul> <li> <p>Sample input value: 2524608000</p> </li> <li> <p>Output expiration date/time: 01/01/2050 00:00:00</p> </li> </ul> <p> <code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years. </p> <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p> <ul> <li> <p>Sample input value: 90</p> </li> <li> <p>Output expiration date: 01/10/2020 12:34:54 UTC</p> </li> </ul> <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
#[serde(rename = "Type")]
pub type_: String,
/// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
#[serde(rename = "Value")]
pub value: i64,
}
/// Errors returned by CreateCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum CreateCertificateAuthorityError {
/// <p>One or more of the specified arguments was not valid.</p>
InvalidArgs(String),
/// <p>The resource policy is invalid or is missing a required statement. For general information about IAM policy and statement structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json">Overview of JSON Policies</a>.</p>
InvalidPolicy(String),
/// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
InvalidTag(String),
/// <p>An ACM Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.</p>
LimitExceeded(String),
}
impl CreateCertificateAuthorityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArgsException" => {
return RusotoError::Service(CreateCertificateAuthorityError::InvalidArgs(
err.msg,
))
}
"InvalidPolicyException" => {
return RusotoError::Service(CreateCertificateAuthorityError::InvalidPolicy(
err.msg,
))
}
"InvalidTagException" => {
return RusotoError::Service(CreateCertificateAuthorityError::InvalidTag(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(CreateCertificateAuthorityError::LimitExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateCertificateAuthorityError::InvalidArgs(ref cause) => write!(f, "{}", cause),
CreateCertificateAuthorityError::InvalidPolicy(ref cause) => write!(f, "{}", cause),
CreateCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
CreateCertificateAuthorityError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateCertificateAuthorityError {}
/// Errors returned by CreateCertificateAuthorityAuditReport
#[derive(Debug, PartialEq)]
pub enum CreateCertificateAuthorityAuditReportError {
/// <p>One or more of the specified arguments was not valid.</p>
InvalidArgs(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>Your request is already in progress.</p>
RequestInProgress(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl CreateCertificateAuthorityAuditReportError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateCertificateAuthorityAuditReportError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArgsException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::InvalidArgs(err.msg),
)
}
"InvalidArnException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::InvalidArn(err.msg),
)
}
"InvalidStateException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::InvalidState(err.msg),
)
}
"RequestFailedException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::RequestFailed(err.msg),
)
}
"RequestInProgressException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::RequestInProgress(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
CreateCertificateAuthorityAuditReportError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateCertificateAuthorityAuditReportError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateCertificateAuthorityAuditReportError::InvalidArgs(ref cause) => {
write!(f, "{}", cause)
}
CreateCertificateAuthorityAuditReportError::InvalidArn(ref cause) => {
write!(f, "{}", cause)
}
CreateCertificateAuthorityAuditReportError::InvalidState(ref cause) => {
write!(f, "{}", cause)
}
CreateCertificateAuthorityAuditReportError::RequestFailed(ref cause) => {
write!(f, "{}", cause)
}
CreateCertificateAuthorityAuditReportError::RequestInProgress(ref cause) => {
write!(f, "{}", cause)
}
CreateCertificateAuthorityAuditReportError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for CreateCertificateAuthorityAuditReportError {}
/// Errors returned by CreatePermission
#[derive(Debug, PartialEq)]
pub enum CreatePermissionError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>An ACM Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.</p>
LimitExceeded(String),
/// <p>The designated permission has already been given to the user.</p>
PermissionAlreadyExists(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl CreatePermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreatePermissionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(CreatePermissionError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(CreatePermissionError::InvalidState(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreatePermissionError::LimitExceeded(err.msg))
}
"PermissionAlreadyExistsException" => {
return RusotoError::Service(CreatePermissionError::PermissionAlreadyExists(
err.msg,
))
}
"RequestFailedException" => {
return RusotoError::Service(CreatePermissionError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreatePermissionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreatePermissionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreatePermissionError::InvalidArn(ref cause) => write!(f, "{}", cause),
CreatePermissionError::InvalidState(ref cause) => write!(f, "{}", cause),
CreatePermissionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreatePermissionError::PermissionAlreadyExists(ref cause) => write!(f, "{}", cause),
CreatePermissionError::RequestFailed(ref cause) => write!(f, "{}", cause),
CreatePermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreatePermissionError {}
/// Errors returned by DeleteCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum DeleteCertificateAuthorityError {
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl DeleteCertificateAuthorityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
DeleteCertificateAuthorityError::ConcurrentModification(err.msg),
)
}
"InvalidArnException" => {
return RusotoError::Service(DeleteCertificateAuthorityError::InvalidArn(
err.msg,
))
}
"InvalidStateException" => {
return RusotoError::Service(DeleteCertificateAuthorityError::InvalidState(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteCertificateAuthorityError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteCertificateAuthorityError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
DeleteCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
DeleteCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
DeleteCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteCertificateAuthorityError {}
/// Errors returned by DeletePermission
#[derive(Debug, PartialEq)]
pub enum DeletePermissionError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl DeletePermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePermissionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(DeletePermissionError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(DeletePermissionError::InvalidState(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(DeletePermissionError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeletePermissionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeletePermissionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeletePermissionError::InvalidArn(ref cause) => write!(f, "{}", cause),
DeletePermissionError::InvalidState(ref cause) => write!(f, "{}", cause),
DeletePermissionError::RequestFailed(ref cause) => write!(f, "{}", cause),
DeletePermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeletePermissionError {}
/// Errors returned by DeletePolicy
#[derive(Debug, PartialEq)]
pub enum DeletePolicyError {
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The current action was prevented because it would lock the caller out from performing subsequent actions. Verify that the specified parameters would not result in the caller being denied access to the resource. </p>
LockoutPrevented(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl DeletePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeletePolicyError::ConcurrentModification(err.msg))
}
"InvalidArnException" => {
return RusotoError::Service(DeletePolicyError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(DeletePolicyError::InvalidState(err.msg))
}
"LockoutPreventedException" => {
return RusotoError::Service(DeletePolicyError::LockoutPrevented(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(DeletePolicyError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeletePolicyError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeletePolicyError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeletePolicyError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
DeletePolicyError::InvalidArn(ref cause) => write!(f, "{}", cause),
DeletePolicyError::InvalidState(ref cause) => write!(f, "{}", cause),
DeletePolicyError::LockoutPrevented(ref cause) => write!(f, "{}", cause),
DeletePolicyError::RequestFailed(ref cause) => write!(f, "{}", cause),
DeletePolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeletePolicyError {}
/// Errors returned by DescribeCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum DescribeCertificateAuthorityError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl DescribeCertificateAuthorityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(DescribeCertificateAuthorityError::InvalidArn(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeCertificateAuthorityError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
DescribeCertificateAuthorityError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeCertificateAuthorityError {}
/// Errors returned by DescribeCertificateAuthorityAuditReport
#[derive(Debug, PartialEq)]
pub enum DescribeCertificateAuthorityAuditReportError {
/// <p>One or more of the specified arguments was not valid.</p>
InvalidArgs(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl DescribeCertificateAuthorityAuditReportError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCertificateAuthorityAuditReportError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArgsException" => {
return RusotoError::Service(
DescribeCertificateAuthorityAuditReportError::InvalidArgs(err.msg),
)
}
"InvalidArnException" => {
return RusotoError::Service(
DescribeCertificateAuthorityAuditReportError::InvalidArn(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeCertificateAuthorityAuditReportError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeCertificateAuthorityAuditReportError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeCertificateAuthorityAuditReportError::InvalidArgs(ref cause) => {
write!(f, "{}", cause)
}
DescribeCertificateAuthorityAuditReportError::InvalidArn(ref cause) => {
write!(f, "{}", cause)
}
DescribeCertificateAuthorityAuditReportError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeCertificateAuthorityAuditReportError {}
/// Errors returned by GetCertificate
#[derive(Debug, PartialEq)]
pub enum GetCertificateError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>Your request is already in progress.</p>
RequestInProgress(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl GetCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCertificateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(GetCertificateError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(GetCertificateError::InvalidState(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(GetCertificateError::RequestFailed(err.msg))
}
"RequestInProgressException" => {
return RusotoError::Service(GetCertificateError::RequestInProgress(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetCertificateError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCertificateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
GetCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
GetCertificateError::RequestFailed(ref cause) => write!(f, "{}", cause),
GetCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
GetCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCertificateError {}
/// Errors returned by GetCertificateAuthorityCertificate
#[derive(Debug, PartialEq)]
pub enum GetCertificateAuthorityCertificateError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl GetCertificateAuthorityCertificateError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetCertificateAuthorityCertificateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(
GetCertificateAuthorityCertificateError::InvalidArn(err.msg),
)
}
"InvalidStateException" => {
return RusotoError::Service(
GetCertificateAuthorityCertificateError::InvalidState(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
GetCertificateAuthorityCertificateError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCertificateAuthorityCertificateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCertificateAuthorityCertificateError::InvalidArn(ref cause) => {
write!(f, "{}", cause)
}
GetCertificateAuthorityCertificateError::InvalidState(ref cause) => {
write!(f, "{}", cause)
}
GetCertificateAuthorityCertificateError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for GetCertificateAuthorityCertificateError {}
/// Errors returned by GetCertificateAuthorityCsr
#[derive(Debug, PartialEq)]
pub enum GetCertificateAuthorityCsrError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>Your request is already in progress.</p>
RequestInProgress(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl GetCertificateAuthorityCsrError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<GetCertificateAuthorityCsrError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(GetCertificateAuthorityCsrError::InvalidArn(
err.msg,
))
}
"InvalidStateException" => {
return RusotoError::Service(GetCertificateAuthorityCsrError::InvalidState(
err.msg,
))
}
"RequestFailedException" => {
return RusotoError::Service(GetCertificateAuthorityCsrError::RequestFailed(
err.msg,
))
}
"RequestInProgressException" => {
return RusotoError::Service(
GetCertificateAuthorityCsrError::RequestInProgress(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetCertificateAuthorityCsrError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetCertificateAuthorityCsrError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetCertificateAuthorityCsrError::InvalidArn(ref cause) => write!(f, "{}", cause),
GetCertificateAuthorityCsrError::InvalidState(ref cause) => write!(f, "{}", cause),
GetCertificateAuthorityCsrError::RequestFailed(ref cause) => write!(f, "{}", cause),
GetCertificateAuthorityCsrError::RequestInProgress(ref cause) => write!(f, "{}", cause),
GetCertificateAuthorityCsrError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetCertificateAuthorityCsrError {}
/// Errors returned by GetPolicy
#[derive(Debug, PartialEq)]
pub enum GetPolicyError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl GetPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(GetPolicyError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(GetPolicyError::InvalidState(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(GetPolicyError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetPolicyError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetPolicyError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetPolicyError::InvalidArn(ref cause) => write!(f, "{}", cause),
GetPolicyError::InvalidState(ref cause) => write!(f, "{}", cause),
GetPolicyError::RequestFailed(ref cause) => write!(f, "{}", cause),
GetPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetPolicyError {}
/// Errors returned by ImportCertificateAuthorityCertificate
#[derive(Debug, PartialEq)]
pub enum ImportCertificateAuthorityCertificateError {
/// <p>The certificate authority certificate you are importing does not comply with conditions specified in the certificate that signed it.</p>
CertificateMismatch(String),
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The request action cannot be performed or is prohibited.</p>
InvalidRequest(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>One or more fields in the certificate are invalid.</p>
MalformedCertificate(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>Your request is already in progress.</p>
RequestInProgress(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl ImportCertificateAuthorityCertificateError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ImportCertificateAuthorityCertificateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"CertificateMismatchException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::CertificateMismatch(err.msg),
)
}
"ConcurrentModificationException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::ConcurrentModification(err.msg),
)
}
"InvalidArnException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::InvalidArn(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::InvalidRequest(err.msg),
)
}
"InvalidStateException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::InvalidState(err.msg),
)
}
"MalformedCertificateException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::MalformedCertificate(err.msg),
)
}
"RequestFailedException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::RequestFailed(err.msg),
)
}
"RequestInProgressException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::RequestInProgress(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
ImportCertificateAuthorityCertificateError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ImportCertificateAuthorityCertificateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ImportCertificateAuthorityCertificateError::CertificateMismatch(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::InvalidArn(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::InvalidRequest(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::InvalidState(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::MalformedCertificate(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::RequestFailed(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::RequestInProgress(ref cause) => {
write!(f, "{}", cause)
}
ImportCertificateAuthorityCertificateError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for ImportCertificateAuthorityCertificateError {}
/// Errors returned by IssueCertificate
#[derive(Debug, PartialEq)]
pub enum IssueCertificateError {
/// <p>One or more of the specified arguments was not valid.</p>
InvalidArgs(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>An ACM Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.</p>
LimitExceeded(String),
/// <p>The certificate signing request is invalid.</p>
MalformedCSR(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl IssueCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<IssueCertificateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArgsException" => {
return RusotoError::Service(IssueCertificateError::InvalidArgs(err.msg))
}
"InvalidArnException" => {
return RusotoError::Service(IssueCertificateError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(IssueCertificateError::InvalidState(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(IssueCertificateError::LimitExceeded(err.msg))
}
"MalformedCSRException" => {
return RusotoError::Service(IssueCertificateError::MalformedCSR(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(IssueCertificateError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for IssueCertificateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
IssueCertificateError::InvalidArgs(ref cause) => write!(f, "{}", cause),
IssueCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
IssueCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
IssueCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
IssueCertificateError::MalformedCSR(ref cause) => write!(f, "{}", cause),
IssueCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for IssueCertificateError {}
/// Errors returned by ListCertificateAuthorities
#[derive(Debug, PartialEq)]
pub enum ListCertificateAuthoritiesError {
/// <p>The token specified in the <code>NextToken</code> argument is not valid. Use the token returned from your previous call to <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>.</p>
InvalidNextToken(String),
}
impl ListCertificateAuthoritiesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListCertificateAuthoritiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidNextTokenException" => {
return RusotoError::Service(ListCertificateAuthoritiesError::InvalidNextToken(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListCertificateAuthoritiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListCertificateAuthoritiesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListCertificateAuthoritiesError {}
/// Errors returned by ListPermissions
#[derive(Debug, PartialEq)]
pub enum ListPermissionsError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The token specified in the <code>NextToken</code> argument is not valid. Use the token returned from your previous call to <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a>.</p>
InvalidNextToken(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl ListPermissionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListPermissionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(ListPermissionsError::InvalidArn(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListPermissionsError::InvalidNextToken(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(ListPermissionsError::InvalidState(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(ListPermissionsError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListPermissionsError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListPermissionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListPermissionsError::InvalidArn(ref cause) => write!(f, "{}", cause),
ListPermissionsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
ListPermissionsError::InvalidState(ref cause) => write!(f, "{}", cause),
ListPermissionsError::RequestFailed(ref cause) => write!(f, "{}", cause),
ListPermissionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListPermissionsError {}
/// Errors returned by ListTags
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(ListTagsError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(ListTagsError::InvalidState(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsError::InvalidArn(ref cause) => write!(f, "{}", cause),
ListTagsError::InvalidState(ref cause) => write!(f, "{}", cause),
ListTagsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsError {}
/// Errors returned by PutPolicy
#[derive(Debug, PartialEq)]
pub enum PutPolicyError {
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The resource policy is invalid or is missing a required statement. For general information about IAM policy and statement structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json">Overview of JSON Policies</a>.</p>
InvalidPolicy(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The current action was prevented because it would lock the caller out from performing subsequent actions. Verify that the specified parameters would not result in the caller being denied access to the resource. </p>
LockoutPrevented(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl PutPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(PutPolicyError::ConcurrentModification(err.msg))
}
"InvalidArnException" => {
return RusotoError::Service(PutPolicyError::InvalidArn(err.msg))
}
"InvalidPolicyException" => {
return RusotoError::Service(PutPolicyError::InvalidPolicy(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(PutPolicyError::InvalidState(err.msg))
}
"LockoutPreventedException" => {
return RusotoError::Service(PutPolicyError::LockoutPrevented(err.msg))
}
"RequestFailedException" => {
return RusotoError::Service(PutPolicyError::RequestFailed(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutPolicyError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for PutPolicyError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
PutPolicyError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
PutPolicyError::InvalidArn(ref cause) => write!(f, "{}", cause),
PutPolicyError::InvalidPolicy(ref cause) => write!(f, "{}", cause),
PutPolicyError::InvalidState(ref cause) => write!(f, "{}", cause),
PutPolicyError::LockoutPrevented(ref cause) => write!(f, "{}", cause),
PutPolicyError::RequestFailed(ref cause) => write!(f, "{}", cause),
PutPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for PutPolicyError {}
/// Errors returned by RestoreCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum RestoreCertificateAuthorityError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl RestoreCertificateAuthorityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RestoreCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(RestoreCertificateAuthorityError::InvalidArn(
err.msg,
))
}
"InvalidStateException" => {
return RusotoError::Service(RestoreCertificateAuthorityError::InvalidState(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(
RestoreCertificateAuthorityError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for RestoreCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
RestoreCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
RestoreCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
RestoreCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for RestoreCertificateAuthorityError {}
/// Errors returned by RevokeCertificate
#[derive(Debug, PartialEq)]
pub enum RevokeCertificateError {
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The request action cannot be performed or is prohibited.</p>
InvalidRequest(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>An ACM Private CA quota has been exceeded. See the exception message returned to determine the quota that was exceeded.</p>
LimitExceeded(String),
/// <p>Your request has already been completed.</p>
RequestAlreadyProcessed(String),
/// <p>The request has failed for an unspecified reason.</p>
RequestFailed(String),
/// <p>Your request is already in progress.</p>
RequestInProgress(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl RevokeCertificateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RevokeCertificateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(RevokeCertificateError::ConcurrentModification(
err.msg,
))
}
"InvalidArnException" => {
return RusotoError::Service(RevokeCertificateError::InvalidArn(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(RevokeCertificateError::InvalidRequest(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(RevokeCertificateError::InvalidState(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(RevokeCertificateError::LimitExceeded(err.msg))
}
"RequestAlreadyProcessedException" => {
return RusotoError::Service(RevokeCertificateError::RequestAlreadyProcessed(
err.msg,
))
}
"RequestFailedException" => {
return RusotoError::Service(RevokeCertificateError::RequestFailed(err.msg))
}
"RequestInProgressException" => {
return RusotoError::Service(RevokeCertificateError::RequestInProgress(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(RevokeCertificateError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for RevokeCertificateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
RevokeCertificateError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::InvalidRequest(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::RequestAlreadyProcessed(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::RequestFailed(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
RevokeCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for RevokeCertificateError {}
/// Errors returned by TagCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum TagCertificateAuthorityError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
InvalidTag(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
/// <p>You can associate up to 50 tags with a private CA. Exception information is contained in the exception message field.</p>
TooManyTags(String),
}
impl TagCertificateAuthorityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(TagCertificateAuthorityError::InvalidArn(err.msg))
}
"InvalidStateException" => {
return RusotoError::Service(TagCertificateAuthorityError::InvalidState(
err.msg,
))
}
"InvalidTagException" => {
return RusotoError::Service(TagCertificateAuthorityError::InvalidTag(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagCertificateAuthorityError::ResourceNotFound(
err.msg,
))
}
"TooManyTagsException" => {
return RusotoError::Service(TagCertificateAuthorityError::TooManyTags(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
TagCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
TagCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
TagCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
TagCertificateAuthorityError::TooManyTags(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagCertificateAuthorityError {}
/// Errors returned by UntagCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum UntagCertificateAuthorityError {
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
InvalidTag(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl UntagCertificateAuthorityError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidArnException" => {
return RusotoError::Service(UntagCertificateAuthorityError::InvalidArn(
err.msg,
))
}
"InvalidStateException" => {
return RusotoError::Service(UntagCertificateAuthorityError::InvalidState(
err.msg,
))
}
"InvalidTagException" => {
return RusotoError::Service(UntagCertificateAuthorityError::InvalidTag(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UntagCertificateAuthorityError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
UntagCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
UntagCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
UntagCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagCertificateAuthorityError {}
/// Errors returned by UpdateCertificateAuthority
#[derive(Debug, PartialEq)]
pub enum UpdateCertificateAuthorityError {
/// <p>A previous update to your private CA is still ongoing.</p>
ConcurrentModification(String),
/// <p>One or more of the specified arguments was not valid.</p>
InvalidArgs(String),
/// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
InvalidArn(String),
/// <p>The resource policy is invalid or is missing a required statement. For general information about IAM policy and statement structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json">Overview of JSON Policies</a>.</p>
InvalidPolicy(String),
/// <p>The state of the private CA does not allow this action to occur.</p>
InvalidState(String),
/// <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
ResourceNotFound(String),
}
impl UpdateCertificateAuthorityError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateCertificateAuthorityError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
UpdateCertificateAuthorityError::ConcurrentModification(err.msg),
)
}
"InvalidArgsException" => {
return RusotoError::Service(UpdateCertificateAuthorityError::InvalidArgs(
err.msg,
))
}
"InvalidArnException" => {
return RusotoError::Service(UpdateCertificateAuthorityError::InvalidArn(
err.msg,
))
}
"InvalidPolicyException" => {
return RusotoError::Service(UpdateCertificateAuthorityError::InvalidPolicy(
err.msg,
))
}
"InvalidStateException" => {
return RusotoError::Service(UpdateCertificateAuthorityError::InvalidState(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateCertificateAuthorityError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateCertificateAuthorityError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateCertificateAuthorityError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
UpdateCertificateAuthorityError::InvalidArgs(ref cause) => write!(f, "{}", cause),
UpdateCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
UpdateCertificateAuthorityError::InvalidPolicy(ref cause) => write!(f, "{}", cause),
UpdateCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
UpdateCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateCertificateAuthorityError {}
/// Trait representing the capabilities of the ACM-PCA API. ACM-PCA clients implement this trait.
#[async_trait]
pub trait AcmPca {
/// <p><p>Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, the certificate revocation list (CRL) configuration, the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.</p> <p>ACM Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCreateCa.html#crl-encryption">Encrypting Your CRLs</a>.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note></p>
async fn create_certificate_authority(
&self,
input: CreateCertificateAuthorityRequest,
) -> Result<CreateCertificateAuthorityResponse, RusotoError<CreateCertificateAuthorityError>>;
/// <p>Creates an audit report that lists every time that your CA private key is used. The report is saved in the Amazon S3 bucket that you specify on input. The <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> and <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html">RevokeCertificate</a> actions use the private key. </p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note> <p>ACM Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuditReport.html#audit-report-encryption">Encrypting Your Audit Reports</a>.</p>
async fn create_certificate_authority_audit_report(
&self,
input: CreateCertificateAuthorityAuditReportRequest,
) -> Result<
CreateCertificateAuthorityAuditReportResponse,
RusotoError<CreateCertificateAuthorityAuditReportError>,
>;
/// <p><p>Grants one or more permissions on a private CA to the AWS Certificate Manager (ACM) service principal (<code>acm.amazonaws.com</code>). These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA.</p> <p>You can list current permissions with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html">ListPermissions</a> action and revoke them with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html">DeletePermission</a> action.</p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn create_permission(
&self,
input: CreatePermissionRequest,
) -> Result<(), RusotoError<CreatePermissionError>>;
/// <p>Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. </p> <note> <p>Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy.</p> </note> <p>Before you can delete a CA that you have created and activated, you must disable it. To do this, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action and set the <b>CertificateAuthorityStatus</b> parameter to <code>DISABLED</code>. </p> <p>Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is <code>CREATING</code>). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into ACM Private CA (that is, the status of the CA is <code>PENDING_CERTIFICATE</code>). </p> <p>When you successfully call <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthority.html">DeleteCertificateAuthority</a>, the CA's status changes to <code>DELETED</code>. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the <code>PermanentDeletionTimeInDays</code> parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthority.html">DescribeCertificateAuthority</a> action returns the time remaining in the restoration window of a private CA in the <code>DELETED</code> state. To restore an eligible CA, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RestoreCertificateAuthority.html">RestoreCertificateAuthority</a> action.</p>
async fn delete_certificate_authority(
&self,
input: DeleteCertificateAuthorityRequest,
) -> Result<(), RusotoError<DeleteCertificateAuthorityError>>;
/// <p><p>Revokes permissions on a private CA granted to the AWS Certificate Manager (ACM) service principal (acm.amazonaws.com). </p> <p>These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA. If you revoke these permissions, ACM will no longer renew the affected certificates automatically.</p> <p>Permissions can be granted with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html">CreatePermission</a> action and listed with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html">ListPermissions</a> action. </p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn delete_permission(
&self,
input: DeletePermissionRequest,
) -> Result<(), RusotoError<DeletePermissionError>>;
/// <p><p>Deletes the resource-based policy attached to a private CA. Deletion will remove any access that the policy has granted. If there is no policy attached to the private CA, this action will return successful.</p> <p>If you delete a policy that was applied through AWS Resource Access Manager (RAM), the CA will be removed from all shares in which it was included. </p> <p>The AWS Certificate Manager Service Linked Role that the policy supports is not affected when you delete the policy. </p> <p>The current policy can be shown with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetPolicy.html">GetPolicy</a> and updated with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_PutPolicy.html">PutPolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn delete_policy(
&self,
input: DeletePolicyRequest,
) -> Result<(), RusotoError<DeletePolicyError>>;
/// <p><p>Lists information about your private certificate authority (CA) or one that has been shared with you. You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: </p> <ul> <li> <p> <code>CREATING</code> - ACM Private CA is creating your private certificate authority.</p> </li> <li> <p> <code>PENDING_CERTIFICATE</code> - The certificate is pending. You must use your ACM Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into PCA. </p> </li> <li> <p> <code>ACTIVE</code> - Your private CA is active.</p> </li> <li> <p> <code>DISABLED</code> - Your private CA has been disabled.</p> </li> <li> <p> <code>EXPIRED</code> - Your private CA certificate has expired.</p> </li> <li> <p> <code>FAILED</code> - Your private CA has failed. Your CA can fail because of problems such a network outage or back-end AWS failure or other errors. A failed CA can never return to the pending state. You must create a new CA. </p> </li> <li> <p> <code>DELETED</code> - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA's restoration period is also included in this action's output.</p> </li> </ul></p>
async fn describe_certificate_authority(
&self,
input: DescribeCertificateAuthorityRequest,
) -> Result<DescribeCertificateAuthorityResponse, RusotoError<DescribeCertificateAuthorityError>>;
/// <p>Lists information about a specific audit report created by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> action or the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html">RevokeCertificate</a> action. </p>
async fn describe_certificate_authority_audit_report(
&self,
input: DescribeCertificateAuthorityAuditReportRequest,
) -> Result<
DescribeCertificateAuthorityAuditReportResponse,
RusotoError<DescribeCertificateAuthorityAuditReportError>,
>;
/// <p>Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the <b>GetCertificate</b> action. You can retrieve the certificate if it is in the <b>ISSUED</b> state. You can call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action to create a report that contains information about all of the certificates issued and revoked by your private CA. </p>
async fn get_certificate(
&self,
input: GetCertificateRequest,
) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>>;
/// <p>Retrieves the certificate and certificate chain for your private certificate authority (CA) or one that has been shared with you. Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it. </p>
async fn get_certificate_authority_certificate(
&self,
input: GetCertificateAuthorityCertificateRequest,
) -> Result<
GetCertificateAuthorityCertificateResponse,
RusotoError<GetCertificateAuthorityCertificateError>,
>;
/// <p>Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into ACM Private CA by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a base64 PEM-encoded string. </p>
async fn get_certificate_authority_csr(
&self,
input: GetCertificateAuthorityCsrRequest,
) -> Result<GetCertificateAuthorityCsrResponse, RusotoError<GetCertificateAuthorityCsrError>>;
/// <p><p>Retrieves the resource-based policy attached to a private CA. If either the private CA resource or the policy cannot be found, this action returns a <code>ResourceNotFoundException</code>. </p> <p>The policy can be attached or updated with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_PutPolicy.html">PutPolicy</a> and removed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePolicy.html">DeletePolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn get_policy(
&self,
input: GetPolicyRequest,
) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>>;
/// <p><p>Imports a signed private CA certificate into ACM Private CA. This action is used when you are using a chain of trust whose root is located outside ACM Private CA. Before you can call this action, the following preparations must in place:</p> <ol> <li> <p>In ACM Private CA, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action to create the private CA that you plan to back with the imported certificate.</p> </li> <li> <p>Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCsr.html">GetCertificateAuthorityCsr</a> action to generate a certificate signing request (CSR).</p> </li> <li> <p>Sign the CSR using a root or intermediate CA hosted by either an on-premises PKI hierarchy or by a commercial CA.</p> </li> <li> <p>Create a certificate chain and copy the signed certificate and the certificate chain to your working directory.</p> </li> </ol> <p>ACM Private CA supports three scenarios for installing a CA certificate:</p> <ul> <li> <p>Installing a certificate for a root CA hosted by ACM Private CA.</p> </li> <li> <p>Installing a subordinate CA certificate whose parent authority is hosted by ACM Private CA.</p> </li> <li> <p>Installing a subordinate CA certificate whose parent authority is externally hosted.</p> </li> </ul> <p>The following additional requirements apply when you import a CA certificate.</p> <ul> <li> <p>Only a self-signed certificate can be imported as a root CA.</p> </li> <li> <p>A self-signed certificate cannot be imported as a subordinate CA.</p> </li> <li> <p>Your certificate chain must not include the private CA certificate that you are importing.</p> </li> <li> <p>Your root CA must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. </p> </li> <li> <p>The chain must be PEM-encoded.</p> </li> <li> <p>The maximum allowed size of a certificate is 32 KB.</p> </li> <li> <p>The maximum allowed size of a certificate chain is 2 MB.</p> </li> </ul> <p> <i>Enforcement of Critical Constraints</i> </p> <p>ACM Private CA allows the following extensions to be marked critical in the imported CA certificate or chain.</p> <ul> <li> <p>Basic constraints (<i>must</i> be marked critical)</p> </li> <li> <p>Subject alternative names</p> </li> <li> <p>Key usage</p> </li> <li> <p>Extended key usage</p> </li> <li> <p>Authority key identifier</p> </li> <li> <p>Subject key identifier</p> </li> <li> <p>Issuer alternative name</p> </li> <li> <p>Subject directory attributes</p> </li> <li> <p>Subject information access</p> </li> <li> <p>Certificate policies</p> </li> <li> <p>Policy mappings</p> </li> <li> <p>Inhibit anyPolicy</p> </li> </ul> <p>ACM Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain.</p> <ul> <li> <p>Name constraints</p> </li> <li> <p>Policy constraints</p> </li> <li> <p>CRL distribution points</p> </li> <li> <p>Authority information access</p> </li> <li> <p>Freshest CRL</p> </li> <li> <p>Any other extension</p> </li> </ul></p>
async fn import_certificate_authority_certificate(
&self,
input: ImportCertificateAuthorityCertificateRequest,
) -> Result<(), RusotoError<ImportCertificateAuthorityCertificateError>>;
/// <p><p>Uses your private certificate authority (CA), or one that has been shared with you, to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html">GetCertificate</a> action and specifying the ARN. </p> <note> <p>You cannot use the ACM <b>ListCertificateAuthorities</b> action to retrieve the ARNs of the certificates that you issue by using ACM Private CA.</p> </note></p>
async fn issue_certificate(
&self,
input: IssueCertificateRequest,
) -> Result<IssueCertificateResponse, RusotoError<IssueCertificateError>>;
/// <p>Lists the private certificate authorities that you created by using the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action.</p>
async fn list_certificate_authorities(
&self,
input: ListCertificateAuthoritiesRequest,
) -> Result<ListCertificateAuthoritiesResponse, RusotoError<ListCertificateAuthoritiesError>>;
/// <p><p>List all permissions on a private CA, if any, granted to the AWS Certificate Manager (ACM) service principal (acm.amazonaws.com). </p> <p>These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA. </p> <p>Permissions can be granted with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html">CreatePermission</a> action and revoked with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html">DeletePermission</a> action.</p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn list_permissions(
&self,
input: ListPermissionsRequest,
) -> Result<ListPermissionsResponse, RusotoError<ListPermissionsError>>;
/// <p>Lists the tags, if any, that are associated with your private CA or one that has been shared with you. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html">TagCertificateAuthority</a> action to add one or more tags to your CA. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html">UntagCertificateAuthority</a> action to remove tags. </p>
async fn list_tags(
&self,
input: ListTagsRequest,
) -> Result<ListTagsResponse, RusotoError<ListTagsError>>;
/// <p><p>Attaches a resource-based policy to a private CA. </p> <p>A policy can also be applied by sharing a private CA through AWS Resource Access Manager (RAM). For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> <p>The policy can be displayed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetPolicy.html">GetPolicy</a> and removed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePolicy.html">DeletePolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn put_policy(&self, input: PutPolicyRequest) -> Result<(), RusotoError<PutPolicyError>>;
/// <p>Restores a certificate authority (CA) that is in the <code>DELETED</code> state. You can restore a CA during the period that you defined in the <b>PermanentDeletionTimeInDays</b> parameter of the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthority.html">DeleteCertificateAuthority</a> action. Currently, you can specify 7 to 30 days. If you did not specify a <b>PermanentDeletionTimeInDays</b> value, by default you can restore the CA at any time in a 30 day period. You can check the time remaining in the restoration period of a private CA in the <code>DELETED</code> state by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthority.html">DescribeCertificateAuthority</a> or <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> actions. The status of a restored CA is set to its pre-deletion status when the <b>RestoreCertificateAuthority</b> action returns. To change its status to <code>ACTIVE</code>, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action. If the private CA was in the <code>PENDING_CERTIFICATE</code> state at deletion, you must use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action to import a certificate authority into the private CA before it can be activated. You cannot restore a CA after the restoration period has ended.</p>
async fn restore_certificate_authority(
&self,
input: RestoreCertificateAuthorityRequest,
) -> Result<(), RusotoError<RestoreCertificateAuthorityError>>;
/// <p><p>Revokes a certificate that was issued inside ACM Private CA. If you enable a certificate revocation list (CRL) when you create or update your private CA, information about the revoked certificates will be included in the CRL. ACM Private CA writes the CRL to an S3 bucket that you specify. A CRL is typically updated approximately 30 minutes after a certificate is revoked. If for any reason the CRL update fails, ACM Private CA attempts makes further attempts every 15 minutes. With Amazon CloudWatch, you can create alarms for the metrics <code>CRLGenerated</code> and <code>MisconfiguredCRLBucket</code>. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCloudWatch.html">Supported CloudWatch Metrics</a>.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note> <p>ACM Private CA also writes revocation information to the audit report. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a>.</p> <note> <p>You cannot revoke a root CA self-signed certificate.</p> </note></p>
async fn revoke_certificate(
&self,
input: RevokeCertificateRequest,
) -> Result<(), RusotoError<RevokeCertificateError>>;
/// <p>Adds one or more tags to your private CA. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. You specify the private CA on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. You can apply a tag to just one private CA if you want to identify a specific characteristic of that CA, or you can apply the same tag to multiple private CAs if you want to filter for a common relationship among those CAs. To remove one or more tags, use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html">UntagCertificateAuthority</a> action. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListTags.html">ListTags</a> action to see what tags are associated with your CA. </p>
async fn tag_certificate_authority(
&self,
input: TagCertificateAuthorityRequest,
) -> Result<(), RusotoError<TagCertificateAuthorityError>>;
/// <p>Remove one or more tags from your private CA. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this action, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. To add tags to a private CA, use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html">TagCertificateAuthority</a>. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListTags.html">ListTags</a> action to see what tags are associated with your CA. </p>
async fn untag_certificate_authority(
&self,
input: UntagCertificateAuthorityRequest,
) -> Result<(), RusotoError<UntagCertificateAuthorityError>>;
/// <p><p>Updates the status or configuration of a private certificate authority (CA). Your private CA must be in the <code>ACTIVE</code> or <code>DISABLED</code> state before you can update it. You can disable a private CA that is in the <code>ACTIVE</code> state or make a CA that is in the <code>DISABLED</code> state active again.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note></p>
async fn update_certificate_authority(
&self,
input: UpdateCertificateAuthorityRequest,
) -> Result<(), RusotoError<UpdateCertificateAuthorityError>>;
}
/// A client for the ACM-PCA API.
#[derive(Clone)]
pub struct AcmPcaClient {
client: Client,
region: region::Region,
}
impl AcmPcaClient {
/// Creates a client backed by the default tokio event loop.
///
/// The client will use the default credentials provider and tls client.
pub fn new(region: region::Region) -> AcmPcaClient {
AcmPcaClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AcmPcaClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
AcmPcaClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> AcmPcaClient {
AcmPcaClient { client, region }
}
}
#[async_trait]
impl AcmPca for AcmPcaClient {
/// <p><p>Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, the certificate revocation list (CRL) configuration, the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.</p> <p>ACM Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCreateCa.html#crl-encryption">Encrypting Your CRLs</a>.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note></p>
async fn create_certificate_authority(
&self,
input: CreateCertificateAuthorityRequest,
) -> Result<CreateCertificateAuthorityResponse, RusotoError<CreateCertificateAuthorityError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.CreateCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateCertificateAuthorityError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateCertificateAuthorityResponse, _>()
}
/// <p>Creates an audit report that lists every time that your CA private key is used. The report is saved in the Amazon S3 bucket that you specify on input. The <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> and <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html">RevokeCertificate</a> actions use the private key. </p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note> <p>ACM Private CA assets that are stored in Amazon S3 can be protected with encryption. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuditReport.html#audit-report-encryption">Encrypting Your Audit Reports</a>.</p>
async fn create_certificate_authority_audit_report(
&self,
input: CreateCertificateAuthorityAuditReportRequest,
) -> Result<
CreateCertificateAuthorityAuditReportResponse,
RusotoError<CreateCertificateAuthorityAuditReportError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"ACMPrivateCA.CreateCertificateAuthorityAuditReport",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
CreateCertificateAuthorityAuditReportError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateCertificateAuthorityAuditReportResponse, _>()
}
/// <p><p>Grants one or more permissions on a private CA to the AWS Certificate Manager (ACM) service principal (<code>acm.amazonaws.com</code>). These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA.</p> <p>You can list current permissions with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html">ListPermissions</a> action and revoke them with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html">DeletePermission</a> action.</p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn create_permission(
&self,
input: CreatePermissionRequest,
) -> Result<(), RusotoError<CreatePermissionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.CreatePermission");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreatePermissionError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p>Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> action. </p> <note> <p>Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy.</p> </note> <p>Before you can delete a CA that you have created and activated, you must disable it. To do this, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action and set the <b>CertificateAuthorityStatus</b> parameter to <code>DISABLED</code>. </p> <p>Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is <code>CREATING</code>). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into ACM Private CA (that is, the status of the CA is <code>PENDING_CERTIFICATE</code>). </p> <p>When you successfully call <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthority.html">DeleteCertificateAuthority</a>, the CA's status changes to <code>DELETED</code>. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the <code>PermanentDeletionTimeInDays</code> parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthority.html">DescribeCertificateAuthority</a> action returns the time remaining in the restoration window of a private CA in the <code>DELETED</code> state. To restore an eligible CA, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RestoreCertificateAuthority.html">RestoreCertificateAuthority</a> action.</p>
async fn delete_certificate_authority(
&self,
input: DeleteCertificateAuthorityRequest,
) -> Result<(), RusotoError<DeleteCertificateAuthorityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.DeleteCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteCertificateAuthorityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Revokes permissions on a private CA granted to the AWS Certificate Manager (ACM) service principal (acm.amazonaws.com). </p> <p>These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA. If you revoke these permissions, ACM will no longer renew the affected certificates automatically.</p> <p>Permissions can be granted with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html">CreatePermission</a> action and listed with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListPermissions.html">ListPermissions</a> action. </p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn delete_permission(
&self,
input: DeletePermissionRequest,
) -> Result<(), RusotoError<DeletePermissionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.DeletePermission");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeletePermissionError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Deletes the resource-based policy attached to a private CA. Deletion will remove any access that the policy has granted. If there is no policy attached to the private CA, this action will return successful.</p> <p>If you delete a policy that was applied through AWS Resource Access Manager (RAM), the CA will be removed from all shares in which it was included. </p> <p>The AWS Certificate Manager Service Linked Role that the policy supports is not affected when you delete the policy. </p> <p>The current policy can be shown with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetPolicy.html">GetPolicy</a> and updated with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_PutPolicy.html">PutPolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn delete_policy(
&self,
input: DeletePolicyRequest,
) -> Result<(), RusotoError<DeletePolicyError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.DeletePolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeletePolicyError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Lists information about your private certificate authority (CA) or one that has been shared with you. You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: </p> <ul> <li> <p> <code>CREATING</code> - ACM Private CA is creating your private certificate authority.</p> </li> <li> <p> <code>PENDING_CERTIFICATE</code> - The certificate is pending. You must use your ACM Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into PCA. </p> </li> <li> <p> <code>ACTIVE</code> - Your private CA is active.</p> </li> <li> <p> <code>DISABLED</code> - Your private CA has been disabled.</p> </li> <li> <p> <code>EXPIRED</code> - Your private CA certificate has expired.</p> </li> <li> <p> <code>FAILED</code> - Your private CA has failed. Your CA can fail because of problems such a network outage or back-end AWS failure or other errors. A failed CA can never return to the pending state. You must create a new CA. </p> </li> <li> <p> <code>DELETED</code> - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA's restoration period is also included in this action's output.</p> </li> </ul></p>
async fn describe_certificate_authority(
&self,
input: DescribeCertificateAuthorityRequest,
) -> Result<DescribeCertificateAuthorityResponse, RusotoError<DescribeCertificateAuthorityError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.DescribeCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeCertificateAuthorityError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeCertificateAuthorityResponse, _>()
}
/// <p>Lists information about a specific audit report created by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> action or the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_RevokeCertificate.html">RevokeCertificate</a> action. </p>
async fn describe_certificate_authority_audit_report(
&self,
input: DescribeCertificateAuthorityAuditReportRequest,
) -> Result<
DescribeCertificateAuthorityAuditReportResponse,
RusotoError<DescribeCertificateAuthorityAuditReportError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"ACMPrivateCA.DescribeCertificateAuthorityAuditReport",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
DescribeCertificateAuthorityAuditReportError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeCertificateAuthorityAuditReportResponse, _>()
}
/// <p>Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the <b>GetCertificate</b> action. You can retrieve the certificate if it is in the <b>ISSUED</b> state. You can call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action to create a report that contains information about all of the certificates issued and revoked by your private CA. </p>
async fn get_certificate(
&self,
input: GetCertificateRequest,
) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.GetCertificate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCertificateError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetCertificateResponse, _>()
}
/// <p>Retrieves the certificate and certificate chain for your private certificate authority (CA) or one that has been shared with you. Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it. </p>
async fn get_certificate_authority_certificate(
&self,
input: GetCertificateAuthorityCertificateRequest,
) -> Result<
GetCertificateAuthorityCertificateResponse,
RusotoError<GetCertificateAuthorityCertificateError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"ACMPrivateCA.GetCertificateAuthorityCertificate",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
GetCertificateAuthorityCertificateError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetCertificateAuthorityCertificateResponse, _>()
}
/// <p>Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action. Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into ACM Private CA by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a base64 PEM-encoded string. </p>
async fn get_certificate_authority_csr(
&self,
input: GetCertificateAuthorityCsrRequest,
) -> Result<GetCertificateAuthorityCsrResponse, RusotoError<GetCertificateAuthorityCsrError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.GetCertificateAuthorityCsr");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetCertificateAuthorityCsrError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetCertificateAuthorityCsrResponse, _>()
}
/// <p><p>Retrieves the resource-based policy attached to a private CA. If either the private CA resource or the policy cannot be found, this action returns a <code>ResourceNotFoundException</code>. </p> <p>The policy can be attached or updated with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_PutPolicy.html">PutPolicy</a> and removed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePolicy.html">DeletePolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn get_policy(
&self,
input: GetPolicyRequest,
) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.GetPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, GetPolicyError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<GetPolicyResponse, _>()
}
/// <p><p>Imports a signed private CA certificate into ACM Private CA. This action is used when you are using a chain of trust whose root is located outside ACM Private CA. Before you can call this action, the following preparations must in place:</p> <ol> <li> <p>In ACM Private CA, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action to create the private CA that you plan to back with the imported certificate.</p> </li> <li> <p>Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCsr.html">GetCertificateAuthorityCsr</a> action to generate a certificate signing request (CSR).</p> </li> <li> <p>Sign the CSR using a root or intermediate CA hosted by either an on-premises PKI hierarchy or by a commercial CA.</p> </li> <li> <p>Create a certificate chain and copy the signed certificate and the certificate chain to your working directory.</p> </li> </ol> <p>ACM Private CA supports three scenarios for installing a CA certificate:</p> <ul> <li> <p>Installing a certificate for a root CA hosted by ACM Private CA.</p> </li> <li> <p>Installing a subordinate CA certificate whose parent authority is hosted by ACM Private CA.</p> </li> <li> <p>Installing a subordinate CA certificate whose parent authority is externally hosted.</p> </li> </ul> <p>The following additional requirements apply when you import a CA certificate.</p> <ul> <li> <p>Only a self-signed certificate can be imported as a root CA.</p> </li> <li> <p>A self-signed certificate cannot be imported as a subordinate CA.</p> </li> <li> <p>Your certificate chain must not include the private CA certificate that you are importing.</p> </li> <li> <p>Your root CA must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. </p> </li> <li> <p>The chain must be PEM-encoded.</p> </li> <li> <p>The maximum allowed size of a certificate is 32 KB.</p> </li> <li> <p>The maximum allowed size of a certificate chain is 2 MB.</p> </li> </ul> <p> <i>Enforcement of Critical Constraints</i> </p> <p>ACM Private CA allows the following extensions to be marked critical in the imported CA certificate or chain.</p> <ul> <li> <p>Basic constraints (<i>must</i> be marked critical)</p> </li> <li> <p>Subject alternative names</p> </li> <li> <p>Key usage</p> </li> <li> <p>Extended key usage</p> </li> <li> <p>Authority key identifier</p> </li> <li> <p>Subject key identifier</p> </li> <li> <p>Issuer alternative name</p> </li> <li> <p>Subject directory attributes</p> </li> <li> <p>Subject information access</p> </li> <li> <p>Certificate policies</p> </li> <li> <p>Policy mappings</p> </li> <li> <p>Inhibit anyPolicy</p> </li> </ul> <p>ACM Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain.</p> <ul> <li> <p>Name constraints</p> </li> <li> <p>Policy constraints</p> </li> <li> <p>CRL distribution points</p> </li> <li> <p>Authority information access</p> </li> <li> <p>Freshest CRL</p> </li> <li> <p>Any other extension</p> </li> </ul></p>
async fn import_certificate_authority_certificate(
&self,
input: ImportCertificateAuthorityCertificateRequest,
) -> Result<(), RusotoError<ImportCertificateAuthorityCertificateError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"ACMPrivateCA.ImportCertificateAuthorityCertificate",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
ImportCertificateAuthorityCertificateError::from_response,
)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Uses your private certificate authority (CA), or one that has been shared with you, to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificate.html">GetCertificate</a> action and specifying the ARN. </p> <note> <p>You cannot use the ACM <b>ListCertificateAuthorities</b> action to retrieve the ARNs of the certificates that you issue by using ACM Private CA.</p> </note></p>
async fn issue_certificate(
&self,
input: IssueCertificateRequest,
) -> Result<IssueCertificateResponse, RusotoError<IssueCertificateError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.IssueCertificate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, IssueCertificateError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<IssueCertificateResponse, _>()
}
/// <p>Lists the private certificate authorities that you created by using the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action.</p>
async fn list_certificate_authorities(
&self,
input: ListCertificateAuthoritiesRequest,
) -> Result<ListCertificateAuthoritiesResponse, RusotoError<ListCertificateAuthoritiesError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.ListCertificateAuthorities");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListCertificateAuthoritiesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<ListCertificateAuthoritiesResponse, _>()
}
/// <p><p>List all permissions on a private CA, if any, granted to the AWS Certificate Manager (ACM) service principal (acm.amazonaws.com). </p> <p>These permissions allow ACM to issue and renew ACM certificates that reside in the same AWS account as the CA. </p> <p>Permissions can be granted with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreatePermission.html">CreatePermission</a> action and revoked with the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePermission.html">DeletePermission</a> action.</p> <p class="title"> <b>About Permissions</b> </p> <ul> <li> <p>If the private CA and the certificates it issues reside in the same account, you can use <code>CreatePermission</code> to grant permissions for ACM to carry out automatic certificate renewals.</p> </li> <li> <p>For automatic certificate renewal to succeed, the ACM service principal needs permissions to create, retrieve, and list certificates.</p> </li> <li> <p>If the private CA and the ACM certificates reside in different accounts, then permissions cannot be used to enable automatic renewals. Instead, the ACM certificate owner must set up a resource-based policy to enable cross-account issuance and renewals. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> </ul></p>
async fn list_permissions(
&self,
input: ListPermissionsRequest,
) -> Result<ListPermissionsResponse, RusotoError<ListPermissionsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.ListPermissions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListPermissionsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListPermissionsResponse, _>()
}
/// <p>Lists the tags, if any, that are associated with your private CA or one that has been shared with you. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html">TagCertificateAuthority</a> action to add one or more tags to your CA. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html">UntagCertificateAuthority</a> action to remove tags. </p>
async fn list_tags(
&self,
input: ListTagsRequest,
) -> Result<ListTagsResponse, RusotoError<ListTagsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.ListTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTagsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTagsResponse, _>()
}
/// <p><p>Attaches a resource-based policy to a private CA. </p> <p>A policy can also be applied by sharing a private CA through AWS Resource Access Manager (RAM). For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> <p>The policy can be displayed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetPolicy.html">GetPolicy</a> and removed with <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeletePolicy.html">DeletePolicy</a>.</p> <p class="title"> <b>About Policies</b> </p> <ul> <li> <p>A policy grants access on a private CA to an AWS customer account, to AWS Organizations, or to an AWS Organizations unit. Policies are under the control of a CA administrator. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-rbp.html">Using a Resource Based Policy with ACM Private CA</a>.</p> </li> <li> <p>A policy permits a user of AWS Certificate Manager (ACM) to issue ACM certificates signed by a CA in another account.</p> </li> <li> <p>For ACM to manage automatic renewal of these certificates, the ACM user must configure a Service Linked Role (SLR). The SLR allows the ACM service to assume the identity of the user, subject to confirmation against the ACM Private CA policy. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-slr.html">Using a Service Linked Role with ACM</a>.</p> </li> <li> <p>Updates made in AWS Resource Manager (RAM) are reflected in policies. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/pca-ram.html">Attach a Policy for Cross-Account Access</a>.</p> </li> </ul></p>
async fn put_policy(&self, input: PutPolicyRequest) -> Result<(), RusotoError<PutPolicyError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.PutPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, PutPolicyError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p>Restores a certificate authority (CA) that is in the <code>DELETED</code> state. You can restore a CA during the period that you defined in the <b>PermanentDeletionTimeInDays</b> parameter of the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DeleteCertificateAuthority.html">DeleteCertificateAuthority</a> action. Currently, you can specify 7 to 30 days. If you did not specify a <b>PermanentDeletionTimeInDays</b> value, by default you can restore the CA at any time in a 30 day period. You can check the time remaining in the restoration period of a private CA in the <code>DELETED</code> state by calling the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_DescribeCertificateAuthority.html">DescribeCertificateAuthority</a> or <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListCertificateAuthorities.html">ListCertificateAuthorities</a> actions. The status of a restored CA is set to its pre-deletion status when the <b>RestoreCertificateAuthority</b> action returns. To change its status to <code>ACTIVE</code>, call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UpdateCertificateAuthority.html">UpdateCertificateAuthority</a> action. If the private CA was in the <code>PENDING_CERTIFICATE</code> state at deletion, you must use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ImportCertificateAuthorityCertificate.html">ImportCertificateAuthorityCertificate</a> action to import a certificate authority into the private CA before it can be activated. You cannot restore a CA after the restoration period has ended.</p>
async fn restore_certificate_authority(
&self,
input: RestoreCertificateAuthorityRequest,
) -> Result<(), RusotoError<RestoreCertificateAuthorityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.RestoreCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, RestoreCertificateAuthorityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Revokes a certificate that was issued inside ACM Private CA. If you enable a certificate revocation list (CRL) when you create or update your private CA, information about the revoked certificates will be included in the CRL. ACM Private CA writes the CRL to an S3 bucket that you specify. A CRL is typically updated approximately 30 minutes after a certificate is revoked. If for any reason the CRL update fails, ACM Private CA attempts makes further attempts every 15 minutes. With Amazon CloudWatch, you can create alarms for the metrics <code>CRLGenerated</code> and <code>MisconfiguredCRLBucket</code>. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaCloudWatch.html">Supported CloudWatch Metrics</a>.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note> <p>ACM Private CA also writes revocation information to the audit report. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a>.</p> <note> <p>You cannot revoke a root CA self-signed certificate.</p> </note></p>
async fn revoke_certificate(
&self,
input: RevokeCertificateRequest,
) -> Result<(), RusotoError<RevokeCertificateError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.RevokeCertificate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, RevokeCertificateError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p>Adds one or more tags to your private CA. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. You specify the private CA on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. You can apply a tag to just one private CA if you want to identify a specific characteristic of that CA, or you can apply the same tag to multiple private CAs if you want to filter for a common relationship among those CAs. To remove one or more tags, use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_UntagCertificateAuthority.html">UntagCertificateAuthority</a> action. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListTags.html">ListTags</a> action to see what tags are associated with your CA. </p>
async fn tag_certificate_authority(
&self,
input: TagCertificateAuthorityRequest,
) -> Result<(), RusotoError<TagCertificateAuthorityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.TagCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, TagCertificateAuthorityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p>Remove one or more tags from your private CA. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this action, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. To add tags to a private CA, use the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_TagCertificateAuthority.html">TagCertificateAuthority</a>. Call the <a href="https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_ListTags.html">ListTags</a> action to see what tags are associated with your CA. </p>
async fn untag_certificate_authority(
&self,
input: UntagCertificateAuthorityRequest,
) -> Result<(), RusotoError<UntagCertificateAuthorityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.UntagCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UntagCertificateAuthorityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
/// <p><p>Updates the status or configuration of a private certificate authority (CA). Your private CA must be in the <code>ACTIVE</code> or <code>DISABLED</code> state before you can update it. You can disable a private CA that is in the <code>ACTIVE</code> state or make a CA that is in the <code>DISABLED</code> state active again.</p> <note> <p>Both PCA and the IAM principal must have permission to write to the S3 bucket that you specify. If the IAM principal making the call does not have permission to write to the bucket, then an exception is thrown. For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaAuthAccess.html">Configure Access to ACM Private CA</a>.</p> </note></p>
async fn update_certificate_authority(
&self,
input: UpdateCertificateAuthorityRequest,
) -> Result<(), RusotoError<UpdateCertificateAuthorityError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "ACMPrivateCA.UpdateCertificateAuthority");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateCertificateAuthorityError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
}