summaryrefslogtreecommitdiff
path: root/manual/html_node/X509-certificate-API.html
blob: c000b05e75de1d3abf76fc662c9bcd1e3ac78832 (plain)
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
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is last updated 4 March 2015 for version
3.4.9 of GnuTLS.

Copyright (C) 2001-2015 Free Software Foundation, Inc.\\
Copyright (C) 2001-2015 Nikos Mavrogiannopoulos

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.  A
copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GnuTLS 3.4.9: X509 certificate API</title>

<meta name="description" content="GnuTLS 3.4.9: X509 certificate API">
<meta name="keywords" content="GnuTLS 3.4.9: X509 certificate API">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Function-and-Data-Index.html#Function-and-Data-Index" rel="index" title="Function and Data Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="API-reference.html#API-reference" rel="up" title="API reference">
<link href="PKCS-7-API.html#PKCS-7-API" rel="next" title="PKCS 7 API">
<link href="Datagram-TLS-API.html#Datagram-TLS-API" rel="prev" title="Datagram TLS API">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space: nowrap}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: serif; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
body { 
	margin: 2%;
	padding: 0 5%;
	background: #ffffff;
}
h1,h2,h3,h4,h5 {
    font-weight: bold;
    padding: 5px 5px 5px 5px;
    background-color: #c2e0ff;
    color: #336699;
}
h1 {
    padding: 2em 2em 2em 5%;
    color: white;
    background: #336699;
    text-align: center;
    letter-spacing: 3px;
}
h2 { text-decoration: underline; }
pre {
  margin: 0 5%;
  padding: 0.5em;
}
pre.example,pre.verbatim {
  padding-bottom: 1em;

  border: solid #c2e0ff;
  background: #f0faff;
  border-width: 1px 1px 1px 5px;
  margin: 1em auto;
  width: 90%;
}

div.node {
  margin: 0 -5% 0 -2%;
  padding: 0.5em 0.5em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  font-weight: bold;
}
dd, li {
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}
div.float {

  margin-bottom: 0.5em;
  text-align: center;
}

table {
  text-align: left;
  margin-left:auto;
  margin-right:auto;
  border-spacing: 7px;
  width: 50%;
}

th {
  padding: 0;
  color: #336699;
  background-color: #c2e0ff;
  border: solid #000000;
  border-width: 0px;
  margin: 1em auto;
  text-align: center;
  margin-left:auto;
  margin-right:auto;
}

td {
  padding: 0;
  border: solid #000000;
  background-color: #f0faff;
  border-width: 0px;
  margin: 1em auto;
  text-align: left;
  margin-left:auto;
  margin-right:auto;
  padding-left: 1em;
}

dl {
  text-align: left;
  margin-left:auto;
  margin-right:auto;
  width: 50%;

  padding-left: 1em;
  border: solid #c2e0ff;
  background: #f0faff;
  border-width: 5px 1px 1px 1px;
  margin: 1em auto;
}

-->
</style>


</head>

<body lang="en">
<a name="X509-certificate-API"></a>
<div class="header">
<p>
Next: <a href="PKCS-7-API.html#PKCS-7-API" accesskey="n" rel="next">PKCS 7 API</a>, Previous: <a href="Datagram-TLS-API.html#Datagram-TLS-API" accesskey="p" rel="prev">Datagram TLS API</a>, Up: <a href="API-reference.html#API-reference" accesskey="u" rel="up">API reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Data-Index.html#Function-and-Data-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="X_002e509-certificate-API"></a>
<h3 class="section">E.3 <acronym>X.509</acronym> certificate API</h3>
<a name="index-X_002e509-Functions"></a>

<p>The following functions are to be used for <acronym>X.509</acronym> certificate handling.
Their prototypes lie in <samp>gnutls/x509.h</samp>.
</p>

<a name="gnutls_005fcertificate_005fget_005ftrust_005flist-1"></a>
<h4 class="subheading">gnutls_certificate_get_trust_list</h4>
<a name="gnutls_005fcertificate_005fget_005ftrust_005flist"></a><dl>
<dt><a name="index-gnutls_005fcertificate_005fget_005ftrust_005flist"></a>Function: <em>void</em> <strong>gnutls_certificate_get_trust_list</strong> <em>(gnutls_certificate_credentials_t <var>res</var>, gnutls_x509_trust_list_t * <var>tlist</var>)</em></dt>
<dd><p><var>res</var>: is a <code>gnutls_certificate_credentials_t</code>  type.
</p>
<p><var>tlist</var>: Location where to store the trust list.
</p>
<p>Obtains the list of trusted certificates stored in  <code>res</code> and writes a
pointer to it to the location  <code>tlist</code> . The pointer will point to memory
internal to  <code>res</code> , and must not be deinitialized. It will be automatically
deallocated when the  <code>res</code> structure is deinitialized.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fcertificate_005fset_005ftrust_005flist-1"></a>
<h4 class="subheading">gnutls_certificate_set_trust_list</h4>
<a name="gnutls_005fcertificate_005fset_005ftrust_005flist"></a><dl>
<dt><a name="index-gnutls_005fcertificate_005fset_005ftrust_005flist"></a>Function: <em>void</em> <strong>gnutls_certificate_set_trust_list</strong> <em>(gnutls_certificate_credentials_t <var>res</var>, gnutls_x509_trust_list_t <var>tlist</var>, unsigned <var>flags</var>)</em></dt>
<dd><p><var>res</var>: is a <code>gnutls_certificate_credentials_t</code>  type.
</p>
<p><var>tlist</var>: is a <code>gnutls_x509_trust_list_t</code>  type
</p>
<p><var>flags</var>: must be zero
</p>
<p>This function sets a trust list in the gnutls_certificate_credentials_t type. 
</p>
<p>Note that the  <code>tlist</code> will become part of the credentials 
structure and must not be deallocated. It will be automatically deallocated 
when the  <code>res</code> structure is deinitialized.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  (0) on success, or a negative error code.
</p>
<p><strong>Since:</strong> 3.2.2
</p></dd></dl>

<a name="gnutls_005fpkcs8_005finfo-1"></a>
<h4 class="subheading">gnutls_pkcs8_info</h4>
<a name="gnutls_005fpkcs8_005finfo"></a><dl>
<dt><a name="index-gnutls_005fpkcs8_005finfo"></a>Function: <em>int</em> <strong>gnutls_pkcs8_info</strong> <em>(const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, unsigned int * <var>schema</var>, unsigned int * <var>cipher</var>, void * <var>salt</var>, unsigned int * <var>salt_size</var>, unsigned int * <var>iter_count</var>, char ** <var>oid</var>)</em></dt>
<dd><p><var>data</var>: Holds the PKCS <code>8</code>  data
</p>
<p><var>format</var>: the format of the PKCS <code>8</code>  data
</p>
<p><var>schema</var>: indicate the schema as one of <code>gnutls_pkcs_encrypt_flags_t</code> 
</p>
<p><var>cipher</var>: the cipher used as <code>gnutls_cipher_algorithm_t</code> 
</p>
<p><var>salt</var>: PBKDF2 salt (if non-NULL then  <code>salt_size</code> initially holds its size)
</p>
<p><var>salt_size</var>: PBKDF2 salt size
</p>
<p><var>iter_count</var>: PBKDF2 iteration count
</p>
<p><var>oid</var>: if non-NULL it will contain an allocated null-terminated variable with the OID
</p>
<p>This function will provide information on the algorithms used
in a particular PKCS <code>8</code>  structure. If the structure algorithms
are unknown the code <code>GNUTLS_E_UNKNOWN_CIPHER_TYPE</code>  will be returned,
and only  <code>oid</code> , will be set. That is,  <code>oid</code> will be set on encrypted PKCS <code>8</code> 
structures whether supported or not. It must be deinitialized using <code>gnutls_free()</code> .
The other variables are only set on supported structures.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_INVALID_REQUEST</code>  if the provided structure isn&rsquo;t encrypted,
<code>GNUTLS_E_UNKNOWN_CIPHER_TYPE</code>  if the structure&rsquo;s encryption isn&rsquo;t supported, or
another negative error code in case of a failure. Zero on success.
</p></dd></dl>

<a name="gnutls_005fpkcs_005fschema_005fget_005fname-1"></a>
<h4 class="subheading">gnutls_pkcs_schema_get_name</h4>
<a name="gnutls_005fpkcs_005fschema_005fget_005fname"></a><dl>
<dt><a name="index-gnutls_005fpkcs_005fschema_005fget_005fname"></a>Function: <em>const char *</em> <strong>gnutls_pkcs_schema_get_name</strong> <em>(unsigned int <var>schema</var>)</em></dt>
<dd><p><var>schema</var>: Holds the PKCS <code>12</code>  or PBES2 schema (<code>gnutls_pkcs_encrypt_flags_t</code> )
</p>
<p>This function will return a human readable description of the
PKCS12 or PBES2 schema.
</p>
<p><strong>Returns:</strong> a constrant string or <code>NULL</code>  on error.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fpkcs_005fschema_005fget_005foid-1"></a>
<h4 class="subheading">gnutls_pkcs_schema_get_oid</h4>
<a name="gnutls_005fpkcs_005fschema_005fget_005foid"></a><dl>
<dt><a name="index-gnutls_005fpkcs_005fschema_005fget_005foid"></a>Function: <em>const char *</em> <strong>gnutls_pkcs_schema_get_oid</strong> <em>(unsigned int <var>schema</var>)</em></dt>
<dd><p><var>schema</var>: Holds the PKCS <code>12</code>  or PBES2 schema (<code>gnutls_pkcs_encrypt_flags_t</code> )
</p>
<p>This function will return the object identifier of the
PKCS12 or PBES2 schema.
</p>
<p><strong>Returns:</strong> a constrant string or <code>NULL</code>  on error.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fsubject_005falt_005fnames_005fdeinit-1"></a>
<h4 class="subheading">gnutls_subject_alt_names_deinit</h4>
<a name="gnutls_005fsubject_005falt_005fnames_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fsubject_005falt_005fnames_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_subject_alt_names_deinit</strong> <em>(gnutls_subject_alt_names_t <var>sans</var>)</em></dt>
<dd><p><var>sans</var>: The alternative names
</p>
<p>This function will deinitialize an alternative names structure.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fsubject_005falt_005fnames_005fget-1"></a>
<h4 class="subheading">gnutls_subject_alt_names_get</h4>
<a name="gnutls_005fsubject_005falt_005fnames_005fget"></a><dl>
<dt><a name="index-gnutls_005fsubject_005falt_005fnames_005fget"></a>Function: <em>int</em> <strong>gnutls_subject_alt_names_get</strong> <em>(gnutls_subject_alt_names_t <var>sans</var>, unsigned int <var>seq</var>, unsigned int * <var>san_type</var>, gnutls_datum_t * <var>san</var>, gnutls_datum_t * <var>othername_oid</var>)</em></dt>
<dd><p><var>sans</var>: The alternative names
</p>
<p><var>seq</var>: The index of the name to get
</p>
<p><var>san_type</var>: Will hold the type of the name (of <code>gnutls_subject_alt_names_t</code> )
</p>
<p><var>san</var>: The alternative name data (should be treated as constant)
</p>
<p><var>othername_oid</var>: The object identifier if  <code>san_type</code> is <code>GNUTLS_SAN_OTHERNAME</code>  (should be treated as constant)
</p>
<p>This function will return a specific alternative name as stored in
the  <code>sans</code> type. The returned values should be treated as constant
and valid for the lifetime of  <code>sans</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fsubject_005falt_005fnames_005finit-1"></a>
<h4 class="subheading">gnutls_subject_alt_names_init</h4>
<a name="gnutls_005fsubject_005falt_005fnames_005finit"></a><dl>
<dt><a name="index-gnutls_005fsubject_005falt_005fnames_005finit"></a>Function: <em>int</em> <strong>gnutls_subject_alt_names_init</strong> <em>(gnutls_subject_alt_names_t * <var>sans</var>)</em></dt>
<dd><p><var>sans</var>: The alternative names
</p>
<p>This function will initialize an alternative names structure.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fsubject_005falt_005fnames_005fset-1"></a>
<h4 class="subheading">gnutls_subject_alt_names_set</h4>
<a name="gnutls_005fsubject_005falt_005fnames_005fset"></a><dl>
<dt><a name="index-gnutls_005fsubject_005falt_005fnames_005fset"></a>Function: <em>int</em> <strong>gnutls_subject_alt_names_set</strong> <em>(gnutls_subject_alt_names_t <var>sans</var>, unsigned int <var>san_type</var>, const gnutls_datum_t * <var>san</var>, const char * <var>othername_oid</var>)</em></dt>
<dd><p><var>sans</var>: The alternative names
</p>
<p><var>san_type</var>: The type of the name (of <code>gnutls_subject_alt_names_t</code> )
</p>
<p><var>san</var>: The alternative name data
</p>
<p><var>othername_oid</var>: The object identifier if  <code>san_type</code> is <code>GNUTLS_SAN_OTHERNAME</code> 
</p>
<p>This function will store the specified alternative name in
the  <code>sans</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0), otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faia_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_aia_deinit</h4>
<a name="gnutls_005fx509_005faia_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005faia_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_aia_deinit</strong> <em>(gnutls_x509_aia_t <var>aia</var>)</em></dt>
<dd><p><var>aia</var>: The authority info access
</p>
<p>This function will deinitialize an authority info access type.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faia_005fget-1"></a>
<h4 class="subheading">gnutls_x509_aia_get</h4>
<a name="gnutls_005fx509_005faia_005fget"></a><dl>
<dt><a name="index-gnutls_005fx509_005faia_005fget"></a>Function: <em>int</em> <strong>gnutls_x509_aia_get</strong> <em>(gnutls_x509_aia_t <var>aia</var>, unsigned int <var>seq</var>, gnutls_datum_t * <var>oid</var>, unsigned * <var>san_type</var>, gnutls_datum_t * <var>san</var>)</em></dt>
<dd><p><var>aia</var>: The authority info access
</p>
<p><var>seq</var>: specifies the sequence number of the access descriptor (0 for the first one, 1 for the second etc.)
</p>
<p><var>oid</var>: the type of available data; to be treated as constant.
</p>
<p><var>san_type</var>: Will hold the type of the name of <code>gnutls_subject_alt_names_t</code>  (may be null).
</p>
<p><var>san</var>: the access location name; to be treated as constant (may be null).
</p>
<p>This function reads from the Authority Information Access type.
</p>
<p>The  <code>seq</code> input parameter is used to indicate which member of the
sequence the caller is interested in.  The first member is 0, the
second member 1 and so on.  When the  <code>seq</code> value is out of bounds,
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p>Typically  <code>oid</code> is <code>GNUTLS_OID_AD_CAISSUERS</code>  or <code>GNUTLS_OID_AD_OCSP</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faia_005finit-1"></a>
<h4 class="subheading">gnutls_x509_aia_init</h4>
<a name="gnutls_005fx509_005faia_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005faia_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_aia_init</strong> <em>(gnutls_x509_aia_t * <var>aia</var>)</em></dt>
<dd><p><var>aia</var>: The authority info access
</p>
<p>This function will initialize an authority info access type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faia_005fset-1"></a>
<h4 class="subheading">gnutls_x509_aia_set</h4>
<a name="gnutls_005fx509_005faia_005fset"></a><dl>
<dt><a name="index-gnutls_005fx509_005faia_005fset"></a>Function: <em>int</em> <strong>gnutls_x509_aia_set</strong> <em>(gnutls_x509_aia_t <var>aia</var>, const char * <var>oid</var>, unsigned <var>san_type</var>, const gnutls_datum_t * <var>san</var>)</em></dt>
<dd><p><var>aia</var>: The authority info access
</p>
<p><var>oid</var>: the type of data.
</p>
<p><var>san_type</var>: The type of the name (of <code>gnutls_subject_alt_names_t</code> )
</p>
<p><var>san</var>: The alternative name data
</p>
<p>This function will store the specified alternative name in
the  <code>aia</code> type. 
</p>
<p>Typically the value for  <code>oid</code> should be <code>GNUTLS_OID_AD_OCSP</code> , or
<code>GNUTLS_OID_AD_CAISSUERS</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0), otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_aki_deinit</h4>
<a name="gnutls_005fx509_005faki_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_aki_deinit</strong> <em>(gnutls_x509_aki_t <var>aki</var>)</em></dt>
<dd><p><var>aki</var>: The authority key identifier type
</p>
<p>This function will deinitialize an authority key identifier.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005fget_005fcert_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_aki_get_cert_issuer</h4>
<a name="gnutls_005fx509_005faki_005fget_005fcert_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005fget_005fcert_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_aki_get_cert_issuer</strong> <em>(gnutls_x509_aki_t <var>aki</var>, unsigned int <var>seq</var>, unsigned int * <var>san_type</var>, gnutls_datum_t * <var>san</var>, gnutls_datum_t * <var>othername_oid</var>, gnutls_datum_t * <var>serial</var>)</em></dt>
<dd><p><var>aki</var>: The authority key ID
</p>
<p><var>seq</var>: The index of the name to get
</p>
<p><var>san_type</var>: Will hold the type of the name (of <code>gnutls_subject_alt_names_t</code> )
</p>
<p><var>san</var>: The alternative name data
</p>
<p><var>othername_oid</var>: The object identifier if  <code>san_type</code> is <code>GNUTLS_SAN_OTHERNAME</code> 
</p>
<p><var>serial</var>: The authorityCertSerialNumber number
</p>
<p>This function will return a specific authorityCertIssuer name as stored in
the  <code>aki</code> type, as well as the authorityCertSerialNumber. All the returned
values should be treated as constant, and may be set to <code>NULL</code>  when are not required.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005fget_005fid-1"></a>
<h4 class="subheading">gnutls_x509_aki_get_id</h4>
<a name="gnutls_005fx509_005faki_005fget_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005fget_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_aki_get_id</strong> <em>(gnutls_x509_aki_t <var>aki</var>, gnutls_datum_t * <var>id</var>)</em></dt>
<dd><p><var>aki</var>: The authority key ID
</p>
<p><var>id</var>: Will hold the identifier
</p>
<p>This function will return the key identifier as stored in
the  <code>aki</code> type. The identifier should be treated as constant.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005finit-1"></a>
<h4 class="subheading">gnutls_x509_aki_init</h4>
<a name="gnutls_005fx509_005faki_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_aki_init</strong> <em>(gnutls_x509_aki_t * <var>aki</var>)</em></dt>
<dd><p><var>aki</var>: The authority key ID type
</p>
<p>This function will initialize an authority key ID.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005fset_005fcert_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_aki_set_cert_issuer</h4>
<a name="gnutls_005fx509_005faki_005fset_005fcert_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005fset_005fcert_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_aki_set_cert_issuer</strong> <em>(gnutls_x509_aki_t <var>aki</var>, unsigned int <var>san_type</var>, const gnutls_datum_t * <var>san</var>, const char * <var>othername_oid</var>, const gnutls_datum_t * <var>serial</var>)</em></dt>
<dd><p><var>aki</var>: The authority key ID
</p>
<p><var>san_type</var>: the type of the name (of <code>gnutls_subject_alt_names_t</code> ), may be null
</p>
<p><var>san</var>: The alternative name data
</p>
<p><var>othername_oid</var>: The object identifier if  <code>san_type</code> is <code>GNUTLS_SAN_OTHERNAME</code> 
</p>
<p><var>serial</var>: The authorityCertSerialNumber number (may be null)
</p>
<p>This function will set the authorityCertIssuer name and the authorityCertSerialNumber 
to be stored in the  <code>aki</code> type. When storing multiple names, the serial
should be set on the first call, and subsequent calls should use a <code>NULL</code>  serial.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005faki_005fset_005fid-1"></a>
<h4 class="subheading">gnutls_x509_aki_set_id</h4>
<a name="gnutls_005fx509_005faki_005fset_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005faki_005fset_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_aki_set_id</strong> <em>(gnutls_x509_aki_t <var>aki</var>, const gnutls_datum_t * <var>id</var>)</em></dt>
<dd><p><var>aki</var>: The authority key ID
</p>
<p><var>id</var>: the key identifier
</p>
<p>This function will set the keyIdentifier to be stored in the  <code>aki</code> type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fcheck_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_crl_check_issuer</h4>
<a name="gnutls_005fx509_005fcrl_005fcheck_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fcheck_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_crl_check_issuer</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crt_t <var>issuer</var>)</em></dt>
<dd><p><var>crl</var>: is the CRL to be checked
</p>
<p><var>issuer</var>: is the certificate of a possible issuer
</p>
<p>This function will check if the given CRL was issued by the given
issuer certificate.  
</p>
<p><strong>Returns:</strong> true (1) if the given CRL was issued by the given issuer, 
and false (0) if not.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_crl_deinit</h4>
<a name="gnutls_005fx509_005fcrl_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_crl_deinit</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: The data to be deinitialized
</p>
<p>This function will deinitialize a CRL structure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_crl_dist_points_deinit</h4>
<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fdist_005fpoints_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_crl_dist_points_deinit</strong> <em>(gnutls_x509_crl_dist_points_t <var>cdp</var>)</em></dt>
<dd><p><var>cdp</var>: The CRL distribution points
</p>
<p>This function will deinitialize a CRL distribution points type.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fget-1"></a>
<h4 class="subheading">gnutls_x509_crl_dist_points_get</h4>
<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fget"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fdist_005fpoints_005fget"></a>Function: <em>int</em> <strong>gnutls_x509_crl_dist_points_get</strong> <em>(gnutls_x509_crl_dist_points_t <var>cdp</var>, unsigned int <var>seq</var>, unsigned int * <var>type</var>, gnutls_datum_t * <var>san</var>, unsigned int * <var>reasons</var>)</em></dt>
<dd><p><var>cdp</var>: The CRL distribution points
</p>
<p><var>seq</var>: specifies the sequence number of the distribution point (0 for the first one, 1 for the second etc.)
</p>
<p><var>type</var>: The name type of the corresponding name (gnutls_x509_subject_alt_name_t)
</p>
<p><var>san</var>: The distribution point names (to be treated as constant)
</p>
<p><var>reasons</var>: Revocation reasons. An ORed sequence of flags from <code>gnutls_x509_crl_reason_flags_t</code> .
</p>
<p>This function retrieves the individual CRL distribution points (2.5.29.31),
contained in provided type. 
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005finit-1"></a>
<h4 class="subheading">gnutls_x509_crl_dist_points_init</h4>
<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fdist_005fpoints_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_crl_dist_points_init</strong> <em>(gnutls_x509_crl_dist_points_t * <var>cdp</var>)</em></dt>
<dd><p><var>cdp</var>: The CRL distribution points
</p>
<p>This function will initialize a CRL distribution points type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fset-1"></a>
<h4 class="subheading">gnutls_x509_crl_dist_points_set</h4>
<a name="gnutls_005fx509_005fcrl_005fdist_005fpoints_005fset"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fdist_005fpoints_005fset"></a>Function: <em>int</em> <strong>gnutls_x509_crl_dist_points_set</strong> <em>(gnutls_x509_crl_dist_points_t <var>cdp</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const gnutls_datum_t * <var>san</var>, unsigned int <var>reasons</var>)</em></dt>
<dd><p><var>cdp</var>: The CRL distribution points
</p>
<p><var>type</var>: The type of the name (of <code>gnutls_subject_alt_names_t</code> )
</p>
<p><var>san</var>: The point name data
</p>
<p><var>reasons</var>: Revocation reasons. An ORed sequence of flags from <code>gnutls_x509_crl_reason_flags_t</code> .
</p>
<p>This function will store the specified CRL distibution point value
the  <code>cdp</code> type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0), otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fexport-1"></a>
<h4 class="subheading">gnutls_x509_crl_export</h4>
<a name="gnutls_005fx509_005fcrl_005fexport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fexport"></a>Function: <em>int</em> <strong>gnutls_x509_crl_export</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crt_fmt_t <var>format</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>crl</var>: Holds the revocation list
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>output_data</var>: will contain a private key PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will
be replaced by the actual size of parameters)
</p>
<p>This function will export the revocation list to DER or PEM format.
</p>
<p>If the buffer provided is not long enough to hold the output, then
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be returned.
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN X509 CRL&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fexport2-1"></a>
<h4 class="subheading">gnutls_x509_crl_export2</h4>
<a name="gnutls_005fx509_005fcrl_005fexport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fexport2"></a>Function: <em>int</em> <strong>gnutls_x509_crl_export2</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crt_fmt_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>crl</var>: Holds the revocation list
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>out</var>: will contain a private key PEM or DER encoded
</p>
<p>This function will export the revocation list to DER or PEM format.
</p>
<p>The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN X509 CRL&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p>Since 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fgn_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_authority_key_gn_serial</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fgn_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fgn_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_authority_key_gn_serial</strong> <em>(gnutls_x509_crl_t <var>crl</var>, unsigned int <var>seq</var>, void * <var>alt</var>, size_t * <var>alt_size</var>, unsigned int * <var>alt_type</var>, void * <var>serial</var>, size_t * <var>serial_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>alt</var>: is the place where the alternative name will be copied to
</p>
<p><var>alt_size</var>: holds the size of alt.
</p>
<p><var>alt_type</var>: holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).
</p>
<p><var>serial</var>: buffer to store the serial number (may be null)
</p>
<p><var>serial_size</var>: Holds the size of the serial field (may be null)
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the X.509 authority key
identifier when stored as a general name (authorityCertIssuer) 
and serial number.
</p>
<p>Because more than one general names might be stored
 <code>seq</code> can be used as a counter to request them all until 
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Returns:</strong> Returns 0 on success, or an error code.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_authority_key_id</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_authority_key_id</strong> <em>(gnutls_x509_crl_t <var>crl</var>, void * <var>id</var>, size_t * <var>id_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>id</var>: The place where the identifier will be copied
</p>
<p><var>id_size</var>: Holds the size of the result field.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
(may be null)
</p>
<p>This function will return the CRL authority&rsquo;s key identifier.  This
is obtained by the X.509 Authority Key identifier extension field
(2.5.29.35).  Note that this function 
only returns the keyIdentifier field of the extension and
<code>GNUTLS_E_X509_UNSUPPORTED_EXTENSION</code> , if the extension contains
the name and serial number of the certificate. In that case
<code>gnutls_x509_crl_get_authority_key_gn_serial()</code>  may be used.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fcrt_005fcount-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_crt_count</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fcrt_005fcount"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fcrt_005fcount"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_crt_count</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p>This function will return the number of revoked certificates in the
given CRL.
</p>
<p><strong>Returns:</strong> number of certificates, a negative error code on failure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fcrt_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_crt_serial</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fcrt_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fcrt_005fserial-1"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_crt_serial</strong> <em>(gnutls_x509_crl_t <var>crl</var>, int <var>indx</var>, unsigned char * <var>serial</var>, size_t * <var>serial_size</var>, time_t * <var>t</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>indx</var>: the index of the certificate to extract (starting from 0)
</p>
<p><var>serial</var>: where the serial number will be copied
</p>
<p><var>serial_size</var>: initially holds the size of serial
</p>
<p><var>t</var>: if non null, will hold the time this certificate was revoked
</p>
<p>This function will retrieve the serial number of the specified, by
the index, revoked certificate.
</p>
<p>Note that this function will have performance issues in large sequences
of revoked certificates. In that case use <code>gnutls_x509_crl_iter_crt_serial()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fdn_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_dn_oid</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fdn_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fdn_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_dn_oid</strong> <em>(gnutls_x509_crl_t <var>crl</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>indx</var>: Specifies which DN OID to send. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to store the OID (may be null)
</p>
<p><var>sizeof_oid</var>: initially holds the size of &rsquo;oid&rsquo;
</p>
<p>This function will extract the requested OID of the name of the CRL
issuer, specified by the given index.
</p>
<p>If oid is null then only the size will be filled.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the sizeof_oid will be updated
with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005fdata-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_extension_data</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005fdata"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fextension_005fdata"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_extension_data</strong> <em>(gnutls_x509_crl_t <var>crl</var>, int <var>indx</var>, void * <var>data</var>, size_t * <var>sizeof_data</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send. Use (0) to get the first one.
</p>
<p><var>data</var>: a pointer to a structure to hold the data (may be null)
</p>
<p><var>sizeof_data</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will return the requested extension data in the CRL.
The extension data will be stored as a string in the provided
buffer.
</p>
<p>Use <code>gnutls_x509_crl_get_extension_info()</code>  to extract the OID and
critical flag.  Use <code>gnutls_x509_crl_get_extension_info()</code>  instead,
if you want to get data indexed by the extension OID rather than
sequence.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005fdata2-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_extension_data2</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005fdata2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fextension_005fdata2"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_extension_data2</strong> <em>(gnutls_x509_crl_t <var>crl</var>, unsigned <var>indx</var>, gnutls_datum_t * <var>data</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to read. Use (0) to get the first one.
</p>
<p><var>data</var>: will contain the extension DER-encoded data
</p>
<p>This function will return the requested by the index extension data in the
certificate revocation list.  The extension data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p>Use <code>gnutls_x509_crt_get_extension_info()</code>  to extract the OID.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005finfo-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_extension_info</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005finfo"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fextension_005finfo"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_extension_info</strong> <em>(gnutls_x509_crl_t <var>crl</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send, use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to store the OID
</p>
<p><var>sizeof_oid</var>: initially holds the maximum size of  <code>oid</code> , on return
holds actual size of  <code>oid</code> .
</p>
<p><var>critical</var>: output variable with critical flag, may be NULL.
</p>
<p>This function will return the requested extension OID in the CRL,
and the critical flag for it.  The extension OID will be stored as
a string in the provided buffer.  Use
<code>gnutls_x509_crl_get_extension_data()</code>  to extract the data.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>sizeof_oid</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be
returned.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_extension_oid</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fextension_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fextension_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_extension_oid</strong> <em>(gnutls_x509_crl_t <var>crl</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send, use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to store the OID (may be null)
</p>
<p><var>sizeof_oid</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will return the requested extension OID in the CRL.
The extension OID will be stored as a string in the provided
buffer.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_issuer_dn</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_issuer_dn</strong> <em>(const gnutls_x509_crl_t <var>crl</var>, char * <var>buf</var>, size_t * <var>sizeof_buf</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>buf</var>: a pointer to a structure to hold the peer&rsquo;s name (may be null)
</p>
<p><var>sizeof_buf</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will copy the name of the CRL issuer in the provided
buffer. The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p>If buf is <code>NULL</code>  then only the size will be filled.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the sizeof_buf will be updated
with the required size, and 0 on success.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn2-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_issuer_dn2</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn2"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_issuer_dn2</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>dn</var>: a pointer to a structure to hold the name
</p>
<p>This function will allocate buffer and copy the name of the CRL issuer.
The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_issuer_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fissuer_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_issuer_dn_by_oid</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const char * <var>oid</var>, int <var>indx</var>, unsigned int <var>raw_flag</var>, void * <var>buf</var>, size_t * <var>sizeof_buf</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the RDN, this specifies which to send. Use (0) to get the first one.
</p>
<p><var>raw_flag</var>: If non-zero returns the raw DER data of the DN part.
</p>
<p><var>buf</var>: a pointer to a structure to hold the peer&rsquo;s name (may be null)
</p>
<p><var>sizeof_buf</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will extract the part of the name of the CRL issuer
specified by the given OID. The output will be encoded as described
in RFC4514. The output string will be ASCII or UTF-8 encoded,
depending on the certificate data.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
If raw flag is (0), this function will only return known OIDs as
text. Other OIDs will be DER encoded, as described in RFC4514 &ndash; in
hex format with a &rsquo;#&rsquo; prefix.  You can check about known OIDs
using <code>gnutls_x509_dn_oid_known()</code> .
</p>
<p>If buf is null then only the size will be filled.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the sizeof_buf will be updated
with the required size, and 0 on success.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fnext_005fupdate-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_next_update</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fnext_005fupdate"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fnext_005fupdate"></a>Function: <em>time_t</em> <strong>gnutls_x509_crl_get_next_update</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p>This function will return the time the next CRL will be issued.
This field is optional in a CRL so it might be normal to get an
error instead.
</p>
<p><strong>Returns:</strong> when the next CRL will be issued, or (time_t)-1 on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fnumber-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_number</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fnumber"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fnumber"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_number</strong> <em>(gnutls_x509_crl_t <var>crl</var>, void * <var>ret</var>, size_t * <var>ret_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>ret</var>: The place where the number will be copied
</p>
<p><var>ret_size</var>: Holds the size of the result field.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
(may be null)
</p>
<p>This function will return the CRL number extension.  This is
obtained by the CRL Number extension field (2.5.29.20).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fraw_005fissuer_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_raw_issuer_dn</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fraw_005fissuer_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fraw_005fissuer_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_raw_issuer_dn</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>dn</var>: will hold the starting point of the DN
</p>
<p>This function will return a pointer to the DER encoded DN structure
and the length.
</p>
<p><strong>Returns:</strong> a negative error code on error, and (0) on success.
</p>
<p><strong>Since:</strong> 2.12.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fsignature-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_signature</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fsignature"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fsignature"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_signature</strong> <em>(gnutls_x509_crl_t <var>crl</var>, char * <var>sig</var>, size_t * <var>sizeof_sig</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>sig</var>: a pointer where the signature part will be copied (may be null).
</p>
<p><var>sizeof_sig</var>: initially holds the size of  <code>sig</code> 
</p>
<p>This function will extract the signature field of a CRL.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value. 
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fsignature_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_signature_algorithm</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fsignature_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fsignature_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_signature_algorithm</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p>This function will return a value of the <code>gnutls_sign_algorithm_t</code> 
enumeration that is the signature algorithm.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fthis_005fupdate-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_this_update</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fthis_005fupdate"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fthis_005fupdate"></a>Function: <em>time_t</em> <strong>gnutls_x509_crl_get_this_update</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p>This function will return the time this CRL was issued.
</p>
<p><strong>Returns:</strong> when the CRL was issued, or (time_t)-1 on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fget_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crl_get_version</h4>
<a name="gnutls_005fx509_005fcrl_005fget_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fget_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crl_get_version</strong> <em>(gnutls_x509_crl_t <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p>This function will return the version of the specified CRL.
</p>
<p><strong>Returns:</strong> The version number, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_crl_import</h4>
<a name="gnutls_005fx509_005fcrl_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_crl_import</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>)</em></dt>
<dd><p><var>crl</var>: The data to store the parsed CRL.
</p>
<p><var>data</var>: The DER or PEM encoded CRL.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p>This function will convert the given DER or PEM encoded CRL
to the native <code>gnutls_x509_crl_t</code>  format. The output will be stored in &rsquo;crl&rsquo;.
</p>
<p>If the CRL is PEM encoded it should have a header of &quot;X509 CRL&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005finit-1"></a>
<h4 class="subheading">gnutls_x509_crl_init</h4>
<a name="gnutls_005fx509_005fcrl_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_crl_init</strong> <em>(gnutls_x509_crl_t * <var>crl</var>)</em></dt>
<dd><p><var>crl</var>: A pointer to the type to be initialized
</p>
<p>This function will initialize a CRL structure. CRL stands for
Certificate Revocation List. A revocation list usually contains
lists of certificate serial numbers that have been revoked by an
Authority. The revocation lists are always signed with the
authority&rsquo;s private key.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fiter_005fcrt_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crl_iter_crt_serial</h4>
<a name="gnutls_005fx509_005fcrl_005fiter_005fcrt_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fiter_005fcrt_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crl_iter_crt_serial</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crl_iter_t * <var>iter</var>, unsigned char * <var>serial</var>, size_t * <var>serial_size</var>, time_t * <var>t</var>)</em></dt>
<dd><p><var>crl</var>: should contain a <code>gnutls_x509_crl_t</code>  type
</p>
<p><var>iter</var>: A pointer to an iterator (initially the iterator should be <code>NULL</code> )
</p>
<p><var>serial</var>: where the serial number will be copied
</p>
<p><var>serial_size</var>: initially holds the size of serial
</p>
<p><var>t</var>: if non null, will hold the time this certificate was revoked
</p>
<p>This function performs the same as <code>gnutls_x509_crl_get_crt_serial()</code> ,
but reads sequentially and keeps state in the iterator 
between calls. That allows it to provide better performance in sequences 
with many elements (50000+).
</p>
<p>When past the last element is accessed <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
is returned and the iterator is reset.
</p>
<p>After use, the iterator must be deinitialized using <code>gnutls_x509_crl_iter_deinit()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fiter_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_crl_iter_deinit</h4>
<a name="gnutls_005fx509_005fcrl_005fiter_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fiter_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_crl_iter_deinit</strong> <em>(gnutls_x509_crl_iter_t <var>iter</var>)</em></dt>
<dd><p><var>iter</var>: The iterator to be deinitialized
</p>
<p>This function will deinitialize an iterator type.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005flist_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_crl_list_import</h4>
<a name="gnutls_005fx509_005fcrl_005flist_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005flist_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_crl_list_import</strong> <em>(gnutls_x509_crl_t * <var>crls</var>, unsigned int * <var>crl_max</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crls</var>: Indicates where the parsed CRLs will be copied to. Must not be initialized.
</p>
<p><var>crl_max</var>: Initially must hold the maximum number of crls. It will be updated with the number of crls available.
</p>
<p><var>data</var>: The PEM encoded CRLs
</p>
<p><var>format</var>: One of DER or PEM.
</p>
<p><var>flags</var>: must be (0) or an OR&rsquo;d sequence of gnutls_certificate_import_flags.
</p>
<p>This function will convert the given PEM encoded CRL list
to the native gnutls_x509_crl_t format. The output will be stored
in  <code>crls</code> .  They will be automatically initialized.
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;X509 CRL&quot;.
</p>
<p><strong>Returns:</strong> the number of certificates read or a negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005flist_005fimport2-1"></a>
<h4 class="subheading">gnutls_x509_crl_list_import2</h4>
<a name="gnutls_005fx509_005fcrl_005flist_005fimport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005flist_005fimport2"></a>Function: <em>int</em> <strong>gnutls_x509_crl_list_import2</strong> <em>(gnutls_x509_crl_t ** <var>crls</var>, unsigned int * <var>size</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crls</var>: Will contain the parsed crl list.
</p>
<p><var>size</var>: It will contain the size of the list.
</p>
<p><var>data</var>: The PEM encoded CRL.
</p>
<p><var>format</var>: One of DER or PEM.
</p>
<p><var>flags</var>: must be (0) or an OR&rsquo;d sequence of gnutls_certificate_import_flags.
</p>
<p>This function will convert the given PEM encoded CRL list
to the native gnutls_x509_crl_t format. The output will be stored
in  <code>crls</code> .  They will be automatically initialized.
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;X509
CRL&quot;.
</p>
<p><strong>Returns:</strong> the number of certificates read or a negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fprint-1"></a>
<h4 class="subheading">gnutls_x509_crl_print</h4>
<a name="gnutls_005fx509_005fcrl_005fprint"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fprint"></a>Function: <em>int</em> <strong>gnutls_x509_crl_print</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_certificate_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>crl</var>: The data to be printed
</p>
<p><var>format</var>: Indicate the format to use
</p>
<p><var>out</var>: Newly allocated datum with null terminated string.
</p>
<p>This function will pretty print a X.509 certificate revocation
list, suitable for display to a human.
</p>
<p>The output  <code>out</code> needs to be deallocated using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_authority_key_id</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_authority_key_id</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const void * <var>id</var>, size_t <var>id_size</var>)</em></dt>
<dd><p><var>crl</var>: a CRL of type <code>gnutls_x509_crl_t</code> 
</p>
<p><var>id</var>: The key ID
</p>
<p><var>id_size</var>: Holds the size of the serial field.
</p>
<p>This function will set the CRL&rsquo;s authority key ID extension.  Only
the keyIdentifier field can be set with this function. This may
be used by an authority that holds multiple private keys, to distinguish
the used key.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fcrt-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_crt</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fcrt"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fcrt"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_crt</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crt_t <var>crt</var>, time_t <var>revocation_time</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code>  with the revoked certificate
</p>
<p><var>revocation_time</var>: The time this certificate was revoked
</p>
<p>This function will set a revoked certificate&rsquo;s serial number to the CRL.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fcrt_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_crt_serial</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fcrt_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fcrt_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_crt_serial</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const void * <var>serial</var>, size_t <var>serial_size</var>, time_t <var>revocation_time</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>serial</var>: The revoked certificate&rsquo;s serial number
</p>
<p><var>serial_size</var>: Holds the size of the serial field.
</p>
<p><var>revocation_time</var>: The time this certificate was revoked
</p>
<p>This function will set a revoked certificate&rsquo;s serial number to the CRL.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fnext_005fupdate-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_next_update</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fnext_005fupdate"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fnext_005fupdate"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_next_update</strong> <em>(gnutls_x509_crl_t <var>crl</var>, time_t <var>exp_time</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>exp_time</var>: The actual time
</p>
<p>This function will set the time this CRL will be updated.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fnumber-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_number</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fnumber"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fnumber"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_number</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const void * <var>nr</var>, size_t <var>nr_size</var>)</em></dt>
<dd><p><var>crl</var>: a CRL of type <code>gnutls_x509_crl_t</code> 
</p>
<p><var>nr</var>: The CRL number
</p>
<p><var>nr_size</var>: Holds the size of the nr field.
</p>
<p>This function will set the CRL&rsquo;s number extension. This
is to be used as a unique and monotonic number assigned to
the CRL by the authority.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fthis_005fupdate-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_this_update</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fthis_005fupdate"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fthis_005fupdate"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_this_update</strong> <em>(gnutls_x509_crl_t <var>crl</var>, time_t <var>act_time</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>act_time</var>: The actual time
</p>
<p>This function will set the time this CRL was issued.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fset_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crl_set_version</h4>
<a name="gnutls_005fx509_005fcrl_005fset_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fset_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crl_set_version</strong> <em>(gnutls_x509_crl_t <var>crl</var>, unsigned int <var>version</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>version</var>: holds the version number. For CRLv1 crls must be 1.
</p>
<p>This function will set the version of the CRL. This
must be one for CRL version 1, and so on. The CRLs generated
by gnutls should have a version number of 2.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fsign2-1"></a>
<h4 class="subheading">gnutls_x509_crl_sign2</h4>
<a name="gnutls_005fx509_005fcrl_005fsign2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fsign2-1"></a>Function: <em>int</em> <strong>gnutls_x509_crl_sign2</strong> <em>(gnutls_x509_crl_t <var>crl</var>, gnutls_x509_crt_t <var>issuer</var>, gnutls_x509_privkey_t <var>issuer_key</var>, gnutls_digest_algorithm_t <var>dig</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crl</var>: should contain a gnutls_x509_crl_t type
</p>
<p><var>issuer</var>: is the certificate of the certificate issuer
</p>
<p><var>issuer_key</var>: holds the issuer&rsquo;s private key
</p>
<p><var>dig</var>: The message digest to use. GNUTLS_DIG_SHA1 is the safe choice unless you know what you&rsquo;re doing.
</p>
<p><var>flags</var>: must be 0
</p>
<p>This function will sign the CRL with the issuer&rsquo;s private key, and
will copy the issuer&rsquo;s information into the CRL.
</p>
<p>This must be the last step in a certificate CRL since all
the previously set parameters are now signed.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrl_005fverify-1"></a>
<h4 class="subheading">gnutls_x509_crl_verify</h4>
<a name="gnutls_005fx509_005fcrl_005fverify"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrl_005fverify"></a>Function: <em>int</em> <strong>gnutls_x509_crl_verify</strong> <em>(gnutls_x509_crl_t <var>crl</var>, const gnutls_x509_crt_t * <var>trusted_cas</var>, int <var>tcas_size</var>, unsigned int <var>flags</var>, unsigned int * <var>verify</var>)</em></dt>
<dd><p><var>crl</var>: is the crl to be verified
</p>
<p><var>trusted_cas</var>: is a certificate list that is considered to be trusted one
</p>
<p><var>tcas_size</var>: holds the number of CA certificates in CA_list
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>verify</var>: will hold the crl verification output.
</p>
<p>This function will try to verify the given crl and return its verification status.
See <code>gnutls_x509_crt_list_verify()</code>  for a detailed description of
return values. Note that since GnuTLS 3.1.4 this function includes
the time checks.
</p>
<p>Note that value in  <code>verify</code> is set only when the return value of this 
function is success (i.e, failure to trust a CRL a certificate does not imply 
a negative return value).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_crq_deinit</h4>
<a name="gnutls_005fx509_005fcrq_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_crq_deinit</strong> <em>(gnutls_x509_crq_t <var>crq</var>)</em></dt>
<dd><p><var>crq</var>: the type to be deinitialized
</p>
<p>This function will deinitialize a PKCS<code>10</code>  certificate request
structure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fexport-1"></a>
<h4 class="subheading">gnutls_x509_crq_export</h4>
<a name="gnutls_005fx509_005fcrq_005fexport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fexport"></a>Function: <em>int</em> <strong>gnutls_x509_crq_export</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_x509_crt_fmt_t <var>format</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>output_data</var>: will contain a certificate request PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will export the certificate request to a PEM or DER
encoded PKCS10 structure.
</p>
<p>If the buffer provided is not long enough to hold the output, then
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be returned and
* <code>output_data_size</code> will be updated.
</p>
<p>If the structure is PEM encoded, it will have a header of &quot;BEGIN
NEW CERTIFICATE REQUEST&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fexport2-1"></a>
<h4 class="subheading">gnutls_x509_crq_export2</h4>
<a name="gnutls_005fx509_005fcrq_005fexport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fexport2"></a>Function: <em>int</em> <strong>gnutls_x509_crq_export2</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_x509_crt_fmt_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>out</var>: will contain a certificate request PEM or DER encoded
</p>
<p>This function will export the certificate request to a PEM or DER
encoded PKCS10 structure.
</p>
<p>The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header of &quot;BEGIN
NEW CERTIFICATE REQUEST&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p>Since 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_attribute_by_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fattribute_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_attribute_by_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, int <var>indx</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identifier in null-terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the attribute list, this
specifies which to get, use (0) to get the first one
</p>
<p><var>buf</var>: a pointer to a structure to hold the attribute data (may be <code>NULL</code> )
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will return the attribute in the certificate request
specified by the given Object ID.  The attribute will be DER
encoded.
</p>
<p>Attributes in a certificate request is an optional set of data
appended to the request. Their interpretation depends on the CA policy.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005fdata-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_attribute_data</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005fdata"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fattribute_005fdata"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_attribute_data</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>data</var>, size_t * <var>sizeof_data</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: Specifies which attribute number to get. Use (0) to get the first one.
</p>
<p><var>data</var>: a pointer to a structure to hold the data (may be null)
</p>
<p><var>sizeof_data</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will return the requested attribute data in the
certificate request.  The attribute data will be stored as a string in the
provided buffer.
</p>
<p>Use <code>gnutls_x509_crq_get_attribute_info()</code>  to extract the OID.
Use <code>gnutls_x509_crq_get_attribute_by_oid()</code>  instead,
if you want to get data indexed by the attribute OID rather than
sequence.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005finfo-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_attribute_info</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fattribute_005finfo"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fattribute_005finfo"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_attribute_info</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: Specifies which attribute number to get. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a structure to hold the OID
</p>
<p><var>sizeof_oid</var>: initially holds the maximum size of  <code>oid</code> , on return
holds actual size of  <code>oid</code> .
</p>
<p>This function will return the requested attribute OID in the
certificate, and the critical flag for it.  The attribute OID will
be stored as a string in the provided buffer.  Use
<code>gnutls_x509_crq_get_attribute_data()</code>  to extract the data.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>sizeof_oid</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be
returned.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_basic_constraints</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_basic_constraints</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int * <var>critical</var>, unsigned int * <var>ca</var>, int * <var>pathlen</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p><var>ca</var>: pointer to output integer indicating CA status, may be NULL,
value is 1 if the certificate CA flag is set, 0 otherwise.
</p>
<p><var>pathlen</var>: pointer to output integer indicating path length (may be
NULL), non-negative error codes indicate a present pathLenConstraint
field and the actual value, -1 indicate that the field is absent.
</p>
<p>This function will read the certificate&rsquo;s basic constraints, and
return the certificates CA status.  It reads the basicConstraints
X.509 extension (2.5.29.19).
</p>
<p><strong>Returns:</strong> If the certificate is a CA a positive value will be
returned, or (0) if the certificate does not have CA flag set.
A negative error code may be returned in case of errors.  If the
certificate does not contain the basicConstraints extension
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fchallenge_005fpassword-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_challenge_password</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fchallenge_005fpassword"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fchallenge_005fpassword"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_challenge_password</strong> <em>(gnutls_x509_crq_t <var>crq</var>, char * <var>pass</var>, size_t * <var>pass_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>pass</var>: will hold a (0)-terminated password string
</p>
<p><var>pass_size</var>: Initially holds the size of  <code>pass</code> .
</p>
<p>This function will return the challenge password in the request.
The challenge password is intended to be used for requesting a
revocation of the certificate.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_dn</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_dn</strong> <em>(gnutls_x509_crq_t <var>crq</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be <code>NULL</code> )
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will copy the name of the Certificate request subject
to the provided buffer.  The name will be in the form
&quot;C=xxxx,O=yyyy,CN=zzzz&quot; as described in RFC 2253. The output string
 <code>buf</code> will be ASCII or UTF-8 encoded, depending on the certificate
data.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the * <code>buf_size</code> will be updated with
the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fdn2-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_dn2</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fdn2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fdn2"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_dn2</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>dn</var>: a pointer to a structure to hold the name
</p>
<p>This function will allocate buffer and copy the name of the Certificate 
request. The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value. and a negative error code on error.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_dn_by_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, int <var>indx</var>, unsigned int <var>raw_flag</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a gnutls_x509_crq_t type
</p>
<p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the RDN, this specifies
which to get. Use (0) to get the first one.
</p>
<p><var>raw_flag</var>: If non-zero returns the raw DER data of the DN part.
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be <code>NULL</code> )
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will extract the part of the name of the Certificate
request subject, specified by the given OID. The output will be
encoded as described in RFC2253. The output string will be ASCII
or UTF-8 encoded, depending on the certificate data.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
If raw flag is (0), this function will only return known OIDs as
text. Other OIDs will be DER encoded, as described in RFC2253 &ndash;
in hex format with a &rsquo;\#&rsquo; prefix.  You can check about known OIDs
using <code>gnutls_x509_dn_oid_known()</code> .
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the * <code>buf_size</code> will be
updated with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fdn_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_dn_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fdn_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fdn_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_dn_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>)</em></dt>
<dd><p><var>crq</var>: should contain a gnutls_x509_crq_t type
</p>
<p><var>indx</var>: Specifies which DN OID to get. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a structure to hold the name (may be <code>NULL</code> )
</p>
<p><var>sizeof_oid</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will extract the requested OID of the name of the
certificate request subject, specified by the given index.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the * <code>sizeof_oid</code> will be
updated with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_extension_by_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_extension_by_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, int <var>indx</var>, void * <var>buf</var>, size_t * <var>buf_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the extensions, this
specifies which to get. Use (0) to get the first one.
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return the extension specified by the OID in
the certificate.  The extensions will be returned as binary data
DER encoded, in the provided buffer.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If the certificate does not
contain the specified extension
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid2-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_extension_by_oid2</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fextension_005fby_005foid2"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_extension_by_oid2</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, int <var>indx</var>, gnutls_datum_t * <var>output</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the extensions, this
specifies which to get. Use (0) to get the first one.
</p>
<p><var>output</var>: will hold the allocated extension data
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return the extension specified by the OID in
the certificate.  The extensions will be returned as binary data
DER encoded, in the provided buffer.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If the certificate does not
contain the specified extension
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be returned.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fdata-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_extension_data</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fdata"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fextension_005fdata"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_extension_data</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>data</var>, size_t * <var>sizeof_data</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension number to get. Use (0) to get the first one.
</p>
<p><var>data</var>: a pointer to a structure to hold the data (may be null)
</p>
<p><var>sizeof_data</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will return the requested extension data in the
certificate.  The extension data will be stored as a string in the
provided buffer.
</p>
<p>Use <code>gnutls_x509_crq_get_extension_info()</code>  to extract the OID and
critical flag.  Use <code>gnutls_x509_crq_get_extension_by_oid()</code>  instead,
if you want to get data indexed by the extension OID rather than
sequence.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fdata2-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_extension_data2</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005fdata2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fextension_005fdata2"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_extension_data2</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned <var>indx</var>, gnutls_datum_t * <var>data</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to read. Use (0) to get the first one.
</p>
<p><var>data</var>: will contain the extension DER-encoded data
</p>
<p>This function will return the requested extension data in the
certificate request.  The extension data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p>Use <code>gnutls_x509_crq_get_extension_info()</code>  to extract the OID.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005finfo-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_extension_info</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fextension_005finfo"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fextension_005finfo"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_extension_info</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension number to get. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to store the OID
</p>
<p><var>sizeof_oid</var>: initially holds the maximum size of  <code>oid</code> , on return
holds actual size of  <code>oid</code> .
</p>
<p><var>critical</var>: output variable with critical flag, may be NULL.
</p>
<p>This function will return the requested extension OID in the
certificate, and the critical flag for it.  The extension OID will
be stored as a string in the provided buffer.  Use
<code>gnutls_x509_crq_get_extension_data()</code>  to extract the data.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>sizeof_oid</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be
returned.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error code in case of an error.  If your have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_key_id</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_key_id</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>flags</var>, unsigned char * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>crq</var>: a certificate of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>flags</var>: should be one of the flags from <code>gnutls_keyid_flags_t</code> 
</p>
<p><var>output_data</var>: will contain the key ID
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will return a unique ID that depends on the public key
parameters.  This ID can be used in checking whether a certificate
corresponds to the given private key.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>output_data_size</code> is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
be returned.  The output will normally be a SHA-1 hash output,
which is 20 bytes.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fpurpose_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_key_purpose_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fpurpose_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fkey_005fpurpose_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_key_purpose_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>sizeof_oid</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>indx</var>: This specifies which OID to return, use (0) to get the first one
</p>
<p><var>oid</var>: a pointer to store the OID (may be <code>NULL</code> )
</p>
<p><var>sizeof_oid</var>: initially holds the size of  <code>oid</code> 
</p>
<p><var>critical</var>: output variable with critical flag, may be <code>NULL</code> .
</p>
<p>This function will extract the key purpose OIDs of the Certificate
specified by the given index.  These are stored in the Extended Key
Usage extension (2.5.29.37).  See the GNUTLS_KP_* definitions for
human readable names.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the * <code>sizeof_oid</code> will be
updated with the required size.  On success 0 is returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005frsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_key_rsa_raw</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005frsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fkey_005frsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_key_rsa_raw</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_datum_t * <var>m</var>, gnutls_datum_t * <var>e</var>)</em></dt>
<dd><p><var>crq</var>: Holds the certificate
</p>
<p><var>m</var>: will hold the modulus
</p>
<p><var>e</var>: will hold the public exponent
</p>
<p>This function will export the RSA public key&rsquo;s parameters found in
the given structure.  The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_key_usage</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_key_usage</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int * <var>key_usage</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>key_usage</var>: where the key usage bits will be stored
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return certificate&rsquo;s key usage, by reading the
keyUsage X.509 extension (2.5.29.15).  The key usage value will
ORed values of the: <code>GNUTLS_KEY_DIGITAL_SIGNATURE</code> ,
<code>GNUTLS_KEY_NON_REPUDIATION</code> , <code>GNUTLS_KEY_KEY_ENCIPHERMENT</code> ,
<code>GNUTLS_KEY_DATA_ENCIPHERMENT</code> , <code>GNUTLS_KEY_KEY_AGREEMENT</code> ,
<code>GNUTLS_KEY_KEY_CERT_SIGN</code> , <code>GNUTLS_KEY_CRL_SIGN</code> ,
<code>GNUTLS_KEY_ENCIPHER_ONLY</code> , <code>GNUTLS_KEY_DECIPHER_ONLY</code> .
</p>
<p><strong>Returns:</strong> the certificate key usage, or a negative error code in case of
parsing error.  If the certificate does not contain the keyUsage
extension <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be
returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fpk_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_pk_algorithm</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fpk_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fpk_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_pk_algorithm</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int * <var>bits</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>bits</var>: if bits is non-<code>NULL</code>  it will hold the size of the parameters&rsquo; in bits
</p>
<p>This function will return the public key algorithm of a PKCS<code>10</code> 
certificate request.
</p>
<p>If bits is non-<code>NULL</code> , it should have enough size to hold the
parameters size in bits.  For RSA the bits returned is the modulus.
For DSA the bits returned are of the public exponent.
</p>
<p><strong>Returns:</strong> a member of the <code>gnutls_pk_algorithm_t</code>  enumeration on
success, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_private_key_usage_period</strong> <em>(gnutls_x509_crq_t <var>crq</var>, time_t * <var>activation</var>, time_t * <var>expiration</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>activation</var>: The activation time
</p>
<p><var>expiration</var>: The expiration time
</p>
<p><var>critical</var>: the extension status
</p>
<p>This function will return the expiration and activation
times of the private key of the certificate.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fsignature_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_signature_algorithm</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fsignature_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fsignature_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_signature_algorithm</strong> <em>(gnutls_x509_crq_t <var>crq</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_cr_t</code>  type
</p>
<p>This function will return a value of the <code>gnutls_sign_algorithm_t</code> 
enumeration that is the signature algorithm that has been used to
sign this certificate request.
</p>
<p><strong>Returns:</strong> a <code>gnutls_sign_algorithm_t</code>  value, or a negative error code on
error.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_subject_alt_name</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_subject_alt_name</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>seq</var>, void * <var>ret</var>, size_t * <var>ret_size</var>, unsigned int * <var>ret_type</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name, 0 for the
first one, 1 for the second etc.
</p>
<p><var>ret</var>: is the place where the alternative name will be copied to
</p>
<p><var>ret_size</var>: holds the size of ret.
</p>
<p><var>ret_type</var>: holds the <code>gnutls_x509_subject_alt_name_t</code>  name type
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
(may be null)
</p>
<p>This function will return the alternative names, contained in the
given certificate.  It is the same as
<code>gnutls_x509_crq_get_subject_alt_name()</code>  except for the fact that it
will return the type of the alternative name in  <code>ret_type</code> even if
the function fails for some reason (i.e.  the buffer provided is
not enough).
</p>
<p><strong>Returns:</strong> the alternative subject name type on success, one of the
enumerated <code>gnutls_x509_subject_alt_name_t</code> .  It will return
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if  <code>ret_size</code> is not large enough to
hold the value.  In that case  <code>ret_size</code> will be updated with the
required size.  If the certificate request does not have an
Alternative name with the specified sequence number then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fothername_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_subject_alt_othername_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fothername_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fsubject_005falt_005fothername_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_subject_alt_othername_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>seq</var>, void * <var>ret</var>, size_t * <var>ret_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>ret</var>: is the place where the otherName OID will be copied to
</p>
<p><var>ret_size</var>: holds the size of ret.
</p>
<p>This function will extract the type OID of an otherName Subject
Alternative Name, contained in the given certificate, and return
the type as an enumerated element.
</p>
<p>This function is only useful if
<code>gnutls_x509_crq_get_subject_alt_name()</code>  returned
<code>GNUTLS_SAN_OTHERNAME</code> .
</p>
<p><strong>Returns:</strong> the alternative subject name type on success, one of the
enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs,
it will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
e.g. <code>GNUTLS_SAN_OTHERNAME_XMPP</code> , and <code>GNUTLS_SAN_OTHERNAME</code>  for
unknown OIDs.  It will return <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if
 <code>ret_size</code> is not large enough to hold the value.  In that case
 <code>ret_size</code> will be updated with the required size.  If the
certificate does not have an Alternative name with the specified
sequence number and with the otherName type then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fget_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crq_get_version</h4>
<a name="gnutls_005fx509_005fcrq_005fget_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fget_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crq_get_version</strong> <em>(gnutls_x509_crq_t <var>crq</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p>This function will return the version of the specified Certificate
request.
</p>
<p><strong>Returns:</strong> version of certificate request, or a negative error code on
error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_crq_import</h4>
<a name="gnutls_005fx509_005fcrq_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_crq_import</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>)</em></dt>
<dd><p><var>crq</var>: The data to store the parsed certificate request.
</p>
<p><var>data</var>: The DER or PEM encoded certificate.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p>This function will convert the given DER or PEM encoded certificate
request to a <code>gnutls_x509_crq_t</code>  type.  The output will be
stored in  <code>crq</code> .
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;NEW
CERTIFICATE REQUEST&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005finit-1"></a>
<h4 class="subheading">gnutls_x509_crq_init</h4>
<a name="gnutls_005fx509_005fcrq_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_crq_init</strong> <em>(gnutls_x509_crq_t * <var>crq</var>)</em></dt>
<dd><p><var>crq</var>: A pointer to the type to be initialized
</p>
<p>This function will initialize a PKCS<code>10</code>  certificate request
structure.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fprint-1"></a>
<h4 class="subheading">gnutls_x509_crq_print</h4>
<a name="gnutls_005fx509_005fcrq_005fprint"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fprint"></a>Function: <em>int</em> <strong>gnutls_x509_crq_print</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_certificate_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>crq</var>: The data to be printed
</p>
<p><var>format</var>: Indicate the format to use
</p>
<p><var>out</var>: Newly allocated datum with null terminated string.
</p>
<p>This function will pretty print a certificate request, suitable for
display to a human.
</p>
<p>The output  <code>out</code> needs to be deallocated using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fattribute_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_attribute_by_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fattribute_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fattribute_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_attribute_by_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, void * <var>buf</var>, size_t <var>buf_size</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identifier in a null-terminated string
</p>
<p><var>buf</var>: a pointer to a structure that holds the attribute data
</p>
<p><var>buf_size</var>: holds the size of  <code>buf</code> 
</p>
<p>This function will set the attribute in the certificate request
specified by the given Object ID. The provided attribute must be be DER
encoded.
</p>
<p>Attributes in a certificate request is an optional set of data
appended to the request. Their interpretation depends on the CA policy.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_basic_constraints</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_basic_constraints</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>ca</var>, int <var>pathLenConstraint</var>)</em></dt>
<dd><p><var>crq</var>: a certificate request of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>ca</var>: true(1) or false(0) depending on the Certificate authority status.
</p>
<p><var>pathLenConstraint</var>: non-negative error codes indicate maximum length of path,
and negative error codes indicate that the pathLenConstraints field should
not be present.
</p>
<p>This function will set the basicConstraints certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fchallenge_005fpassword-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_challenge_password</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fchallenge_005fpassword"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fchallenge_005fpassword"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_challenge_password</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>pass</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>pass</var>: holds a (0)-terminated password
</p>
<p>This function will set a challenge password to be used when
revoking the request.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_dn</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_dn</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>dn</var>, const char ** <var>err</var>)</em></dt>
<dd><p><var>crq</var>: a certificate of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>dn</var>: a comma separated DN string (RFC4514)
</p>
<p><var>err</var>: indicates the error position (if any)
</p>
<p>This function will set the DN on the provided certificate.
The input string should be plain ASCII or UTF-8 encoded.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_dn_by_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const char * <var>oid</var>, unsigned int <var>raw_flag</var>, const void * <var>data</var>, unsigned int <var>sizeof_data</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identifier in a (0)-terminated string
</p>
<p><var>raw_flag</var>: must be 0, or 1 if the data are DER encoded
</p>
<p><var>data</var>: a pointer to the input data
</p>
<p><var>sizeof_data</var>: holds the size of  <code>data</code> 
</p>
<p>This function will set the part of the name of the Certificate
request subject, specified by the given OID.  The input string
should be ASCII or UTF-8 encoded.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
With this function you can only set the known OIDs.  You can test
for known OIDs using <code>gnutls_x509_dn_oid_known()</code> .  For OIDs that are
not known (by gnutls) you should properly DER encode your data, and
call this function with raw_flag set.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fkey-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_key</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fkey"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fkey-1"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_key</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>key</var>: holds a private key
</p>
<p>This function will set the public parameters from the given private
key to the request.  
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005fpurpose_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_key_purpose_oid</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005fpurpose_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fkey_005fpurpose_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_key_purpose_oid</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const void * <var>oid</var>, unsigned int <var>critical</var>)</em></dt>
<dd><p><var>crq</var>: a certificate of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>oid</var>: a pointer to a null-terminated string that holds the OID
</p>
<p><var>critical</var>: Whether this extension will be critical or not
</p>
<p>This function will set the key purpose OIDs of the Certificate.
These are stored in the Extended Key Usage extension (2.5.29.37)
See the GNUTLS_KP_* definitions for human readable names.
</p>
<p>Subsequent calls to this function will append OIDs to the OID list.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005frsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_key_rsa_raw</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005frsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fkey_005frsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_key_rsa_raw</strong> <em>(gnutls_x509_crq_t <var>crq</var>, const gnutls_datum_t * <var>m</var>, const gnutls_datum_t * <var>e</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>m</var>: holds the modulus
</p>
<p><var>e</var>: holds the public exponent
</p>
<p>This function will set the public parameters from the given private
key to the request. Only RSA keys are currently supported.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.6.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_key_usage</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_key_usage</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>usage</var>)</em></dt>
<dd><p><var>crq</var>: a certificate request of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>usage</var>: an ORed sequence of the GNUTLS_KEY_* elements.
</p>
<p>This function will set the keyUsage certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_private_key_usage_period</strong> <em>(gnutls_x509_crq_t <var>crq</var>, time_t <var>activation</var>, time_t <var>expiration</var>)</em></dt>
<dd><p><var>crq</var>: a certificate of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>activation</var>: The activation time
</p>
<p><var>expiration</var>: The expiration time
</p>
<p>This function will set the private key usage period extension (2.5.29.16).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fsubject_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_subject_alt_name</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fsubject_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fsubject_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_subject_alt_name</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_x509_subject_alt_name_t <var>nt</var>, const void * <var>data</var>, unsigned int <var>data_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crq</var>: a certificate request of type <code>gnutls_x509_crq_t</code> 
</p>
<p><var>nt</var>: is one of the <code>gnutls_x509_subject_alt_name_t</code>  enumerations
</p>
<p><var>data</var>: The data to be set
</p>
<p><var>data_size</var>: The size of data to be set
</p>
<p><var>flags</var>: <code>GNUTLS_FSAN_SET</code>  to clear previous data or
<code>GNUTLS_FSAN_APPEND</code>  to append.
</p>
<p>This function will set the subject alternative name certificate
extension.  It can set the following types:
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fset_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crq_set_version</h4>
<a name="gnutls_005fx509_005fcrq_005fset_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fset_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crq_set_version</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>version</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>version</var>: holds the version number, for v1 Requests must be 1
</p>
<p>This function will set the version of the certificate request.  For
version 1 requests this must be one.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fsign2-1"></a>
<h4 class="subheading">gnutls_x509_crq_sign2</h4>
<a name="gnutls_005fx509_005fcrq_005fsign2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fsign2-1"></a>Function: <em>int</em> <strong>gnutls_x509_crq_sign2</strong> <em>(gnutls_x509_crq_t <var>crq</var>, gnutls_x509_privkey_t <var>key</var>, gnutls_digest_algorithm_t <var>dig</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crq</var>: should contain a <code>gnutls_x509_crq_t</code>  type
</p>
<p><var>key</var>: holds a private key
</p>
<p><var>dig</var>: The message digest to use, i.e., <code>GNUTLS_DIG_SHA1</code> 
</p>
<p><var>flags</var>: must be 0
</p>
<p>This function will sign the certificate request with a private key.
This must be the same key as the one used in
<code>gnutls_x509_crt_set_key()</code>  since a certificate request is self
signed.
</p>
<p>This must be the last step in a certificate request generation
since all the previously set parameters are now signed.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
<code>GNUTLS_E_ASN1_VALUE_NOT_FOUND</code>  is returned if you didn&rsquo;t set all
information in the certificate request (e.g., the version using
<code>gnutls_x509_crq_set_version()</code> ).
</p></dd></dl>

<a name="gnutls_005fx509_005fcrq_005fverify-1"></a>
<h4 class="subheading">gnutls_x509_crq_verify</h4>
<a name="gnutls_005fx509_005fcrq_005fverify"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrq_005fverify"></a>Function: <em>int</em> <strong>gnutls_x509_crq_verify</strong> <em>(gnutls_x509_crq_t <var>crq</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crq</var>: is the crq to be verified
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p>This function will verify self signature in the certificate
request and return its status.
</p>
<p><strong>Returns:</strong> In case of a verification failure <code>GNUTLS_E_PK_SIG_VERIFY_FAILED</code>  
is returned, and zero or positive code on success.
</p>
<p>Since 2.12.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcheck_005femail-1"></a>
<h4 class="subheading">gnutls_x509_crt_check_email</h4>
<a name="gnutls_005fx509_005fcrt_005fcheck_005femail"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcheck_005femail"></a>Function: <em>int</em> <strong>gnutls_x509_crt_check_email</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>email</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>cert</var>: should contain an gnutls_x509_crt_t type
</p>
<p><var>email</var>: A null terminated string that contains an email address (RFC822)
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will check if the given certificate&rsquo;s subject matches
the given email address.
</p>
<p><strong>Returns:</strong> non-zero for a successful match, and zero on failure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcheck_005fhostname-1"></a>
<h4 class="subheading">gnutls_x509_crt_check_hostname</h4>
<a name="gnutls_005fx509_005fcrt_005fcheck_005fhostname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcheck_005fhostname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_check_hostname</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>hostname</var>)</em></dt>
<dd><p><var>cert</var>: should contain an gnutls_x509_crt_t type
</p>
<p><var>hostname</var>: A null terminated string that contains a DNS name
</p>
<p>This function will check if the given certificate&rsquo;s subject matches
the given hostname.  This is a basic implementation of the matching
described in RFC6125, and takes into account wildcards,
and the DNSName/IPAddress subject alternative name PKIX extension.
</p>
<p>For details see also <code>gnutls_x509_crt_check_hostname2()</code> .
</p>
<p><strong>Returns:</strong> non-zero for a successful match, and zero on failure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcheck_005fhostname2-1"></a>
<h4 class="subheading">gnutls_x509_crt_check_hostname2</h4>
<a name="gnutls_005fx509_005fcrt_005fcheck_005fhostname2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcheck_005fhostname2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_check_hostname2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>hostname</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>cert</var>: should contain an gnutls_x509_crt_t type
</p>
<p><var>hostname</var>: A null terminated string that contains a DNS name
</p>
<p><var>flags</var>: gnutls_certificate_verify_flags
</p>
<p>This function will check if the given certificate&rsquo;s subject matches
the given hostname.  This is a basic implementation of the matching
described in RFC6125, and takes into account wildcards,
and the DNSName/IPAddress subject alternative name PKIX extension.
</p>
<p>IPv4 addresses are accepted by this function in the dotted-decimal
format (e.g, ddd.ddd.ddd.ddd), and IPv6 addresses in the hexadecimal
x:x:x:x:x:x:x:x format. For them the IPAddress subject alternative
name extension is consulted, as well as the DNSNames in case of a non-match.
The latter fallback exists due to misconfiguration of many servers
which place an IPAddress inside the DNSName extension.
</p>
<p>When the flag <code>GNUTLS_VERIFY_DO_NOT_ALLOW_WILDCARDS</code>  is specified no
wildcards are considered. Otherwise they are only considered if the
domain name consists of three components or more, and the wildcard
starts at the leftmost position.
</p>
<p><strong>Returns:</strong> non-zero for a successful match, and zero on failure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcheck_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_crt_check_issuer</h4>
<a name="gnutls_005fx509_005fcrt_005fcheck_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcheck_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_crt_check_issuer</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_x509_crt_t <var>issuer</var>)</em></dt>
<dd><p><var>cert</var>: is the certificate to be checked
</p>
<p><var>issuer</var>: is the certificate of a possible issuer
</p>
<p>This function will check if the given certificate was issued by the
given issuer. It checks the DN fields and the authority
key identifier and subject key identifier fields match.
</p>
<p>If the same certificate is provided at the  <code>cert</code> and  <code>issuer</code> fields,
it will check whether the certificate is self-signed.
</p>
<p><strong>Returns:</strong> It will return true (1) if the given certificate is issued
by the given issuer, and false (0) if not.  
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcheck_005frevocation-1"></a>
<h4 class="subheading">gnutls_x509_crt_check_revocation</h4>
<a name="gnutls_005fx509_005fcrt_005fcheck_005frevocation"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcheck_005frevocation"></a>Function: <em>int</em> <strong>gnutls_x509_crt_check_revocation</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const gnutls_x509_crl_t * <var>crl_list</var>, int <var>crl_list_length</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>crl_list</var>: should contain a list of gnutls_x509_crl_t types
</p>
<p><var>crl_list_length</var>: the length of the crl_list
</p>
<p>This function will return check if the given certificate is
revoked.  It is assumed that the CRLs have been verified before.
</p>
<p><strong>Returns:</strong> 0 if the certificate is NOT revoked, and 1 if it is.  A
negative error code is returned on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fcpy_005fcrl_005fdist_005fpoints-1"></a>
<h4 class="subheading">gnutls_x509_crt_cpy_crl_dist_points</h4>
<a name="gnutls_005fx509_005fcrt_005fcpy_005fcrl_005fdist_005fpoints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fcpy_005fcrl_005fdist_005fpoints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_cpy_crl_dist_points</strong> <em>(gnutls_x509_crt_t <var>dst</var>, gnutls_x509_crt_t <var>src</var>)</em></dt>
<dd><p><var>dst</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>src</var>: the certificate where the dist points will be copied from
</p>
<p>This function will copy the CRL distribution points certificate
extension, from the source to the destination certificate.
This may be useful to copy from a CA certificate to issued ones.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_crt_deinit</h4>
<a name="gnutls_005fx509_005fcrt_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_crt_deinit</strong> <em>(gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: The data to be deinitialized
</p>
<p>This function will deinitialize a certificate structure.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fexport-1"></a>
<h4 class="subheading">gnutls_x509_crt_export</h4>
<a name="gnutls_005fx509_005fcrt_005fexport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fexport"></a>Function: <em>int</em> <strong>gnutls_x509_crt_export</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_x509_crt_fmt_t <var>format</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>cert</var>: Holds the certificate
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>output_data</var>: will contain a certificate PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will export the certificate to DER or PEM format.
</p>
<p>If the buffer provided is not long enough to hold the output, then
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
be returned.
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN CERTIFICATE&quot;.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fexport2-1"></a>
<h4 class="subheading">gnutls_x509_crt_export2</h4>
<a name="gnutls_005fx509_005fcrt_005fexport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fexport2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_export2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_x509_crt_fmt_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>cert</var>: Holds the certificate
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>out</var>: will contain a certificate PEM or DER encoded
</p>
<p>This function will export the certificate to DER or PEM format.
The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN CERTIFICATE&quot;.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p>
<p><strong>Since:</strong> 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005factivation_005ftime-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_activation_time</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005factivation_005ftime"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005factivation_005ftime"></a>Function: <em>time_t</em> <strong>gnutls_x509_crt_get_activation_time</strong> <em>(gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p>This function will return the time this Certificate was or will be
activated.
</p>
<p><strong>Returns:</strong> activation time, or (time_t)-1 on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005finfo_005faccess-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_authority_info_access</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005finfo_005faccess"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fauthority_005finfo_005faccess"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_authority_info_access</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>seq</var>, int <var>what</var>, gnutls_datum_t * <var>data</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>seq</var>: specifies the sequence number of the access descriptor (0 for the first one, 1 for the second etc.)
</p>
<p><var>what</var>: what data to get, a <code>gnutls_info_access_what_t</code>  type.
</p>
<p><var>data</var>: output data to be freed with <code>gnutls_free()</code> .
</p>
<p><var>critical</var>: pointer to output integer that is set to non-zero if the extension is marked as critical (may be <code>NULL</code> )
</p>
<p>Note that a simpler API to access the authority info data is provided
by <code>gnutls_x509_aia_get()</code>  and <code>gnutls_x509_ext_import_aia()</code> .
</p>
<p>This function extracts the Authority Information Access (AIA)
extension, see RFC 5280 section 4.2.2.1 for more information.  The
AIA extension holds a sequence of AccessDescription (AD) data.
</p>
<p>The  <code>seq</code> input parameter is used to indicate which member of the
sequence the caller is interested in.  The first member is 0, the
second member 1 and so on.  When the  <code>seq</code> value is out of bounds,
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p>The type of data returned in  <code>data</code> is specified via  <code>what</code> which
should be <code>gnutls_info_access_what_t</code>  values.
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_ACCESSMETHOD_OID</code>  then  <code>data</code> will hold the
accessMethod OID (e.g., &quot;1.3.6.1.5.5.7.48.1&quot;).
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_ACCESSLOCATION_GENERALNAME_TYPE</code> ,  <code>data</code> will
hold the accessLocation GeneralName type (e.g.,
&quot;uniformResourceIdentifier&quot;).
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_URI</code> ,  <code>data</code> will hold the accessLocation URI
data.  Requesting this  <code>what</code> value leads to an error if the
accessLocation is not of the &quot;uniformResourceIdentifier&quot; type. 
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_OCSP_URI</code> ,  <code>data</code> will hold the OCSP URI.
Requesting this  <code>what</code> value leads to an error if the accessMethod
is not 1.3.6.1.5.5.7.48.1 aka OSCP, or if accessLocation is not of
the &quot;uniformResourceIdentifier&quot; type. In that case <code>GNUTLS_E_UNKNOWN_ALGORITHM</code> 
will be returned, and  <code>seq</code> should be increased and this function
called again.
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_CAISSUERS_URI</code> ,  <code>data</code> will hold the caIssuers
URI.  Requesting this  <code>what</code> value leads to an error if the
accessMethod is not 1.3.6.1.5.5.7.48.2 aka caIssuers, or if
accessLocation is not of the &quot;uniformResourceIdentifier&quot; type.
In that case handle as in <code>GNUTLS_IA_OCSP_URI</code> .
</p>
<p>More  <code>what</code> values may be allocated in the future as needed.
</p>
<p>If  <code>data</code> is NULL, the function does the same without storing the
output data, that is, it will set  <code>critical</code> and do error checking
as usual.
</p>
<p>The value of the critical flag is returned in * <code>critical</code> .  Supply a
NULL  <code>critical</code> if you want the function to make sure the extension
is non-critical, as required by RFC 5280.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, <code>GNUTLS_E_INVALID_REQUEST</code>  on
invalid  <code>crt</code> , <code>GNUTLS_E_CONSTRAINT_ERROR</code>  if the extension is
incorrectly marked as critical (use a non-NULL  <code>critical</code> to
override), <code>GNUTLS_E_UNKNOWN_ALGORITHM</code>  if the requested OID does
not match (e.g., when using <code>GNUTLS_IA_OCSP_URI</code> ), otherwise a
negative error code.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fgn_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_authority_key_gn_serial</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fgn_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fgn_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_authority_key_gn_serial</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>alt</var>, size_t * <var>alt_size</var>, unsigned int * <var>alt_type</var>, void * <var>serial</var>, size_t * <var>serial_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>alt</var>: is the place where the alternative name will be copied to
</p>
<p><var>alt_size</var>: holds the size of alt.
</p>
<p><var>alt_type</var>: holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).
</p>
<p><var>serial</var>: buffer to store the serial number (may be null)
</p>
<p><var>serial_size</var>: Holds the size of the serial field (may be null)
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the X.509 authority key
identifier when stored as a general name (authorityCertIssuer) 
and serial number.
</p>
<p>Because more than one general names might be stored
 <code>seq</code> can be used as a counter to request them all until 
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_authority_key_id</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_authority_key_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, void * <var>id</var>, size_t * <var>id_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>id</var>: The place where the identifier will be copied
</p>
<p><var>id_size</var>: Holds the size of the id field.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the X.509v3 certificate authority&rsquo;s key
identifier.  This is obtained by the X.509 Authority Key
identifier extension field (2.5.29.35). Note that this function
only returns the keyIdentifier field of the extension and
<code>GNUTLS_E_X509_UNSUPPORTED_EXTENSION</code> , if the extension contains
the name and serial number of the certificate. In that case
<code>gnutls_x509_crt_get_authority_key_gn_serial()</code>  may be used.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_basic_constraints</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_basic_constraints</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int * <var>critical</var>, unsigned int * <var>ca</var>, int * <var>pathlen</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p><var>ca</var>: pointer to output integer indicating CA status, may be NULL,
value is 1 if the certificate CA flag is set, 0 otherwise.
</p>
<p><var>pathlen</var>: pointer to output integer indicating path length (may be
NULL), non-negative error codes indicate a present pathLenConstraint
field and the actual value, -1 indicate that the field is absent.
</p>
<p>This function will read the certificate&rsquo;s basic constraints, and
return the certificates CA status.  It reads the basicConstraints
X.509 extension (2.5.29.19).
</p>
<p><strong>Returns:</strong> If the certificate is a CA a positive value will be
returned, or (0) if the certificate does not have CA flag set.  A
negative error code may be returned in case of errors.  If the
certificate does not contain the basicConstraints extension
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fca_005fstatus-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_ca_status</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fca_005fstatus"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fca_005fstatus"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_ca_status</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return certificates CA status, by reading the
basicConstraints X.509 extension (2.5.29.19). If the certificate is
a CA a positive value will be returned, or (0) if the certificate
does not have CA flag set.
</p>
<p>Use <code>gnutls_x509_crt_get_basic_constraints()</code>  if you want to read the
pathLenConstraint field too.
</p>
<p><strong>Returns:</strong> If the certificate is a CA a positive value will be
returned, or (0) if the certificate does not have CA flag set.  A
negative error code may be returned in case of errors.  If the
certificate does not contain the basicConstraints extension
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fcrl_005fdist_005fpoints-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_crl_dist_points</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fcrl_005fdist_005fpoints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fcrl_005fdist_005fpoints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_crl_dist_points</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>san</var>, size_t * <var>san_size</var>, unsigned int * <var>reason_flags</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the distribution point (0 for the first one, 1 for the second etc.)
</p>
<p><var>san</var>: is the place where the distribution point will be copied to
</p>
<p><var>san_size</var>: holds the size of ret.
</p>
<p><var>reason_flags</var>: Revocation reasons. An ORed sequence of flags from <code>gnutls_x509_crl_reason_flags_t</code> .
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function retrieves the CRL distribution points (2.5.29.31),
contained in the given certificate in the X509v3 Certificate
Extensions.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  and updates  <code>ret_size</code> if
 <code>ret_size</code> is not enough to hold the distribution point, or the
type of the distribution point if everything was ok. The type is
one of the enumerated <code>gnutls_x509_subject_alt_name_t</code> .  If the
certificate does not have an Alternative name with the specified
sequence number then <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is
returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_dn</strong> <em>(gnutls_x509_crt_t <var>cert</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will copy the name of the Certificate in the provided
buffer. The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p>If  <code>buf</code> is null then only the size will be filled. 
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated
with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fdn2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_dn2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fdn2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fdn2-1"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_dn2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: a pointer to a structure to hold the name
</p>
<p>This function will allocate buffer and copy the name of the Certificate.
The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_dn_by_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>oid</var>, int <var>indx</var>, unsigned int <var>raw_flag</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the RDN, this specifies which to send. Use (0) to get the first one.
</p>
<p><var>raw_flag</var>: If non-zero returns the raw DER data of the DN part.
</p>
<p><var>buf</var>: a pointer where the DN part will be copied (may be null).
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will extract the part of the name of the Certificate
subject specified by the given OID. The output, if the raw flag is
not used, will be encoded as described in RFC4514. Thus a string
that is ASCII or UTF-8 encoded, depending on the certificate data.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
If raw flag is (0), this function will only return known OIDs as
text. Other OIDs will be DER encoded, as described in RFC4514 &ndash;
in hex format with a &rsquo;#&rsquo; prefix.  You can check about known OIDs
using <code>gnutls_x509_dn_oid_known()</code> .
</p>
<p>If  <code>buf</code> is null then only the size will be filled. If the  <code>raw_flag</code> is not specified the output is always null terminated, although the
 <code>buf_size</code> will not include the null character.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated with
the required size. <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  if there 
are no data in the current index. On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fdn_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_dn_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fdn_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fdn_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_dn_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>oid_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: This specifies which OID to return. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a buffer to hold the OID (may be null)
</p>
<p><var>oid_size</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will extract the OIDs of the name of the Certificate
subject specified by the given index.
</p>
<p>If  <code>oid</code> is null then only the size will be filled. The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated with
the required size. <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  if there 
are no data in the current index. On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fexpiration_005ftime-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_expiration_time</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fexpiration_005ftime"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fexpiration_005ftime"></a>Function: <em>time_t</em> <strong>gnutls_x509_crt_get_expiration_time</strong> <em>(gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p>This function will return the time this Certificate was or will be
expired.
</p>
<p>The no well defined expiration time can be checked against with the
<code>GNUTLS_X509_NO_WELL_DEFINED_EXPIRATION</code>  macro.
</p>
<p><strong>Returns:</strong> expiration time, or (time_t)-1 on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_by_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>oid</var>, int <var>indx</var>, void * <var>buf</var>, size_t * <var>buf_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the extensions, this specifies which to send. Use (0) to get the first one.
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return the extension specified by the OID in the
certificate.  The extensions will be returned as binary data DER
encoded, in the provided buffer.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned. If the certificate does not
contain the specified extension
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_by_oid2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005fby_005foid2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_by_oid2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>oid</var>, int <var>indx</var>, gnutls_datum_t * <var>output</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the extensions, this specifies which to send. Use (0) to get the first one.
</p>
<p><var>output</var>: will hold the allocated extension data
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return the extension specified by the OID in the
certificate.  The extensions will be returned as binary data DER
encoded, in the provided buffer.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned. If the certificate does not
contain the specified extension
GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE will be returned.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fdata-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_data</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fdata"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005fdata"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_data</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>data</var>, size_t * <var>sizeof_data</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send. Use (0) to get the first one.
</p>
<p><var>data</var>: a pointer to a structure to hold the data (may be null)
</p>
<p><var>sizeof_data</var>: initially holds the size of  <code>data</code> 
</p>
<p>This function will return the requested extension data in the
certificate.  The extension data will be stored in the
provided buffer.
</p>
<p>Use <code>gnutls_x509_crt_get_extension_info()</code>  to extract the OID and
critical flag.  Use <code>gnutls_x509_crt_get_extension_by_oid()</code>  instead,
if you want to get data indexed by the extension OID rather than
sequence.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fdata2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_data2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005fdata2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005fdata2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_data2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned <var>indx</var>, gnutls_datum_t * <var>data</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to read. Use (0) to get the first one.
</p>
<p><var>data</var>: will contain the extension DER-encoded data
</p>
<p>This function will return the requested by the index extension data in the
certificate.  The extension data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p>Use <code>gnutls_x509_crt_get_extension_info()</code>  to extract the OID.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005finfo-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_info</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005finfo"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005finfo"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_info</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>oid_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a structure to hold the OID
</p>
<p><var>oid_size</var>: initially holds the maximum size of  <code>oid</code> , on return
holds actual size of  <code>oid</code> .
</p>
<p><var>critical</var>: output variable with critical flag, may be NULL.
</p>
<p>This function will return the requested extension OID in the
certificate, and the critical flag for it.  The extension OID will
be stored as a string in the provided buffer.  Use
<code>gnutls_x509_crt_get_extension()</code>  to extract the data.
</p>
<p>If the buffer provided is not long enough to hold the output, then
 <code>oid_size</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will be
returned. The  <code>oid</code> returned will be null terminated, although 
 <code>oid_size</code> will not account for the trailing null.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_extension_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fextension_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fextension_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_extension_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>oid_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: Specifies which extension OID to send. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a structure to hold the OID (may be null)
</p>
<p><var>oid_size</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will return the requested extension OID in the certificate.
The extension OID will be stored as a string in the provided buffer.
</p>
<p>The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.  If you have reached the
last extension available <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
will be returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005ffingerprint-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_fingerprint</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005ffingerprint"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005ffingerprint"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_fingerprint</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_digest_algorithm_t <var>algo</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>algo</var>: is a digest algorithm
</p>
<p><var>buf</var>: a pointer to a structure to hold the fingerprint (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will calculate and copy the certificate&rsquo;s fingerprint
in the provided buffer. The fingerprint is a hash of the DER-encoded
data of the certificate.
</p>
<p>If the buffer is null then only the size will be filled.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the *buf_size will be updated
with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_x509_dn_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: output variable with pointer to uint8_t DN
</p>
<p>Return the Certificate&rsquo;s Issuer DN as a <code>gnutls_x509_dn_t</code>  data type,
that can be decoded using <code>gnutls_x509_dn_get_rdn_ava()</code> . 
</p>
<p>Note that  <code>dn</code> should be treated as constant. Because it points 
into the  <code>cert</code> object, you should not use  <code>dn</code> after  <code>cert</code> is
deallocated.
</p>
<p><strong>Returns:</strong> Returns 0 on success, or an error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_alt_name</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_alt_name</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>ian</var>, size_t * <var>ian_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>ian</var>: is the place where the alternative name will be copied to
</p>
<p><var>ian_size</var>: holds the size of ian.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function retrieves the Issuer Alternative Name (2.5.29.18),
contained in the given certificate in the X509v3 Certificate
Extensions.
</p>
<p>When the SAN type is otherName, it will extract the data in the
otherName&rsquo;s value field, and <code>GNUTLS_SAN_OTHERNAME</code>  is returned.
You may use <code>gnutls_x509_crt_get_subject_alt_othername_oid()</code>  to get
the corresponding OID and the &quot;virtual&quot; SAN types (e.g.,
<code>GNUTLS_SAN_OTHERNAME_XMPP</code> ).
</p>
<p>If an otherName OID is known, the data will be decoded.  Otherwise
the returned data will be DER encoded, and you will have to decode
it yourself.  Currently, only the RFC 3920 id-on-xmppAddr Issuer
AltName is recognized.
</p>
<p><strong>Returns:</strong> the alternative issuer name type on success, one of the
enumerated <code>gnutls_x509_subject_alt_name_t</code> .  It will return
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if  <code>ian_size</code> is not large enough
to hold the value.  In that case  <code>ian_size</code> will be updated with
the required size.  If the certificate does not have an
Alternative name with the specified sequence number then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Since:</strong> 2.10.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_alt_name2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fname2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_alt_name2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>ian</var>, size_t * <var>ian_size</var>, unsigned int * <var>ian_type</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>ian</var>: is the place where the alternative name will be copied to
</p>
<p><var>ian_size</var>: holds the size of ret.
</p>
<p><var>ian_type</var>: holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the alternative names, contained in the
given certificate. It is the same as
<code>gnutls_x509_crt_get_issuer_alt_name()</code>  except for the fact that it
will return the type of the alternative name in  <code>ian_type</code> even if
the function fails for some reason (i.e.  the buffer provided is
not enough).
</p>
<p><strong>Returns:</strong> the alternative issuer name type on success, one of the
enumerated <code>gnutls_x509_subject_alt_name_t</code> .  It will return
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if  <code>ian_size</code> is not large enough
to hold the value.  In that case  <code>ian_size</code> will be updated with
the required size.  If the certificate does not have an
Alternative name with the specified sequence number then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Since:</strong> 2.10.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fothername_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_alt_othername_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fothername_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005falt_005fothername_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_alt_othername_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>ret</var>, size_t * <var>ret_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>ret</var>: is the place where the otherName OID will be copied to
</p>
<p><var>ret_size</var>: holds the size of ret.
</p>
<p>This function will extract the type OID of an otherName Subject
Alternative Name, contained in the given certificate, and return
the type as an enumerated element.
</p>
<p>If  <code>oid</code> is null then only the size will be filled. The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p>This function is only useful if
<code>gnutls_x509_crt_get_issuer_alt_name()</code>  returned
<code>GNUTLS_SAN_OTHERNAME</code> .
</p>
<p><strong>Returns:</strong> the alternative issuer name type on success, one of the
enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs, it
will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
e.g. <code>GNUTLS_SAN_OTHERNAME_XMPP</code> , and <code>GNUTLS_SAN_OTHERNAME</code>  for
unknown OIDs.  It will return <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if
 <code>ret_size</code> is not large enough to hold the value.  In that case
 <code>ret_size</code> will be updated with the required size.  If the
certificate does not have an Alternative name with the specified
sequence number and with the otherName type then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p>
<p><strong>Since:</strong> 2.10.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_dn</strong> <em>(gnutls_x509_crt_t <var>cert</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will copy the name of the Certificate issuer in the
provided buffer. The name will be in the form
&quot;C=xxxx,O=yyyy,CN=zzzz&quot; as described in RFC4514. The output string
will be ASCII or UTF-8 encoded, depending on the certificate data.
</p>
<p>If  <code>buf</code> is null then only the size will be filled. 
</p>
<p><strong>Returns:</strong> GNUTLS_E_SHORT_MEMORY_BUFFER if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated with
the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_dn2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_dn2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: a pointer to a structure to hold the name
</p>
<p>This function will allocate buffer and copy the name of issuer of the Certificate.
The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_dn_by_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const char * <var>oid</var>, int <var>indx</var>, unsigned int <var>raw_flag</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the RDN, this specifies which to send. Use (0) to get the first one.
</p>
<p><var>raw_flag</var>: If non-zero returns the raw DER data of the DN part.
</p>
<p><var>buf</var>: a pointer to a structure to hold the name (may be null)
</p>
<p><var>buf_size</var>: initially holds the size of  <code>buf</code> 
</p>
<p>This function will extract the part of the name of the Certificate
issuer specified by the given OID. The output, if the raw flag is not
used, will be encoded as described in RFC4514. Thus a string that is
ASCII or UTF-8 encoded, depending on the certificate data.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
If raw flag is (0), this function will only return known OIDs as
text. Other OIDs will be DER encoded, as described in RFC4514 &ndash;
in hex format with a &rsquo;#&rsquo; prefix.  You can check about known OIDs
using <code>gnutls_x509_dn_oid_known()</code> .
</p>
<p>If  <code>buf</code> is null then only the size will be filled. If the  <code>raw_flag</code> is not specified the output is always null terminated, although the
 <code>buf_size</code> will not include the null character.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated with
the required size. <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  if there 
are no data in the current index. On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_dn_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005fdn_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_dn_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>oid_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: This specifies which OID to return. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a buffer to hold the OID (may be null)
</p>
<p><var>oid_size</var>: initially holds the size of  <code>oid</code> 
</p>
<p>This function will extract the OIDs of the name of the Certificate
issuer specified by the given index.
</p>
<p>If  <code>oid</code> is null then only the size will be filled. The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is not
long enough, and in that case the  <code>buf_size</code> will be updated with
the required size. <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  if there 
are no data in the current index. On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005funique_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_issuer_unique_id</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fissuer_005funique_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fissuer_005funique_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_issuer_unique_id</strong> <em>(gnutls_x509_crt_t <var>crt</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>buf</var>: user allocated memory buffer, will hold the unique id
</p>
<p><var>buf_size</var>: size of user allocated memory buffer (on input), will hold
actual size of the unique ID on return.
</p>
<p>This function will extract the issuerUniqueID value (if present) for
the given certificate.
</p>
<p>If the user allocated memory buffer is not large enough to hold the
full subjectUniqueID, then a GNUTLS_E_SHORT_MEMORY_BUFFER error will be
returned, and buf_size will be set to the actual length.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
</p>
<p><strong>Since:</strong> 2.12.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_key_id</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fkey_005fid-1"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_key_id</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>flags</var>, unsigned char * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>flags</var>: should be one of the flags from <code>gnutls_keyid_flags_t</code> 
</p>
<p><var>output_data</var>: will contain the key ID
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will return a unique ID that depends on the public
key parameters. This ID can be used in checking whether a
certificate corresponds to the given private key.
</p>
<p>If the buffer provided is not long enough to hold the output, then
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
be returned.  The output will normally be a SHA-1 hash output,
which is 20 bytes.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fpurpose_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_key_purpose_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fpurpose_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fkey_005fpurpose_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_key_purpose_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, int <var>indx</var>, void * <var>oid</var>, size_t * <var>oid_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: This specifies which OID to return. Use (0) to get the first one.
</p>
<p><var>oid</var>: a pointer to a buffer to hold the OID (may be null)
</p>
<p><var>oid_size</var>: initially holds the size of  <code>oid</code> 
</p>
<p><var>critical</var>: output flag to indicate criticality of extension
</p>
<p>This function will extract the key purpose OIDs of the Certificate
specified by the given index.  These are stored in the Extended Key
Usage extension (2.5.29.37) See the GNUTLS_KP_* definitions for
human readable names.
</p>
<p>If  <code>oid</code> is null then only the size will be filled. The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if the provided buffer is
not long enough, and in that case the *oid_size will be updated
with the required size.  On success 0 is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_key_usage</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_key_usage</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int * <var>key_usage</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>key_usage</var>: where the key usage bits will be stored
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will return certificate&rsquo;s key usage, by reading the
keyUsage X.509 extension (2.5.29.15). The key usage value will ORed
values of the: <code>GNUTLS_KEY_DIGITAL_SIGNATURE</code> ,
<code>GNUTLS_KEY_NON_REPUDIATION</code> , <code>GNUTLS_KEY_KEY_ENCIPHERMENT</code> ,
<code>GNUTLS_KEY_DATA_ENCIPHERMENT</code> , <code>GNUTLS_KEY_KEY_AGREEMENT</code> ,
<code>GNUTLS_KEY_KEY_CERT_SIGN</code> , <code>GNUTLS_KEY_CRL_SIGN</code> ,
<code>GNUTLS_KEY_ENCIPHER_ONLY</code> , <code>GNUTLS_KEY_DECIPHER_ONLY</code> .
</p>
<p><strong>Returns:</strong> the certificate key usage, or a negative error code in case of
parsing error.  If the certificate does not contain the keyUsage
extension <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be
returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fname_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_name_constraints</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fname_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fname_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_name_constraints</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_name_constraints_t <var>nc</var>, unsigned int <var>flags</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>nc</var>: The nameconstraints intermediate type
</p>
<p><var>flags</var>: zero or <code>GNUTLS_NAME_CONSTRAINTS_FLAG_APPEND</code> 
</p>
<p><var>critical</var>: the extension status
</p>
<p>This function will return an intermediate type containing
the name constraints of the provided CA certificate. That
structure can be used in combination with <code>gnutls_x509_name_constraints_check()</code> 
to verify whether a server&rsquo;s name is in accordance with the constraints.
</p>
<p>When the  <code>flags</code> is set to <code>GNUTLS_NAME_CONSTRAINTS_FLAG_APPEND</code> , then if 
the  <code>nc</code> structure is empty
this function will behave identically as if the flag was not set.
Otherwise if there are elements in the  <code>nc</code> structure then only the
excluded constraints will be appended to the constraints.
</p>
<p>Note that  <code>nc</code> must be initialized prior to calling this function.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_pk_algorithm</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fpk_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_pk_algorithm</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int * <var>bits</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>bits</var>: if bits is non null it will hold the size of the parameters&rsquo; in bits
</p>
<p>This function will return the public key algorithm of an X.509
certificate.
</p>
<p>If bits is non null, it should have enough size to hold the parameters
size in bits. For RSA the bits returned is the modulus.
For DSA the bits returned are of the public
exponent.
</p>
<p><strong>Returns:</strong> a member of the <code>gnutls_pk_algorithm_t</code>  enumeration on
success, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005fdsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_pk_dsa_raw</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005fdsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fpk_005fdsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_pk_dsa_raw</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_datum_t * <var>p</var>, gnutls_datum_t * <var>q</var>, gnutls_datum_t * <var>g</var>, gnutls_datum_t * <var>y</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>p</var>: will hold the p
</p>
<p><var>q</var>: will hold the q
</p>
<p><var>g</var>: will hold the g
</p>
<p><var>y</var>: will hold the y
</p>
<p>This function will export the DSA public key&rsquo;s parameters found in
the given certificate.  The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005fecc_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_pk_ecc_raw</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005fecc_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fpk_005fecc_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_pk_ecc_raw</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_ecc_curve_t * <var>curve</var>, gnutls_datum_t * <var>x</var>, gnutls_datum_t * <var>y</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>curve</var>: will hold the curve
</p>
<p><var>x</var>: will hold x
</p>
<p><var>y</var>: will hold y
</p>
<p>This function will export the ECC public key&rsquo;s parameters found in
the given certificate.  The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
</p>
<p><strong>Since:</strong> 3.4.1
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005frsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_pk_rsa_raw</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fpk_005frsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fpk_005frsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_pk_rsa_raw</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_datum_t * <var>m</var>, gnutls_datum_t * <var>e</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>m</var>: will hold the modulus
</p>
<p><var>e</var>: will hold the public exponent
</p>
<p>This function will export the RSA public key&rsquo;s parameters found in
the given structure.  The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fpolicy-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_policy</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fpolicy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fpolicy"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_policy</strong> <em>(gnutls_x509_crt_t <var>crt</var>, int <var>indx</var>, struct gnutls_x509_policy_st * <var>policy</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>indx</var>: This specifies which policy to return. Use (0) to get the first one.
</p>
<p><var>policy</var>: A pointer to a policy structure.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p>This function will extract the certificate policy (extension 2.5.29.32) 
specified by the given index. 
</p>
<p>The policy returned by this function must be deinitialized by using
<code>gnutls_x509_policy_release()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.1.5
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_private_key_usage_period</strong> <em>(gnutls_x509_crt_t <var>cert</var>, time_t * <var>activation</var>, time_t * <var>expiration</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>activation</var>: The activation time
</p>
<p><var>expiration</var>: The expiration time
</p>
<p><var>critical</var>: the extension status
</p>
<p>This function will return the expiration and activation
times of the private key of the certificate. It relies on
the PKIX extension 2.5.29.16 being present.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fproxy-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_proxy</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fproxy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fproxy"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_proxy</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int * <var>critical</var>, int * <var>pathlen</var>, char ** <var>policyLanguage</var>, char ** <var>policy</var>, size_t * <var>sizeof_policy</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical
</p>
<p><var>pathlen</var>: pointer to output integer indicating path length (may be
NULL), non-negative error codes indicate a present pCPathLenConstraint
field and the actual value, -1 indicate that the field is absent.
</p>
<p><var>policyLanguage</var>: output variable with OID of policy language
</p>
<p><var>policy</var>: output variable with policy data
</p>
<p><var>sizeof_policy</var>: output variable size of policy data
</p>
<p>This function will get information from a proxy certificate.  It
reads the ProxyCertInfo X.509 extension (1.3.6.1.5.5.7.1.14).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fraw_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_raw_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fraw_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fraw_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_raw_dn</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: will hold the starting point of the DN
</p>
<p>This function will return a pointer to the DER encoded DN structure and
the length. This points to allocated data that must be free&rsquo;d using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value. or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fraw_005fissuer_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_raw_issuer_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fraw_005fissuer_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fraw_005fissuer_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_raw_issuer_dn</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_datum_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: will hold the starting point of the DN
</p>
<p>This function will return a pointer to the DER encoded DN structure
and the length. This points to allocated data that must be free&rsquo;d using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_serial</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_serial</strong> <em>(gnutls_x509_crt_t <var>cert</var>, void * <var>result</var>, size_t * <var>result_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>result</var>: The place where the serial number will be copied
</p>
<p><var>result_size</var>: Holds the size of the result field.
</p>
<p>This function will return the X.509 certificate&rsquo;s serial number.
This is obtained by the X509 Certificate serialNumber field. Serial
is not always a 32 or 64bit number. Some CAs use large serial
numbers, thus it may be wise to handle it as something uint8_t.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsignature-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_signature</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsignature"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsignature"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_signature</strong> <em>(gnutls_x509_crt_t <var>cert</var>, char * <var>sig</var>, size_t * <var>sig_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>sig</var>: a pointer where the signature part will be copied (may be null).
</p>
<p><var>sig_size</var>: initially holds the size of  <code>sig</code> 
</p>
<p>This function will extract the signature field of a certificate.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsignature_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_signature_algorithm</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsignature_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsignature_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_signature_algorithm</strong> <em>(gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p>This function will return a value of the <code>gnutls_sign_algorithm_t</code> 
enumeration that is the signature algorithm that has been used to
sign this certificate.
</p>
<p><strong>Returns:</strong> a <code>gnutls_sign_algorithm_t</code>  value, or a negative error code on
error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_x509_dn_t * <var>dn</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>dn</var>: output variable with pointer to uint8_t DN.
</p>
<p>Return the Certificate&rsquo;s Subject DN as a <code>gnutls_x509_dn_t</code>  data type,
that can be decoded using <code>gnutls_x509_dn_get_rdn_ava()</code> . 
</p>
<p>Note that  <code>dn</code> should be treated as constant. Because it points 
into the  <code>cert</code> object, you should not use  <code>dn</code> after  <code>cert</code> is
deallocated.
</p>
<p><strong>Returns:</strong> Returns 0 on success, or an error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject_alt_name</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject_alt_name</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>san</var>, size_t * <var>san_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>san</var>: is the place where the alternative name will be copied to
</p>
<p><var>san_size</var>: holds the size of san.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function retrieves the Alternative Name (2.5.29.17), contained
in the given certificate in the X509v3 Certificate Extensions.
</p>
<p>When the SAN type is otherName, it will extract the data in the
otherName&rsquo;s value field, and <code>GNUTLS_SAN_OTHERNAME</code>  is returned.
You may use <code>gnutls_x509_crt_get_subject_alt_othername_oid()</code>  to get
the corresponding OID and the &quot;virtual&quot; SAN types (e.g.,
<code>GNUTLS_SAN_OTHERNAME_XMPP</code> ).
</p>
<p>If an otherName OID is known, the data will be decoded.  Otherwise
the returned data will be DER encoded, and you will have to decode
it yourself.  Currently, only the RFC 3920 id-on-xmppAddr SAN is
recognized.
</p>
<p><strong>Returns:</strong> the alternative subject name type on success, one of the
enumerated <code>gnutls_x509_subject_alt_name_t</code> .  It will return
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if  <code>san_size</code> is not large enough to
hold the value.  In that case  <code>san_size</code> will be updated with the
required size.  If the certificate does not have an Alternative
name with the specified sequence number then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname2-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject_alt_name2</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fname2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject_alt_name2</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>san</var>, size_t * <var>san_size</var>, unsigned int * <var>san_type</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>san</var>: is the place where the alternative name will be copied to
</p>
<p><var>san_size</var>: holds the size of ret.
</p>
<p><var>san_type</var>: holds the type of the alternative name (one of gnutls_x509_subject_alt_name_t).
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the alternative names, contained in the
given certificate. It is the same as
<code>gnutls_x509_crt_get_subject_alt_name()</code>  except for the fact that it
will return the type of the alternative name in  <code>san_type</code> even if
the function fails for some reason (i.e.  the buffer provided is
not enough).
</p>
<p><strong>Returns:</strong> the alternative subject name type on success, one of the
enumerated <code>gnutls_x509_subject_alt_name_t</code> .  It will return
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if  <code>san_size</code> is not large enough
to hold the value.  In that case  <code>san_size</code> will be updated with
the required size.  If the certificate does not have an
Alternative name with the specified sequence number then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fothername_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject_alt_othername_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fothername_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject_005falt_005fothername_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject_alt_othername_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, unsigned int <var>seq</var>, void * <var>oid</var>, size_t * <var>oid_size</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>seq</var>: specifies the sequence number of the alt name (0 for the first one, 1 for the second etc.)
</p>
<p><var>oid</var>: is the place where the otherName OID will be copied to
</p>
<p><var>oid_size</var>: holds the size of ret.
</p>
<p>This function will extract the type OID of an otherName Subject
Alternative Name, contained in the given certificate, and return
the type as an enumerated element.
</p>
<p>This function is only useful if
<code>gnutls_x509_crt_get_subject_alt_name()</code>  returned
<code>GNUTLS_SAN_OTHERNAME</code> .
</p>
<p>If  <code>oid</code> is null then only the size will be filled. The  <code>oid</code> returned will be null terminated, although  <code>oid_size</code> will not
account for the trailing null.
</p>
<p><strong>Returns:</strong> the alternative subject name type on success, one of the
enumerated gnutls_x509_subject_alt_name_t.  For supported OIDs, it
will return one of the virtual (GNUTLS_SAN_OTHERNAME_*) types,
e.g. <code>GNUTLS_SAN_OTHERNAME_XMPP</code> , and <code>GNUTLS_SAN_OTHERNAME</code>  for
unknown OIDs.  It will return <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  if
 <code>ian_size</code> is not large enough to hold the value.  In that case
 <code>ian_size</code> will be updated with the required size.  If the
certificate does not have an Alternative name with the specified
sequence number and with the otherName type then
<code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject_key_id</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject_key_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, void * <var>ret</var>, size_t * <var>ret_size</var>, unsigned int * <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>ret</var>: The place where the identifier will be copied
</p>
<p><var>ret_size</var>: Holds the size of the result field.
</p>
<p><var>critical</var>: will be non-zero if the extension is marked as critical (may be null)
</p>
<p>This function will return the X.509v3 certificate&rsquo;s subject key
identifier.  This is obtained by the X.509 Subject Key identifier
extension field (2.5.29.14).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005funique_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_subject_unique_id</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fsubject_005funique_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fsubject_005funique_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_subject_unique_id</strong> <em>(gnutls_x509_crt_t <var>crt</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>buf</var>: user allocated memory buffer, will hold the unique id
</p>
<p><var>buf_size</var>: size of user allocated memory buffer (on input), will hold
actual size of the unique ID on return.
</p>
<p>This function will extract the subjectUniqueID value (if present) for
the given certificate.
</p>
<p>If the user allocated memory buffer is not large enough to hold the
full subjectUniqueID, then a GNUTLS_E_SHORT_MEMORY_BUFFER error will be
returned, and buf_size will be set to the actual length.
</p>
<p><strong>Returns:</strong> <code>GNUTLS_E_SUCCESS</code>  on success, otherwise a negative error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fget_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crt_get_version</h4>
<a name="gnutls_005fx509_005fcrt_005fget_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fget_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crt_get_version</strong> <em>(gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p>This function will return the version of the specified Certificate.
</p>
<p><strong>Returns:</strong> version of certificate, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_crt_import</h4>
<a name="gnutls_005fx509_005fcrt_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_crt_import</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>)</em></dt>
<dd><p><var>cert</var>: The data to store the parsed certificate.
</p>
<p><var>data</var>: The DER or PEM encoded certificate.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p>This function will convert the given DER or PEM encoded Certificate
to the native gnutls_x509_crt_t format. The output will be stored
in  <code>cert</code> .
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;X509
CERTIFICATE&quot;, or &quot;CERTIFICATE&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fimport_005furl-1"></a>
<h4 class="subheading">gnutls_x509_crt_import_url</h4>
<a name="gnutls_005fx509_005fcrt_005fimport_005furl"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fimport_005furl"></a>Function: <em>int</em> <strong>gnutls_x509_crt_import_url</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>url</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crt</var>: A certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>url</var>: A PKCS 11 url
</p>
<p><var>flags</var>: One of GNUTLS_PKCS11_OBJ_* flags
</p>
<p>This function will import a PKCS 11 certificate directly from a token
without involving the <code>gnutls_pkcs11_obj_t</code>  type. This function will
fail if the certificate stored is not of X.509 type.
</p>
<p>Despite its name this function will attempt to import any kind of 
URL to certificate. In previous versions of gnutls this function
was named gnutls_x509_crt_import_pkcs11_url, and the old name is
an alias to this one.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005finit-1"></a>
<h4 class="subheading">gnutls_x509_crt_init</h4>
<a name="gnutls_005fx509_005fcrt_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_crt_init</strong> <em>(gnutls_x509_crt_t * <var>cert</var>)</em></dt>
<dd><p><var>cert</var>: A pointer to the type to be initialized
</p>
<p>This function will initialize an X.509 certificate structure.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005flist_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_crt_list_import</h4>
<a name="gnutls_005fx509_005fcrt_005flist_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005flist_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_crt_list_import</strong> <em>(gnutls_x509_crt_t * <var>certs</var>, unsigned int * <var>cert_max</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>certs</var>: Indicates where the parsed list will be copied to. Must not be initialized.
</p>
<p><var>cert_max</var>: Initially must hold the maximum number of certs. It will be updated with the number of certs available.
</p>
<p><var>data</var>: The PEM encoded certificate.
</p>
<p><var>format</var>: One of DER or PEM.
</p>
<p><var>flags</var>: must be (0) or an OR&rsquo;d sequence of gnutls_certificate_import_flags.
</p>
<p>This function will convert the given PEM encoded certificate list
to the native gnutls_x509_crt_t format. The output will be stored
in  <code>certs</code> .  They will be automatically initialized.
</p>
<p>The flag <code>GNUTLS_X509_CRT_LIST_IMPORT_FAIL_IF_EXCEED</code>  will cause
import to fail if the certificates in the provided buffer are more
than the available structures. The <code>GNUTLS_X509_CRT_LIST_FAIL_IF_UNSORTED</code> 
flag will cause the function to fail if the provided list is not
sorted from subject to issuer.
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;X509
CERTIFICATE&quot;, or &quot;CERTIFICATE&quot;.
</p>
<p><strong>Returns:</strong> the number of certificates read or a negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005flist_005fimport2-1"></a>
<h4 class="subheading">gnutls_x509_crt_list_import2</h4>
<a name="gnutls_005fx509_005fcrt_005flist_005fimport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005flist_005fimport2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_list_import2</strong> <em>(gnutls_x509_crt_t ** <var>certs</var>, unsigned int * <var>size</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>certs</var>: Will hold the parsed certificate list.
</p>
<p><var>size</var>: It will contain the size of the list.
</p>
<p><var>data</var>: The PEM encoded certificate.
</p>
<p><var>format</var>: One of DER or PEM.
</p>
<p><var>flags</var>: must be (0) or an OR&rsquo;d sequence of gnutls_certificate_import_flags.
</p>
<p>This function will convert the given PEM encoded certificate list
to the native gnutls_x509_crt_t format. The output will be stored
in  <code>certs</code> which will allocated and initialized.
</p>
<p>If the Certificate is PEM encoded it should have a header of &quot;X509
CERTIFICATE&quot;, or &quot;CERTIFICATE&quot;.
</p>
<p>To deinitialize  <code>certs</code> , you need to deinitialize each crt structure
independently, and use <code>gnutls_free()</code>  at
</p>
<p><strong>Returns:</strong> the number of certificates read or a negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005flist_005fverify-1"></a>
<h4 class="subheading">gnutls_x509_crt_list_verify</h4>
<a name="gnutls_005fx509_005fcrt_005flist_005fverify"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005flist_005fverify"></a>Function: <em>int</em> <strong>gnutls_x509_crt_list_verify</strong> <em>(const gnutls_x509_crt_t * <var>cert_list</var>, int <var>cert_list_length</var>, const gnutls_x509_crt_t * <var>CA_list</var>, int <var>CA_list_length</var>, const gnutls_x509_crl_t * <var>CRL_list</var>, int <var>CRL_list_length</var>, unsigned int <var>flags</var>, unsigned int * <var>verify</var>)</em></dt>
<dd><p><var>cert_list</var>: is the certificate list to be verified
</p>
<p><var>cert_list_length</var>: holds the number of certificate in cert_list
</p>
<p><var>CA_list</var>: is the CA list which will be used in verification
</p>
<p><var>CA_list_length</var>: holds the number of CA certificate in CA_list
</p>
<p><var>CRL_list</var>: holds a list of CRLs.
</p>
<p><var>CRL_list_length</var>: the length of CRL list.
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>verify</var>: will hold the certificate verification output.
</p>

<p>This function will try to verify the given certificate list and
return its status. The details of the verification are the same
as in <code>gnutls_x509_trust_list_verify_crt2()</code> .
</p>
<p>You must check the peer&rsquo;s name in order to check if the verified
certificate belongs to the actual peer.
</p>
<p>The certificate verification output will be put in  <code>verify</code> and will
be one or more of the gnutls_certificate_status_t enumerated
elements bitwise or&rsquo;d.  For a more detailed verification status use
<code>gnutls_x509_crt_verify()</code>  per list element.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fprint-1"></a>
<h4 class="subheading">gnutls_x509_crt_print</h4>
<a name="gnutls_005fx509_005fcrt_005fprint"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fprint"></a>Function: <em>int</em> <strong>gnutls_x509_crt_print</strong> <em>(gnutls_x509_crt_t <var>cert</var>, gnutls_certificate_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>cert</var>: The data to be printed
</p>
<p><var>format</var>: Indicate the format to use
</p>
<p><var>out</var>: Newly allocated datum with null terminated string.
</p>
<p>This function will pretty print a X.509 certificate, suitable for
display to a human.
</p>
<p>If the format is <code>GNUTLS_CRT_PRINT_FULL</code>  then all fields of the
certificate will be output, on multiple lines.  The
<code>GNUTLS_CRT_PRINT_ONELINE</code>  format will generate one line with some
selected fields, which is useful for logging purposes.
</p>
<p>The output  <code>out</code> needs to be deallocated using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005factivation_005ftime-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_activation_time</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005factivation_005ftime"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005factivation_005ftime"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_activation_time</strong> <em>(gnutls_x509_crt_t <var>cert</var>, time_t <var>act_time</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>act_time</var>: The actual time
</p>
<p>This function will set the time this Certificate was or will be
activated.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fauthority_005finfo_005faccess-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_authority_info_access</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fauthority_005finfo_005faccess"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fauthority_005finfo_005faccess"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_authority_info_access</strong> <em>(gnutls_x509_crt_t <var>crt</var>, int <var>what</var>, gnutls_datum_t * <var>data</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate
</p>
<p><var>what</var>: what data to get, a <code>gnutls_info_access_what_t</code>  type.
</p>
<p><var>data</var>: output data to be freed with <code>gnutls_free()</code> .
</p>
<p>This function sets the Authority Information Access (AIA)
extension, see RFC 5280 section 4.2.2.1 for more information.  
</p>
<p>The type of data stored in  <code>data</code> is specified via  <code>what</code> which
should be <code>gnutls_info_access_what_t</code>  values.
</p>
<p>If  <code>what</code> is <code>GNUTLS_IA_OCSP_URI</code> ,  <code>data</code> will hold the OCSP URI.
If  <code>what</code> is <code>GNUTLS_IA_CAISSUERS_URI</code> ,  <code>data</code> will hold the caIssuers
URI.  
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_authority_key_id</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_authority_key_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>id</var>, size_t <var>id_size</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>id</var>: The key ID
</p>
<p><var>id_size</var>: Holds the size of the key ID field.
</p>
<p>This function will set the X.509 certificate&rsquo;s authority key ID extension.
Only the keyIdentifier field can be set with this function.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_basic_constraints</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_basic_constraints</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>ca</var>, int <var>pathLenConstraint</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>ca</var>: true(1) or false(0). Depending on the Certificate authority status.
</p>
<p><var>pathLenConstraint</var>: non-negative error codes indicate maximum length of path,
and negative error codes indicate that the pathLenConstraints field should
not be present.
</p>
<p>This function will set the basicConstraints certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fca_005fstatus-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_ca_status</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fca_005fstatus"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fca_005fstatus"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_ca_status</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>ca</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>ca</var>: true(1) or false(0). Depending on the Certificate authority status.
</p>
<p>This function will set the basicConstraints certificate extension.
Use <code>gnutls_x509_crt_set_basic_constraints()</code>  if you want to control
the pathLenConstraint field too.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_crl_dist_points</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_crl_dist_points</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const void * <var>data_string</var>, unsigned int <var>reason_flags</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>type</var>: is one of the gnutls_x509_subject_alt_name_t enumerations
</p>
<p><var>data_string</var>: The data to be set
</p>
<p><var>reason_flags</var>: revocation reasons
</p>
<p>This function will set the CRL distribution points certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints2-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_crl_dist_points2</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fcrl_005fdist_005fpoints2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_crl_dist_points2</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const void * <var>data</var>, unsigned int <var>data_size</var>, unsigned int <var>reason_flags</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>type</var>: is one of the gnutls_x509_subject_alt_name_t enumerations
</p>
<p><var>data</var>: The data to be set
</p>
<p><var>data_size</var>: The data size
</p>
<p><var>reason_flags</var>: revocation reasons
</p>
<p>This function will set the CRL distribution points certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.6.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fcrq-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_crq</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fcrq"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fcrq"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_crq</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_crq_t <var>crq</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>crq</var>: holds a certificate request
</p>
<p>This function will set the name and public parameters as well as
the extensions from the given certificate request to the certificate. 
Only RSA keys are currently supported.
</p>
<p>Note that this function will only set the  <code>crq</code> if it is self
signed and the signature is correct. See <code>gnutls_x509_crq_sign2()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fcrq_005fextensions-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_crq_extensions</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fcrq_005fextensions"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fcrq_005fextensions"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_crq_extensions</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_crq_t <var>crq</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>crq</var>: holds a certificate request
</p>
<p>This function will set extensions from the given request to the
certificate.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.8.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_dn</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>dn</var>, const char ** <var>err</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>dn</var>: a comma separated DN string (RFC4514)
</p>
<p><var>err</var>: indicates the error position (if any)
</p>
<p>This function will set the DN on the provided certificate.
The input string should be plain ASCII or UTF-8 encoded.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_dn_by_oid</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>oid</var>, unsigned int <var>raw_flag</var>, const void * <var>name</var>, unsigned int <var>sizeof_name</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>raw_flag</var>: must be 0, or 1 if the data are DER encoded
</p>
<p><var>name</var>: a pointer to the name
</p>
<p><var>sizeof_name</var>: holds the size of  <code>name</code> 
</p>
<p>This function will set the part of the name of the Certificate
subject, specified by the given OID. The input string should be
ASCII or UTF-8 encoded.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
With this function you can only set the known OIDs. You can test
for known OIDs using <code>gnutls_x509_dn_oid_known()</code> . For OIDs that are
not known (by gnutls) you should properly DER encode your data,
and call this function with  <code>raw_flag</code> set.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fexpiration_005ftime-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_expiration_time</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fexpiration_005ftime"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fexpiration_005ftime"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_expiration_time</strong> <em>(gnutls_x509_crt_t <var>cert</var>, time_t <var>exp_time</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>exp_time</var>: The actual time
</p>
<p>This function will set the time this Certificate will expire.
Setting an expiration time to (time_t)-1 or to <code>GNUTLS_X509_NO_WELL_DEFINED_EXPIRATION</code> 
will set to the no well-defined expiration date value. 
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fextension_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_extension_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fextension_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fextension_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_extension_by_oid</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>oid</var>, const void * <var>buf</var>, size_t <var>sizeof_buf</var>, unsigned int <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>oid</var>: holds an Object Identified in null terminated string
</p>
<p><var>buf</var>: a pointer to a DER encoded data
</p>
<p><var>sizeof_buf</var>: holds the size of  <code>buf</code> 
</p>
<p><var>critical</var>: should be non-zero if the extension is to be marked as critical
</p>
<p>This function will set an the extension, by the specified OID, in
the certificate.  The extension data should be binary data DER
encoded.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_issuer_alt_name</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fissuer_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_issuer_alt_name</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const void * <var>data</var>, unsigned int <var>data_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>type</var>: is one of the gnutls_x509_subject_alt_name_t enumerations
</p>
<p><var>data</var>: The data to be set
</p>
<p><var>data_size</var>: The size of data to be set
</p>
<p><var>flags</var>: GNUTLS_FSAN_SET to clear previous data or GNUTLS_FSAN_APPEND to append. 
</p>
<p>This function will set the issuer alternative name certificate
extension. It can set the same types as <code>gnutls_x509_crt_set_subject_alt_name()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_issuer_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_issuer_dn</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>dn</var>, const char ** <var>err</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>dn</var>: a comma separated DN string (RFC4514)
</p>
<p><var>err</var>: indicates the error position (if any)
</p>
<p>This function will set the DN on the provided certificate.
The input string should be plain ASCII or UTF-8 encoded.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_issuer_dn_by_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fissuer_005fdn_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_issuer_dn_by_oid</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const char * <var>oid</var>, unsigned int <var>raw_flag</var>, const void * <var>name</var>, unsigned int <var>sizeof_name</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>raw_flag</var>: must be 0, or 1 if the data are DER encoded
</p>
<p><var>name</var>: a pointer to the name
</p>
<p><var>sizeof_name</var>: holds the size of  <code>name</code> 
</p>
<p>This function will set the part of the name of the Certificate
issuer, specified by the given OID.  The input string should be
ASCII or UTF-8 encoded.
</p>
<p>Some helper macros with popular OIDs can be found in gnutls/x509.h
With this function you can only set the known OIDs. You can test
for known OIDs using <code>gnutls_x509_dn_oid_known()</code> . For OIDs that are
not known (by gnutls) you should properly DER encode your data,
and call this function with  <code>raw_flag</code> set.
</p>
<p>Normally you do not need to call this function, since the signing
operation will copy the signer&rsquo;s name as the issuer of the
certificate.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005funique_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_issuer_unique_id</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fissuer_005funique_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fissuer_005funique_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_issuer_unique_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>id</var>, size_t <var>id_size</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>id</var>: The unique ID
</p>
<p><var>id_size</var>: Holds the size of the unique ID.
</p>
<p>This function will set the X.509 certificate&rsquo;s issuer unique ID field.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.7
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fkey-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_key</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fkey"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fkey"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_key</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>key</var>: holds a private key
</p>
<p>This function will set the public parameters from the given
private key to the certificate. Only RSA keys are currently
supported.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fkey_005fpurpose_005foid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_key_purpose_oid</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fkey_005fpurpose_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fkey_005fpurpose_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_key_purpose_oid</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>oid</var>, unsigned int <var>critical</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>oid</var>: a pointer to a null terminated string that holds the OID
</p>
<p><var>critical</var>: Whether this extension will be critical or not
</p>
<p>This function will set the key purpose OIDs of the Certificate.
These are stored in the Extended Key Usage extension (2.5.29.37)
See the GNUTLS_KP_* definitions for human readable names.
</p>
<p>Subsequent calls to this function will append OIDs to the OID list.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned,
otherwise a negative error code is returned.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_key_usage</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_key_usage</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>usage</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>usage</var>: an ORed sequence of the GNUTLS_KEY_* elements.
</p>
<p>This function will set the keyUsage certificate extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fname_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_name_constraints</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fname_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fname_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_name_constraints</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_name_constraints_t <var>nc</var>, unsigned int <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: The certificate
</p>
<p><var>nc</var>: The nameconstraints structure
</p>
<p><var>critical</var>: whether this extension will be critical
</p>
<p>This function will set the provided name constraints to
the certificate extension list. This extension is always
marked as critical.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fpin_005ffunction-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_pin_function</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fpin_005ffunction"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fpin_005ffunction"></a>Function: <em>void</em> <strong>gnutls_x509_crt_set_pin_function</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_pin_callback_t <var>fn</var>, void * <var>userdata</var>)</em></dt>
<dd><p><var>crt</var>: The certificate structure
</p>
<p><var>fn</var>: the callback
</p>
<p><var>userdata</var>: data associated with the callback
</p>
<p>This function will set a callback function to be used when
it is required to access a protected object. This function overrides 
the global function set using <code>gnutls_pkcs11_set_pin_function()</code> .
</p>
<p>Note that this callback is currently used only during the import
of a PKCS <code>11</code>  certificate with <code>gnutls_x509_crt_import_url()</code> .
</p>
<p><strong>Since:</strong> 3.1.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fpolicy-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_policy</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fpolicy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fpolicy"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_policy</strong> <em>(gnutls_x509_crt_t <var>crt</var>, const struct gnutls_x509_policy_st * <var>policy</var>, unsigned int <var>critical</var>)</em></dt>
<dd><p><var>crt</var>: should contain a <code>gnutls_x509_crt_t</code>  type
</p>
<p><var>policy</var>: A pointer to a policy
</p>
<p><var>critical</var>: use non-zero if the extension is marked as critical
</p>
<p>This function will set the certificate policy extension (2.5.29.32).
Multiple calls to this function append a new policy.
</p>
<p>Note the maximum text size for the qualifier <code>GNUTLS_X509_QUALIFIER_NOTICE</code> 
is 200 characters. This function will fail with <code>GNUTLS_E_INVALID_REQUEST</code> 
if this is exceeded.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.1.5
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_private_key_usage_period</strong> <em>(gnutls_x509_crt_t <var>crt</var>, time_t <var>activation</var>, time_t <var>expiration</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>activation</var>: The activation time
</p>
<p><var>expiration</var>: The expiration time
</p>
<p>This function will set the private key usage period extension (2.5.29.16).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fproxy-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_proxy</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fproxy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fproxy"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_proxy</strong> <em>(gnutls_x509_crt_t <var>crt</var>, int <var>pathLenConstraint</var>, const char * <var>policyLanguage</var>, const char * <var>policy</var>, size_t <var>sizeof_policy</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>pathLenConstraint</var>: non-negative error codes indicate maximum length of path,
and negative error codes indicate that the pathLenConstraints field should
not be present.
</p>
<p><var>policyLanguage</var>: OID describing the language of  <code>policy</code> .
</p>
<p><var>policy</var>: uint8_t byte array with policy language, can be <code>NULL</code> 
</p>
<p><var>sizeof_policy</var>: size of  <code>policy</code> .
</p>
<p>This function will set the proxyCertInfo extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fproxy_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_proxy_dn</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fproxy_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fproxy_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_proxy_dn</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_crt_t <var>eecrt</var>, unsigned int <var>raw_flag</var>, const void * <var>name</var>, unsigned int <var>sizeof_name</var>)</em></dt>
<dd><p><var>crt</var>: a gnutls_x509_crt_t type with the new proxy cert
</p>
<p><var>eecrt</var>: the end entity certificate that will be issuing the proxy
</p>
<p><var>raw_flag</var>: must be 0, or 1 if the CN is DER encoded
</p>
<p><var>name</var>: a pointer to the CN name, may be NULL (but MUST then be added later)
</p>
<p><var>sizeof_name</var>: holds the size of  <code>name</code> 
</p>
<p>This function will set the subject in  <code>crt</code> to the end entity&rsquo;s
 <code>eecrt</code> subject name, and add a single Common Name component  <code>name</code> of size  <code>sizeof_name</code> .  This corresponds to the required proxy
certificate naming style.  Note that if  <code>name</code> is <code>NULL</code> , you MUST
set it later by using <code>gnutls_x509_crt_set_dn_by_oid()</code>  or similar.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fserial-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_serial</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fserial"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fserial"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_serial</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>serial</var>, size_t <var>serial_size</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>serial</var>: The serial number
</p>
<p><var>serial_size</var>: Holds the size of the serial field.
</p>
<p>This function will set the X.509 certificate&rsquo;s serial number.
While the serial number is an integer, it is often handled
as an opaque field by several CAs. For this reason this function
accepts any kind of data as a serial number. To be consistent
with the X.509/PKIX specifications the provided  <code>serial</code> should be 
a big-endian positive number (i.e. it&rsquo;s leftmost bit should be zero).
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005falt_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_subject_alt_name</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005falt_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fsubject_005falt_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_subject_alt_name</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const void * <var>data</var>, unsigned int <var>data_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>type</var>: is one of the gnutls_x509_subject_alt_name_t enumerations
</p>
<p><var>data</var>: The data to be set
</p>
<p><var>data_size</var>: The size of data to be set
</p>
<p><var>flags</var>: GNUTLS_FSAN_SET to clear previous data or GNUTLS_FSAN_APPEND to append. 
</p>
<p>This function will set the subject alternative name certificate
extension. It can set the following types:
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.6.0
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005falternative_005fname-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_subject_alternative_name</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005falternative_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fsubject_005falternative_005fname"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_subject_alternative_name</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_subject_alt_name_t           <var>type</var>, const char * <var>data_string</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>type</var>: is one of the gnutls_x509_subject_alt_name_t enumerations
</p>
<p><var>data_string</var>: The data to be set, a (0) terminated string
</p>
<p>This function will set the subject alternative name certificate
extension. This function assumes that data can be expressed as a null
terminated string.
</p>
<p>The name of the function is unfortunate since it is incosistent with
<code>gnutls_x509_crt_get_subject_alt_name()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_subject_key_id</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fsubject_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_subject_key_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>id</var>, size_t <var>id_size</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>id</var>: The key ID
</p>
<p><var>id_size</var>: Holds the size of the subject key ID field.
</p>
<p>This function will set the X.509 certificate&rsquo;s subject key ID
extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005funique_005fid-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_subject_unique_id</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fsubject_005funique_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fsubject_005funique_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_subject_unique_id</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const void * <var>id</var>, size_t <var>id_size</var>)</em></dt>
<dd><p><var>cert</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>id</var>: The unique ID
</p>
<p><var>id_size</var>: Holds the size of the unique ID.
</p>
<p>This function will set the X.509 certificate&rsquo;s subject unique ID field.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.7
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fset_005fversion-1"></a>
<h4 class="subheading">gnutls_x509_crt_set_version</h4>
<a name="gnutls_005fx509_005fcrt_005fset_005fversion"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fset_005fversion"></a>Function: <em>int</em> <strong>gnutls_x509_crt_set_version</strong> <em>(gnutls_x509_crt_t <var>crt</var>, unsigned int <var>version</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>version</var>: holds the version number. For X.509v1 certificates must be 1.
</p>
<p>This function will set the version of the certificate.  This must
be one for X.509 version 1, and so on.  Plain certificates without
extensions must have version set to one.
</p>
<p>To create well-formed certificates, you must specify version 3 if
you use any certificate extensions.  Extensions are created by
functions such as <code>gnutls_x509_crt_set_subject_alt_name()</code> 
or <code>gnutls_x509_crt_set_key_usage()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fsign-1"></a>
<h4 class="subheading">gnutls_x509_crt_sign</h4>
<a name="gnutls_005fx509_005fcrt_005fsign"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fsign"></a>Function: <em>int</em> <strong>gnutls_x509_crt_sign</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_crt_t <var>issuer</var>, gnutls_x509_privkey_t <var>issuer_key</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>issuer</var>: is the certificate of the certificate issuer
</p>
<p><var>issuer_key</var>: holds the issuer&rsquo;s private key
</p>
<p>This function is the same a <code>gnutls_x509_crt_sign2()</code>  with no flags,
and SHA1 as the hash algorithm.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fsign2-1"></a>
<h4 class="subheading">gnutls_x509_crt_sign2</h4>
<a name="gnutls_005fx509_005fcrt_005fsign2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fsign2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_sign2</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_x509_crt_t <var>issuer</var>, gnutls_x509_privkey_t <var>issuer_key</var>, gnutls_digest_algorithm_t <var>dig</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>crt</var>: a certificate of type <code>gnutls_x509_crt_t</code> 
</p>
<p><var>issuer</var>: is the certificate of the certificate issuer
</p>
<p><var>issuer_key</var>: holds the issuer&rsquo;s private key
</p>
<p><var>dig</var>: The message digest to use, <code>GNUTLS_DIG_SHA1</code>  is a safe choice
</p>
<p><var>flags</var>: must be 0
</p>
<p>This function will sign the certificate with the issuer&rsquo;s private key, and
will copy the issuer&rsquo;s information into the certificate.
</p>
<p>This must be the last step in a certificate generation since all
the previously set parameters are now signed.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fverify-1"></a>
<h4 class="subheading">gnutls_x509_crt_verify</h4>
<a name="gnutls_005fx509_005fcrt_005fverify"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fverify"></a>Function: <em>int</em> <strong>gnutls_x509_crt_verify</strong> <em>(gnutls_x509_crt_t <var>cert</var>, const gnutls_x509_crt_t * <var>CA_list</var>, int <var>CA_list_length</var>, unsigned int <var>flags</var>, unsigned int * <var>verify</var>)</em></dt>
<dd><p><var>cert</var>: is the certificate to be verified
</p>
<p><var>CA_list</var>: is one certificate that is considered to be trusted one
</p>
<p><var>CA_list_length</var>: holds the number of CA certificate in CA_list
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>verify</var>: will hold the certificate verification output.
</p>
<p>This function will try to verify the given certificate and return
its status. Note that a verification error does not imply a negative
return status. In that case the  <code>verify</code> status is set.
</p>
<p>The details of the verification are the same
as in <code>gnutls_x509_trust_list_verify_crt2()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fcrt_005fverify_005fdata2-1"></a>
<h4 class="subheading">gnutls_x509_crt_verify_data2</h4>
<a name="gnutls_005fx509_005fcrt_005fverify_005fdata2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fcrt_005fverify_005fdata2"></a>Function: <em>int</em> <strong>gnutls_x509_crt_verify_data2</strong> <em>(gnutls_x509_crt_t <var>crt</var>, gnutls_sign_algorithm_t <var>algo</var>, unsigned int <var>flags</var>, const gnutls_datum_t * <var>data</var>, const gnutls_datum_t * <var>signature</var>)</em></dt>
<dd><p><var>crt</var>: Holds the certificate to verify with
</p>
<p><var>algo</var>: The signature algorithm used
</p>
<p><var>flags</var>: Zero or an OR list of <code>gnutls_certificate_verify_flags</code> 
</p>
<p><var>data</var>: holds the signed data
</p>
<p><var>signature</var>: contains the signature
</p>
<p>This function will verify the given signed data, using the
parameters from the certificate.
</p>
<p><strong>Returns:</strong> In case of a verification failure <code>GNUTLS_E_PK_SIG_VERIFY_FAILED</code>  
is returned, and zero or positive code on success.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_dn_deinit</h4>
<a name="gnutls_005fx509_005fdn_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_dn_deinit</strong> <em>(gnutls_x509_dn_t <var>dn</var>)</em></dt>
<dd><p><var>dn</var>: a DN uint8_t object pointer.
</p>
<p>This function deallocates the DN object as returned by
<code>gnutls_x509_dn_import()</code> .
</p>
<p><strong>Since:</strong> 2.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fexport-1"></a>
<h4 class="subheading">gnutls_x509_dn_export</h4>
<a name="gnutls_005fx509_005fdn_005fexport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fexport"></a>Function: <em>int</em> <strong>gnutls_x509_dn_export</strong> <em>(gnutls_x509_dn_t <var>dn</var>, gnutls_x509_crt_fmt_t <var>format</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>dn</var>: Holds the uint8_t DN object
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>output_data</var>: will contain a DN PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will export the DN to DER or PEM format.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>output_data_size</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code> 
will be returned.
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN NAME&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fexport2-1"></a>
<h4 class="subheading">gnutls_x509_dn_export2</h4>
<a name="gnutls_005fx509_005fdn_005fexport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fexport2"></a>Function: <em>int</em> <strong>gnutls_x509_dn_export2</strong> <em>(gnutls_x509_dn_t <var>dn</var>, gnutls_x509_crt_fmt_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>dn</var>: Holds the uint8_t DN object
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>out</var>: will contain a DN PEM or DER encoded
</p>
<p>This function will export the DN to DER or PEM format.
</p>
<p>The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN NAME&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fget_005frdn_005fava-1"></a>
<h4 class="subheading">gnutls_x509_dn_get_rdn_ava</h4>
<a name="gnutls_005fx509_005fdn_005fget_005frdn_005fava"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fget_005frdn_005fava-1"></a>Function: <em>int</em> <strong>gnutls_x509_dn_get_rdn_ava</strong> <em>(gnutls_x509_dn_t <var>dn</var>, int <var>irdn</var>, int <var>iava</var>, gnutls_x509_ava_st * <var>ava</var>)</em></dt>
<dd><p><var>dn</var>: a pointer to DN
</p>
<p><var>irdn</var>: index of RDN
</p>
<p><var>iava</var>: index of AVA.
</p>
<p><var>ava</var>: Pointer to structure which will hold output information.
</p>
<p>Get pointers to data within the DN. The format of the  <code>ava</code> structure
is shown below.
</p>
<p>struct gnutls_x509_ava_st {
gnutls_datum_t oid;
gnutls_datum_t value;
unsigned long value_tag;
};
</p>
<p>The X.509 distinguished name is a sequence of sequences of strings
and this is what the  <code>irdn</code> and  <code>iava</code> indexes model.
</p>
<p>Note that  <code>ava</code> will contain pointers into the  <code>dn</code> structure which
in turns points to the original certificate. Thus you should not
modify any data or deallocate any of those.
</p>
<p>This is a low-level function that requires the caller to do the
value conversions when necessary (e.g. from UCS-2).
</p>
<p><strong>Returns:</strong> Returns 0 on success, or an error code.
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fget_005fstr-1"></a>
<h4 class="subheading">gnutls_x509_dn_get_str</h4>
<a name="gnutls_005fx509_005fdn_005fget_005fstr"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fget_005fstr"></a>Function: <em>int</em> <strong>gnutls_x509_dn_get_str</strong> <em>(gnutls_x509_dn_t <var>dn</var>, gnutls_datum_t * <var>str</var>)</em></dt>
<dd><p><var>dn</var>: a pointer to DN
</p>
<p><var>str</var>: a datum that will hold the name
</p>
<p>This function will allocate buffer and copy the name in the provided DN.
The name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as
described in RFC4514. The output string will be ASCII or UTF-8
encoded, depending on the certificate data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.2
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_dn_import</h4>
<a name="gnutls_005fx509_005fdn_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_dn_import</strong> <em>(gnutls_x509_dn_t <var>dn</var>, const gnutls_datum_t * <var>data</var>)</em></dt>
<dd><p><var>dn</var>: the structure that will hold the imported DN
</p>
<p><var>data</var>: should contain a DER encoded RDN sequence
</p>
<p>This function parses an RDN sequence and stores the result to a
<code>gnutls_x509_dn_t</code>  type. The data must have been initialized
with <code>gnutls_x509_dn_init()</code> . You may use <code>gnutls_x509_dn_get_rdn_ava()</code>  to
decode the DN.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005finit-1"></a>
<h4 class="subheading">gnutls_x509_dn_init</h4>
<a name="gnutls_005fx509_005fdn_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_dn_init</strong> <em>(gnutls_x509_dn_t * <var>dn</var>)</em></dt>
<dd><p><var>dn</var>: the object to be initialized
</p>
<p>This function initializes a <code>gnutls_x509_dn_t</code>  type.
</p>
<p>The object returned must be deallocated using
<code>gnutls_x509_dn_deinit()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005foid_005fknown-1"></a>
<h4 class="subheading">gnutls_x509_dn_oid_known</h4>
<a name="gnutls_005fx509_005fdn_005foid_005fknown"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005foid_005fknown"></a>Function: <em>int</em> <strong>gnutls_x509_dn_oid_known</strong> <em>(const char * <var>oid</var>)</em></dt>
<dd><p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p>This function will inform about known DN OIDs. This is useful since
functions like <code>gnutls_x509_crt_set_dn_by_oid()</code>  use the information
on known OIDs to properly encode their input. Object Identifiers
that are not known are not encoded by these functions, and their
input is stored directly into the ASN.1 structure. In that case of
unknown OIDs, you have the responsibility of DER encoding your
data.
</p>
<p><strong>Returns:</strong> 1 on known OIDs and 0 otherwise.
</p></dd></dl>

<a name="gnutls_005fx509_005fdn_005foid_005fname-1"></a>
<h4 class="subheading">gnutls_x509_dn_oid_name</h4>
<a name="gnutls_005fx509_005fdn_005foid_005fname"></a><dl>
<dt><a name="index-gnutls_005fx509_005fdn_005foid_005fname"></a>Function: <em>const char *</em> <strong>gnutls_x509_dn_oid_name</strong> <em>(const char * <var>oid</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>oid</var>: holds an Object Identifier in a null terminated string
</p>
<p><var>flags</var>: 0 or GNUTLS_X509_DN_OID_*
</p>
<p>This function will return the name of a known DN OID. If
<code>GNUTLS_X509_DN_OID_RETURN_OID</code>  is specified this function
will return the given OID if no descriptive name has been
found.
</p>
<p><strong>Returns:</strong> A null terminated string or NULL otherwise.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_ext_deinit</h4>
<a name="gnutls_005fx509_005fext_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_ext_deinit</strong> <em>(gnutls_x509_ext_st * <var>ext</var>)</em></dt>
<dd><p><var>ext</var>: The extensions structure
</p>
<p>This function will deinitialize an extensions structure.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005faia-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_aia</h4>
<a name="gnutls_005fx509_005fext_005fexport_005faia"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005faia"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_aia</strong> <em>(gnutls_x509_aia_t <var>aia</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>aia</var>: The authority info access
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will DER encode the Authority Information Access (AIA)
extension; see RFC 5280 section 4.2.2.1 for more information on the
extension.  
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_authority_key_id</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_authority_key_id</strong> <em>(gnutls_x509_aki_t <var>aki</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>aki</var>: An initialized authority key identifier
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided key identifier to a
DER-encoded PKIX AuthorityKeyIdentifier extension. 
The output data in  <code>ext</code> will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_basic_constraints</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_basic_constraints</strong> <em>(unsigned int <var>ca</var>, int <var>pathlen</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>ca</var>: non-zero for a CA
</p>
<p><var>pathlen</var>: The path length constraint (set to -1 for no constraint)
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the parameters provided to a basic constraints
DER encoded extension (2.5.29.19).
The  <code>ext</code> data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fcrl_005fdist_005fpoints-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_crl_dist_points</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fcrl_005fdist_005fpoints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fcrl_005fdist_005fpoints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_crl_dist_points</strong> <em>(gnutls_x509_crl_dist_points_t <var>cdp</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>cdp</var>: A pointer to an initialized CRL distribution points.
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided policies, to a certificate policy
DER encoded extension (2.5.29.31).
</p>
<p>The  <code>ext</code> data will be allocated using <code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fkey_005fpurposes-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_key_purposes</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fkey_005fpurposes"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fkey_005fpurposes"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_key_purposes</strong> <em>(gnutls_x509_key_purposes_t <var>p</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>p</var>: The key purposes
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the key purposes type to a
DER-encoded PKIX ExtKeyUsageSyntax (2.5.29.37) extension. The output data in 
 <code>ext</code> will be allocated usin <code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_key_usage</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_key_usage</strong> <em>(unsigned int <var>usage</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>usage</var>: an ORed sequence of the GNUTLS_KEY_* elements.
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the keyUsage bit string to a DER
encoded PKIX extension. The  <code>ext</code> data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fname_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_name_constraints</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fname_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fname_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_name_constraints</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>nc</var>: The nameconstraints
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided name constraints type to a
DER-encoded PKIX NameConstraints (2.5.29.30) extension. The output data in 
 <code>ext</code> will be allocated usin <code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fpolicies-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_policies</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fpolicies"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fpolicies"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_policies</strong> <em>(gnutls_x509_policies_t <var>policies</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>policies</var>: A pointer to an initialized policies.
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided policies, to a certificate policy
DER encoded extension (2.5.29.32).
</p>
<p>The  <code>ext</code> data will be allocated using <code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_private_key_usage_period</strong> <em>(time_t <var>activation</var>, time_t <var>expiration</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>activation</var>: The activation time
</p>
<p><var>expiration</var>: The expiration time
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the periods provided to a private key
usage DER encoded extension (2.5.29.16).
The  <code>ext</code> data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fproxy-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_proxy</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fproxy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fproxy"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_proxy</strong> <em>(int <var>pathLenConstraint</var>, const char * <var>policyLanguage</var>, const char * <var>policy</var>, size_t <var>sizeof_policy</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>pathLenConstraint</var>: non-negative error codes indicate maximum length of path,
and negative error codes indicate that the pathLenConstraints field should
not be present.
</p>
<p><var>policyLanguage</var>: OID describing the language of  <code>policy</code> .
</p>
<p><var>policy</var>: uint8_t byte array with policy language, can be <code>NULL</code> 
</p>
<p><var>sizeof_policy</var>: size of  <code>policy</code> .
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the parameters provided to a proxyCertInfo extension.
</p>
<p>The  <code>ext</code> data will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fsubject_005falt_005fnames-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_subject_alt_names</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fsubject_005falt_005fnames"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fsubject_005falt_005fnames"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_subject_alt_names</strong> <em>(gnutls_subject_alt_names_t <var>sans</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>sans</var>: The alternative names
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided alternative names structure to a
DER-encoded SubjectAltName PKIX extension. The output data in  <code>ext</code> will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fexport_005fsubject_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_ext_export_subject_key_id</h4>
<a name="gnutls_005fx509_005fext_005fexport_005fsubject_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fexport_005fsubject_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_ext_export_subject_key_id</strong> <em>(const gnutls_datum_t * <var>id</var>, gnutls_datum_t * <var>ext</var>)</em></dt>
<dd><p><var>id</var>: The key identifier
</p>
<p><var>ext</var>: The DER-encoded extension data; must be freed using <code>gnutls_free()</code> .
</p>
<p>This function will convert the provided key identifier to a
DER-encoded PKIX SubjectKeyIdentifier extension. 
The output data in  <code>ext</code> will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005faia-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_aia</h4>
<a name="gnutls_005fx509_005fext_005fimport_005faia"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005faia"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_aia</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_aia_t <var>aia</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: The DER-encoded extension data
</p>
<p><var>aia</var>: The authority info access
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function extracts the Authority Information Access (AIA)
extension from the provided DER-encoded data; see RFC 5280 section 4.2.2.1 
for more information on the extension.  The
AIA extension holds a sequence of AccessDescription (AD) data.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fauthority_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_authority_key_id</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fauthority_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fauthority_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_authority_key_id</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_aki_t <var>aki</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: a DER encoded extension
</p>
<p><var>aki</var>: An initialized authority key identifier type
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will return the subject key ID stored in the provided
AuthorityKeyIdentifier extension.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fbasic_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_basic_constraints</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fbasic_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fbasic_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_basic_constraints</strong> <em>(const gnutls_datum_t * <var>ext</var>, unsigned int * <var>ca</var>, int * <var>pathlen</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>ca</var>: will be non zero if the CA status is true
</p>
<p><var>pathlen</var>: the path length constraint; will be set to -1 for no limit
</p>
<p>This function will return the CA status and path length constraint
as written in the PKIX extension 2.5.29.19.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fcrl_005fdist_005fpoints-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_crl_dist_points</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fcrl_005fdist_005fpoints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fcrl_005fdist_005fpoints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_crl_dist_points</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_crl_dist_points_t <var>cdp</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>cdp</var>: A pointer to an initialized CRL distribution points.
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will extract the CRL distribution points extension (2.5.29.31) 
and store it into the provided type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fkey_005fpurposes-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_key_purposes</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fkey_005fpurposes"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fkey_005fpurposes"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_key_purposes</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_key_purposes_t <var>p</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: The DER-encoded extension data
</p>
<p><var>p</var>: The key purposes
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will extract the key purposes in the provided DER-encoded
ExtKeyUsageSyntax PKIX extension, to a <code>gnutls_x509_key_purposes_t</code>  type. 
The data must be initialized.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fkey_005fusage-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_key_usage</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fkey_005fusage"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fkey_005fusage"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_key_usage</strong> <em>(const gnutls_datum_t * <var>ext</var>, unsigned int * <var>key_usage</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>key_usage</var>: where the key usage bits will be stored
</p>
<p>This function will return certificate&rsquo;s key usage, by reading the DER
data of the keyUsage X.509 extension (2.5.29.15). The key usage value will ORed
values of the: <code>GNUTLS_KEY_DIGITAL_SIGNATURE</code> ,
<code>GNUTLS_KEY_NON_REPUDIATION</code> , <code>GNUTLS_KEY_KEY_ENCIPHERMENT</code> ,
<code>GNUTLS_KEY_DATA_ENCIPHERMENT</code> , <code>GNUTLS_KEY_KEY_AGREEMENT</code> ,
<code>GNUTLS_KEY_KEY_CERT_SIGN</code> , <code>GNUTLS_KEY_CRL_SIGN</code> ,
<code>GNUTLS_KEY_ENCIPHER_ONLY</code> , <code>GNUTLS_KEY_DECIPHER_ONLY</code> .
</p>
<p><strong>Returns:</strong> the certificate key usage, or a negative error code in case of
parsing error.  If the certificate does not contain the keyUsage
extension <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code>  will be
returned.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fname_005fconstraints-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_name_constraints</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fname_005fconstraints"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fname_005fconstraints"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_name_constraints</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_name_constraints_t <var>nc</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: a DER encoded extension
</p>
<p><var>nc</var>: The nameconstraints
</p>
<p><var>flags</var>: zero or <code>GNUTLS_NAME_CONSTRAINTS_FLAG_APPEND</code> 
</p>
<p>This function will return an intermediate type containing
the name constraints of the provided NameConstraints extension. That
can be used in combination with <code>gnutls_x509_name_constraints_check()</code> 
to verify whether a server&rsquo;s name is in accordance with the constraints.
</p>
<p>When the  <code>flags</code> is set to <code>GNUTLS_NAME_CONSTRAINTS_FLAG_APPEND</code> , then if 
the  <code>nc</code> type is empty this function will behave identically as if the flag was not set.
Otherwise if there are elements in the  <code>nc</code> type then only the
excluded constraints will be appended to the constraints.
</p>
<p>Note that  <code>nc</code> must be initialized prior to calling this function.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fpolicies-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_policies</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fpolicies"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fpolicies"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_policies</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_x509_policies_t <var>policies</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>policies</var>: A pointer to an initialized policies.
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will extract the certificate policy extension (2.5.29.32) 
and store it the provided policies.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fprivate_005fkey_005fusage_005fperiod-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_private_key_usage_period</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fprivate_005fkey_005fusage_005fperiod"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fprivate_005fkey_005fusage_005fperiod"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_private_key_usage_period</strong> <em>(const gnutls_datum_t * <var>ext</var>, time_t * <var>activation</var>, time_t * <var>expiration</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>activation</var>: Will hold the activation time
</p>
<p><var>expiration</var>: Will hold the expiration time
</p>
<p>This function will return the expiration and activation
times of the private key as written in the
PKIX extension 2.5.29.16.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fproxy-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_proxy</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fproxy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fproxy"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_proxy</strong> <em>(const gnutls_datum_t * <var>ext</var>, int * <var>pathlen</var>, char ** <var>policyLanguage</var>, char ** <var>policy</var>, size_t * <var>sizeof_policy</var>)</em></dt>
<dd><p><var>ext</var>: the DER encoded extension data
</p>
<p><var>pathlen</var>: pointer to output integer indicating path length (may be
NULL), non-negative error codes indicate a present pCPathLenConstraint
field and the actual value, -1 indicate that the field is absent.
</p>
<p><var>policyLanguage</var>: output variable with OID of policy language
</p>
<p><var>policy</var>: output variable with policy data
</p>
<p><var>sizeof_policy</var>: output variable size of policy data
</p>
<p>This function will return the information from a proxy certificate
extension. It reads the ProxyCertInfo X.509 extension (1.3.6.1.5.5.7.1.14).
The  <code>policyLanguage</code> and  <code>policy</code> values must be deinitialized using <code>gnutls_free()</code>  after use.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fsubject_005falt_005fnames-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_subject_alt_names</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fsubject_005falt_005fnames"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fsubject_005falt_005fnames"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_subject_alt_names</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_subject_alt_names_t <var>sans</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>ext</var>: The DER-encoded extension data
</p>
<p><var>sans</var>: The alternative names
</p>
<p><var>flags</var>: should be zero
</p>
<p>This function will export the alternative names in the provided DER-encoded
SubjectAltName PKIX extension, to a <code>gnutls_subject_alt_names_t</code>  type.  <code>sans</code> must be initialized.
</p>
<p>This function will succeed even if there no subject alternative names
in the structure.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fimport_005fsubject_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_ext_import_subject_key_id</h4>
<a name="gnutls_005fx509_005fext_005fimport_005fsubject_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fimport_005fsubject_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_ext_import_subject_key_id</strong> <em>(const gnutls_datum_t * <var>ext</var>, gnutls_datum_t * <var>id</var>)</em></dt>
<dd><p><var>ext</var>: a DER encoded extension
</p>
<p><var>id</var>: will contain the subject key ID
</p>
<p>This function will return the subject key ID stored in the provided
SubjectKeyIdentifier extension. The ID will be allocated using
<code>gnutls_malloc()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fext_005fprint-1"></a>
<h4 class="subheading">gnutls_x509_ext_print</h4>
<a name="gnutls_005fx509_005fext_005fprint"></a><dl>
<dt><a name="index-gnutls_005fx509_005fext_005fprint"></a>Function: <em>int</em> <strong>gnutls_x509_ext_print</strong> <em>(gnutls_x509_ext_st * <var>exts</var>, unsigned int <var>exts_size</var>, gnutls_certificate_print_formats_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>exts</var>: The data to be printed
</p>
<p><var>exts_size</var>: the number of available structures
</p>
<p><var>format</var>: Indicate the format to use
</p>
<p><var>out</var>: Newly allocated datum with null terminated string.
</p>
<p>This function will pretty print X.509 certificate extensions, 
suitable for display to a human.
</p>
<p>The output  <code>out</code> needs to be deallocated using <code>gnutls_free()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fkey_005fpurpose_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_key_purpose_deinit</h4>
<a name="gnutls_005fx509_005fkey_005fpurpose_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fkey_005fpurpose_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_key_purpose_deinit</strong> <em>(gnutls_x509_key_purposes_t <var>p</var>)</em></dt>
<dd><p><var>p</var>: The key purposes
</p>
<p>This function will deinitialize a key purposes type.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fkey_005fpurpose_005fget-1"></a>
<h4 class="subheading">gnutls_x509_key_purpose_get</h4>
<a name="gnutls_005fx509_005fkey_005fpurpose_005fget"></a><dl>
<dt><a name="index-gnutls_005fx509_005fkey_005fpurpose_005fget"></a>Function: <em>int</em> <strong>gnutls_x509_key_purpose_get</strong> <em>(gnutls_x509_key_purposes_t <var>p</var>, unsigned <var>idx</var>, gnutls_datum_t * <var>oid</var>)</em></dt>
<dd><p><var>p</var>: The key purposes
</p>
<p><var>idx</var>: The index of the key purpose to retrieve
</p>
<p><var>oid</var>: Will hold the object identifier of the key purpose (to be treated as constant)
</p>
<p>This function will retrieve the specified by the index key purpose in the
purposes type. The object identifier will be a null terminated string.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fkey_005fpurpose_005finit-1"></a>
<h4 class="subheading">gnutls_x509_key_purpose_init</h4>
<a name="gnutls_005fx509_005fkey_005fpurpose_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fkey_005fpurpose_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_key_purpose_init</strong> <em>(gnutls_x509_key_purposes_t * <var>p</var>)</em></dt>
<dd><p><var>p</var>: The key purposes
</p>
<p>This function will initialize an alternative names type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fkey_005fpurpose_005fset-1"></a>
<h4 class="subheading">gnutls_x509_key_purpose_set</h4>
<a name="gnutls_005fx509_005fkey_005fpurpose_005fset"></a><dl>
<dt><a name="index-gnutls_005fx509_005fkey_005fpurpose_005fset"></a>Function: <em>int</em> <strong>gnutls_x509_key_purpose_set</strong> <em>(gnutls_x509_key_purposes_t <var>p</var>, const char * <var>oid</var>)</em></dt>
<dd><p><var>p</var>: The key purposes
</p>
<p><var>oid</var>: The object identifier of the key purpose
</p>
<p>This function will store the specified key purpose in the
purposes.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0), otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fadd_005fexcluded-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_add_excluded</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fadd_005fexcluded"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fadd_005fexcluded"></a>Function: <em>int</em> <strong>gnutls_x509_name_constraints_add_excluded</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const gnutls_datum_t * <var>name</var>)</em></dt>
<dd><p><var>nc</var>: The nameconstraints
</p>
<p><var>type</var>: The type of the constraints
</p>
<p><var>name</var>: The data of the constraints
</p>
<p>This function will add a name constraint to the list of excluded
constraints.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fadd_005fpermitted-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_add_permitted</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fadd_005fpermitted"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fadd_005fpermitted"></a>Function: <em>int</em> <strong>gnutls_x509_name_constraints_add_permitted</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const gnutls_datum_t * <var>name</var>)</em></dt>
<dd><p><var>nc</var>: The nameconstraints
</p>
<p><var>type</var>: The type of the constraints
</p>
<p><var>name</var>: The data of the constraints
</p>
<p>This function will add a name constraint to the list of permitted
constraints.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fcheck-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_check</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fcheck"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fcheck"></a>Function: <em>unsigned</em> <strong>gnutls_x509_name_constraints_check</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, gnutls_x509_subject_alt_name_t <var>type</var>, const gnutls_datum_t * <var>name</var>)</em></dt>
<dd><p><var>nc</var>: the extracted name constraints
</p>
<p><var>type</var>: the type of the constraint to check (of type gnutls_x509_subject_alt_name_t)
</p>
<p><var>name</var>: the name to be checked
</p>
<p>This function will check the provided name against the constraints in
 <code>nc</code> using the RFC5280 rules. Currently this function is limited to DNS
names and emails (of type <code>GNUTLS_SAN_DNSNAME</code>  and <code>GNUTLS_SAN_RFC822NAME</code> ).
</p>
<p><strong>Returns:</strong> zero if the provided name is not acceptable, and non-zero otherwise.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fcheck_005fcrt-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_check_crt</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fcheck_005fcrt"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fcheck_005fcrt"></a>Function: <em>unsigned</em> <strong>gnutls_x509_name_constraints_check_crt</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, gnutls_x509_subject_alt_name_t <var>type</var>, gnutls_x509_crt_t <var>cert</var>)</em></dt>
<dd><p><var>nc</var>: the extracted name constraints
</p>
<p><var>type</var>: the type of the constraint to check (of type gnutls_x509_subject_alt_name_t)
</p>
<p><var>cert</var>: the certificate to be checked
</p>
<p>This function will check the provided certificate names against the constraints in
 <code>nc</code> using the RFC5280 rules. It will traverse all the certificate&rsquo;s names and
alternative names.
</p>
<p>Currently this function is limited to DNS
names and emails (of type <code>GNUTLS_SAN_DNSNAME</code>  and <code>GNUTLS_SAN_RFC822NAME</code> ).
</p>
<p><strong>Returns:</strong> zero if the provided name is not acceptable, and non-zero otherwise.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_deinit</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_name_constraints_deinit</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>)</em></dt>
<dd><p><var>nc</var>: The nameconstraints
</p>
<p>This function will deinitialize a name constraints type.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fget_005fexcluded-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_get_excluded</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fget_005fexcluded"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fget_005fexcluded"></a>Function: <em>int</em> <strong>gnutls_x509_name_constraints_get_excluded</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, unsigned <var>idx</var>, unsigned * <var>type</var>, gnutls_datum_t * <var>name</var>)</em></dt>
<dd><p><var>nc</var>: the extracted name constraints
</p>
<p><var>idx</var>: the index of the constraint
</p>
<p><var>type</var>: the type of the constraint (of type gnutls_x509_subject_alt_name_t)
</p>
<p><var>name</var>: the name in the constraint (of the specific type)
</p>
<p>This function will return an intermediate type containing
the name constraints of the provided CA certificate. That
structure can be used in combination with <code>gnutls_x509_name_constraints_check()</code> 
to verify whether a server&rsquo;s name is in accordance with the constraints.
</p>
<p>The name should be treated as constant and valid for the lifetime of  <code>nc</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005fget_005fpermitted-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_get_permitted</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005fget_005fpermitted"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005fget_005fpermitted"></a>Function: <em>int</em> <strong>gnutls_x509_name_constraints_get_permitted</strong> <em>(gnutls_x509_name_constraints_t <var>nc</var>, unsigned <var>idx</var>, unsigned * <var>type</var>, gnutls_datum_t * <var>name</var>)</em></dt>
<dd><p><var>nc</var>: the extracted name constraints
</p>
<p><var>idx</var>: the index of the constraint
</p>
<p><var>type</var>: the type of the constraint (of type gnutls_x509_subject_alt_name_t)
</p>
<p><var>name</var>: the name in the constraint (of the specific type)
</p>
<p>This function will return an intermediate type containing
the name constraints of the provided CA certificate. That
structure can be used in combination with <code>gnutls_x509_name_constraints_check()</code> 
to verify whether a server&rsquo;s name is in accordance with the constraints.
</p>
<p>The name should be treated as constant and valid for the lifetime of  <code>nc</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the extension is not present, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fname_005fconstraints_005finit-1"></a>
<h4 class="subheading">gnutls_x509_name_constraints_init</h4>
<a name="gnutls_005fx509_005fname_005fconstraints_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fname_005fconstraints_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_name_constraints_init</strong> <em>(gnutls_x509_name_constraints_t * <var>nc</var>)</em></dt>
<dd><p><var>nc</var>: The nameconstraints
</p>
<p>This function will initialize a name constraints type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fothername_005fto_005fvirtual-1"></a>
<h4 class="subheading">gnutls_x509_othername_to_virtual</h4>
<a name="gnutls_005fx509_005fothername_005fto_005fvirtual"></a><dl>
<dt><a name="index-gnutls_005fx509_005fothername_005fto_005fvirtual"></a>Function: <em>int</em> <strong>gnutls_x509_othername_to_virtual</strong> <em>(const char * <var>oid</var>, const gnutls_datum_t * <var>othername</var>, unsigned int * <var>virt_type</var>, gnutls_datum_t * <var>virt</var>)</em></dt>
<dd><p><var>oid</var>: The othername object identifier
</p>
<p><var>othername</var>: The othername data
</p>
<p><var>virt_type</var>: GNUTLS_SAN_OTHERNAME_XXX
</p>
<p><var>virt</var>: allocated printable data
</p>
<p>This function will parse and convert the othername data to a virtual
type supported by gnutls.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>

<a name="gnutls_005fx509_005fpolicies_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_policies_deinit</h4>
<a name="gnutls_005fx509_005fpolicies_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fpolicies_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_policies_deinit</strong> <em>(gnutls_x509_policies_t <var>policies</var>)</em></dt>
<dd><p><var>policies</var>: The authority key identifier
</p>
<p>This function will deinitialize an authority key identifier type.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fpolicies_005fget-1"></a>
<h4 class="subheading">gnutls_x509_policies_get</h4>
<a name="gnutls_005fx509_005fpolicies_005fget"></a><dl>
<dt><a name="index-gnutls_005fx509_005fpolicies_005fget"></a>Function: <em>int</em> <strong>gnutls_x509_policies_get</strong> <em>(gnutls_x509_policies_t <var>policies</var>, unsigned int <var>seq</var>, struct gnutls_x509_policy_st * <var>policy</var>)</em></dt>
<dd><p><var>policies</var>: The policies
</p>
<p><var>seq</var>: The index of the name to get
</p>
<p><var>policy</var>: Will hold the policy
</p>
<p>This function will return a specific policy as stored in
the  <code>policies</code> type. The returned values should be treated as constant
and valid for the lifetime of  <code>policies</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
if the index is out of bounds, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fpolicies_005finit-1"></a>
<h4 class="subheading">gnutls_x509_policies_init</h4>
<a name="gnutls_005fx509_005fpolicies_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fpolicies_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_policies_init</strong> <em>(gnutls_x509_policies_t * <var>policies</var>)</em></dt>
<dd><p><var>policies</var>: The authority key ID
</p>
<p>This function will initialize an authority key ID type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fpolicies_005fset-1"></a>
<h4 class="subheading">gnutls_x509_policies_set</h4>
<a name="gnutls_005fx509_005fpolicies_005fset"></a><dl>
<dt><a name="index-gnutls_005fx509_005fpolicies_005fset"></a>Function: <em>int</em> <strong>gnutls_x509_policies_set</strong> <em>(gnutls_x509_policies_t <var>policies</var>, const struct gnutls_x509_policy_st * <var>policy</var>)</em></dt>
<dd><p><var>policies</var>: An initialized policies
</p>
<p><var>policy</var>: Contains the policy to set
</p>
<p>This function will store the specified policy in
the provided  <code>policies</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0), otherwise a negative error value.
</p>
<p><strong>Since:</strong> 3.3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fpolicy_005frelease-1"></a>
<h4 class="subheading">gnutls_x509_policy_release</h4>
<a name="gnutls_005fx509_005fpolicy_005frelease"></a><dl>
<dt><a name="index-gnutls_005fx509_005fpolicy_005frelease"></a>Function: <em>void</em> <strong>gnutls_x509_policy_release</strong> <em>(struct gnutls_x509_policy_st * <var>policy</var>)</em></dt>
<dd><p><var>policy</var>: a certificate policy
</p>
<p>This function will deinitialize all memory associated with the provided
 <code>policy</code> . The policy is allocated using <code>gnutls_x509_crt_get_policy()</code> .
</p>
<p><strong>Since:</strong> 3.1.5
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fcpy-1"></a>
<h4 class="subheading">gnutls_x509_privkey_cpy</h4>
<a name="gnutls_005fx509_005fprivkey_005fcpy"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fcpy"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_cpy</strong> <em>(gnutls_x509_privkey_t <var>dst</var>, gnutls_x509_privkey_t <var>src</var>)</em></dt>
<dd><p><var>dst</var>: The destination key, which should be initialized.
</p>
<p><var>src</var>: The source key
</p>
<p>This function will copy a private key from source to destination
key. Destination has to be initialized.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_privkey_deinit</h4>
<a name="gnutls_005fx509_005fprivkey_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_privkey_deinit</strong> <em>(gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>key</var>: The key to be deinitialized
</p>
<p>This function will deinitialize a private key structure.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_x509_crt_fmt_t <var>format</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>key</var>: Holds the key
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>output_data</var>: will contain a private key PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will export the private key to a PKCS1 structure for
RSA keys, or an integer sequence for DSA keys.  The DSA keys are in
the same format with the parameters used by openssl.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>output_data_size</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code> 
will be returned.
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN RSA PRIVATE KEY&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport2-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export2</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport2"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export2</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_x509_crt_fmt_t <var>format</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>key</var>: Holds the key
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>out</var>: will contain a private key PEM or DER encoded
</p>
<p>This function will export the private key to a PKCS1 structure for
RSA keys, or an integer sequence for DSA keys.  The DSA keys are in
the same format with the parameters used by openssl.
</p>
<p>The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN RSA PRIVATE KEY&quot;.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p>Since 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport2_005fpkcs8-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export2_pkcs8</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport2_005fpkcs8"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport2_005fpkcs8"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export2_pkcs8</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_x509_crt_fmt_t <var>format</var>, const char * <var>password</var>, unsigned int <var>flags</var>, gnutls_datum_t * <var>out</var>)</em></dt>
<dd><p><var>key</var>: Holds the key
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>password</var>: the password that will be used to encrypt the key.
</p>
<p><var>flags</var>: an ORed sequence of gnutls_pkcs_encrypt_flags_t
</p>
<p><var>out</var>: will contain a private key PEM or DER encoded
</p>
<p>This function will export the private key to a PKCS8 structure.
Both RSA and DSA keys can be exported. For DSA keys we use
PKCS <code>11</code>  definitions. If the flags do not specify the encryption
cipher, then the default 3DES (PBES2) will be used.
</p>
<p>The  <code>password</code> can be either ASCII or UTF-8 in the default PBES2
encryption schemas, or ASCII for the PKCS12 schemas.
</p>
<p>The output buffer is allocated using <code>gnutls_malloc()</code> .
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN ENCRYPTED PRIVATE KEY&quot; or &quot;BEGIN PRIVATE KEY&quot; if
encryption is not used.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p>
<p>Since 3.1.3
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport_005fdsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export_dsa_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport_005fdsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport_005fdsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export_dsa_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_datum_t * <var>p</var>, gnutls_datum_t * <var>q</var>, gnutls_datum_t * <var>g</var>, gnutls_datum_t * <var>y</var>, gnutls_datum_t * <var>x</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>p</var>: will hold the p
</p>
<p><var>q</var>: will hold the q
</p>
<p><var>g</var>: will hold the g
</p>
<p><var>y</var>: will hold the y
</p>
<p><var>x</var>: will hold the x
</p>
<p>This function will export the DSA private key&rsquo;s parameters found
in the given structure. The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport_005fecc_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export_ecc_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport_005fecc_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport_005fecc_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export_ecc_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_ecc_curve_t * <var>curve</var>, gnutls_datum_t * <var>x</var>, gnutls_datum_t * <var>y</var>, gnutls_datum_t * <var>k</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>curve</var>: will hold the curve
</p>
<p><var>x</var>: will hold the x coordinate
</p>
<p><var>y</var>: will hold the y coordinate
</p>
<p><var>k</var>: will hold the private key
</p>
<p>This function will export the ECC private key&rsquo;s parameters found
in the given structure. The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport_005fpkcs8-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export_pkcs8</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport_005fpkcs8"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport_005fpkcs8"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export_pkcs8</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_x509_crt_fmt_t <var>format</var>, const char * <var>password</var>, unsigned int <var>flags</var>, void * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>key</var>: Holds the key
</p>
<p><var>format</var>: the format of output params. One of PEM or DER.
</p>
<p><var>password</var>: the password that will be used to encrypt the key.
</p>
<p><var>flags</var>: an ORed sequence of gnutls_pkcs_encrypt_flags_t
</p>
<p><var>output_data</var>: will contain a private key PEM or DER encoded
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will export the private key to a PKCS8 structure.
Both RSA and DSA keys can be exported. For DSA keys we use
PKCS <code>11</code>  definitions. If the flags do not specify the encryption
cipher, then the default 3DES (PBES2) will be used.
</p>
<p>The  <code>password</code> can be either ASCII or UTF-8 in the default PBES2
encryption schemas, or ASCII for the PKCS12 schemas.
</p>
<p>If the buffer provided is not long enough to hold the output, then
*output_data_size is updated and GNUTLS_E_SHORT_MEMORY_BUFFER will
be returned.
</p>
<p>If the structure is PEM encoded, it will have a header
of &quot;BEGIN ENCRYPTED PRIVATE KEY&quot; or &quot;BEGIN PRIVATE KEY&quot; if
encryption is not used.
</p>
<p><strong>Returns:</strong> In case of failure a negative error code will be
returned, and 0 on success.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export_rsa_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export_rsa_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_datum_t * <var>m</var>, gnutls_datum_t * <var>e</var>, gnutls_datum_t * <var>d</var>, gnutls_datum_t * <var>p</var>, gnutls_datum_t * <var>q</var>, gnutls_datum_t * <var>u</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>m</var>: will hold the modulus
</p>
<p><var>e</var>: will hold the public exponent
</p>
<p><var>d</var>: will hold the private exponent
</p>
<p><var>p</var>: will hold the first prime (p)
</p>
<p><var>q</var>: will hold the second prime (q)
</p>
<p><var>u</var>: will hold the coefficient
</p>
<p>This function will export the RSA private key&rsquo;s parameters found
in the given structure. The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw2-1"></a>
<h4 class="subheading">gnutls_x509_privkey_export_rsa_raw2</h4>
<a name="gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fexport_005frsa_005fraw2"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_export_rsa_raw2</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_datum_t * <var>m</var>, gnutls_datum_t * <var>e</var>, gnutls_datum_t * <var>d</var>, gnutls_datum_t * <var>p</var>, gnutls_datum_t * <var>q</var>, gnutls_datum_t * <var>u</var>, gnutls_datum_t * <var>e1</var>, gnutls_datum_t * <var>e2</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>m</var>: will hold the modulus
</p>
<p><var>e</var>: will hold the public exponent
</p>
<p><var>d</var>: will hold the private exponent
</p>
<p><var>p</var>: will hold the first prime (p)
</p>
<p><var>q</var>: will hold the second prime (q)
</p>
<p><var>u</var>: will hold the coefficient
</p>
<p><var>e1</var>: will hold e1 = d mod (p-1)
</p>
<p><var>e2</var>: will hold e2 = d mod (q-1)
</p>
<p>This function will export the RSA private key&rsquo;s parameters found
in the given structure. The new parameters will be allocated using
<code>gnutls_malloc()</code>  and will be stored in the appropriate datum.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.12.0
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005ffix-1"></a>
<h4 class="subheading">gnutls_x509_privkey_fix</h4>
<a name="gnutls_005fx509_005fprivkey_005ffix"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005ffix"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_fix</strong> <em>(gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p>This function will recalculate the secondary parameters in a key.
In RSA keys, this can be the coefficient and exponent1,2.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fgenerate-1"></a>
<h4 class="subheading">gnutls_x509_privkey_generate</h4>
<a name="gnutls_005fx509_005fprivkey_005fgenerate"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fgenerate"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_generate</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_pk_algorithm_t <var>algo</var>, unsigned int <var>bits</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>algo</var>: is one of the algorithms in <code>gnutls_pk_algorithm_t</code> .
</p>
<p><var>bits</var>: the size of the modulus
</p>
<p><var>flags</var>: unused for now.  Must be 0.
</p>
<p>This function will generate a random private key. Note that this
function must be called on an empty private key.
</p>
<p>Note that when generating an elliptic curve key, the curve
can be substituted in the place of the bits parameter using the
<code>GNUTLS_CURVE_TO_BITS()</code>  macro.
</p>
<p>For DSA keys, if the subgroup size needs to be specified check
the <code>GNUTLS_SUBGROUP_TO_BITS()</code>  macro.
</p>
<p>Do not set the number of bits directly, use <code>gnutls_sec_param_to_pk_bits()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fget_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_privkey_get_key_id</h4>
<a name="gnutls_005fx509_005fprivkey_005fget_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fget_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_get_key_id</strong> <em>(gnutls_x509_privkey_t <var>key</var>, unsigned int <var>flags</var>, unsigned char * <var>output_data</var>, size_t * <var>output_data_size</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>flags</var>: should be one of the flags from <code>gnutls_keyid_flags_t</code> 
</p>
<p><var>output_data</var>: will contain the key ID
</p>
<p><var>output_data_size</var>: holds the size of output_data (and will be
replaced by the actual size of parameters)
</p>
<p>This function will return a unique ID that depends on the public key
parameters. This ID can be used in checking whether a certificate
corresponds to the given key.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>output_data_size</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will
be returned.  The output will normally be a SHA-1 hash output,
which is 20 bytes.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm-1"></a>
<h4 class="subheading">gnutls_x509_privkey_get_pk_algorithm</h4>
<a name="gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_get_pk_algorithm</strong> <em>(gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>key</var>: should contain a <code>gnutls_x509_privkey_t</code>  type
</p>
<p>This function will return the public key algorithm of a private
key.
</p>
<p><strong>Returns:</strong> a member of the <code>gnutls_pk_algorithm_t</code>  enumeration on
success, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm2-1"></a>
<h4 class="subheading">gnutls_x509_privkey_get_pk_algorithm2</h4>
<a name="gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fget_005fpk_005falgorithm2"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_get_pk_algorithm2</strong> <em>(gnutls_x509_privkey_t <var>key</var>, unsigned int * <var>bits</var>)</em></dt>
<dd><p><var>key</var>: should contain a <code>gnutls_x509_privkey_t</code>  type
</p>
<p><var>bits</var>: The number of bits in the public key algorithm
</p>
<p>This function will return the public key algorithm of a private
key.
</p>
<p><strong>Returns:</strong> a member of the <code>gnutls_pk_algorithm_t</code>  enumeration on
success, or a negative error code on error.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>data</var>: The DER or PEM encoded certificate.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p>This function will convert the given DER or PEM encoded key to the
native <code>gnutls_x509_privkey_t</code>  format. The output will be stored in
 <code>key</code> .
</p>
<p>If the key is PEM encoded it should have a header that contains &quot;PRIVATE
KEY&quot;. Note that this function falls back to PKCS <code>8</code>  decoding without
password, if the default format fails to import.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport2-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import2</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport2-1"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import2</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, const char * <var>password</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>data</var>: The DER or PEM encoded key.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p><var>password</var>: A password (optional)
</p>
<p><var>flags</var>: an ORed sequence of gnutls_pkcs_encrypt_flags_t
</p>
<p>This function will import the given DER or PEM encoded key, to 
the native <code>gnutls_x509_privkey_t</code>  format, irrespective of the
input format. The input format is auto-detected.
</p>
<p>The supported formats are basic unencrypted key, PKCS8, PKCS12,
and the openssl format.
</p>
<p>If the provided key is encrypted but no password was given, then
<code>GNUTLS_E_DECRYPTION_FAILED</code>  is returned. Since GnuTLS 3.4.0 this
function will utilize the PIN callbacks if any.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005fdsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_dsa_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005fdsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005fdsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_dsa_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>p</var>, const gnutls_datum_t * <var>q</var>, const gnutls_datum_t * <var>g</var>, const gnutls_datum_t * <var>y</var>, const gnutls_datum_t * <var>x</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>p</var>: holds the p
</p>
<p><var>q</var>: holds the q
</p>
<p><var>g</var>: holds the g
</p>
<p><var>y</var>: holds the y
</p>
<p><var>x</var>: holds the x
</p>
<p>This function will convert the given DSA raw parameters to the
native <code>gnutls_x509_privkey_t</code>  format.  The output will be stored
in  <code>key</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005fecc_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_ecc_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005fecc_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005fecc_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_ecc_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_ecc_curve_t <var>curve</var>, const gnutls_datum_t * <var>x</var>, const gnutls_datum_t * <var>y</var>, const gnutls_datum_t * <var>k</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>curve</var>: holds the curve
</p>
<p><var>x</var>: holds the x
</p>
<p><var>y</var>: holds the y
</p>
<p><var>k</var>: holds the k
</p>
<p>This function will convert the given elliptic curve parameters to the
native <code>gnutls_x509_privkey_t</code>  format.  The output will be stored
in  <code>key</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005fopenssl-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_openssl</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005fopenssl"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005fopenssl-1"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_openssl</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>data</var>, const char * <var>password</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>data</var>: The DER or PEM encoded key.
</p>
<p><var>password</var>: the password to decrypt the key (if it is encrypted).
</p>
<p>This function will convert the given PEM encrypted to 
the native gnutls_x509_privkey_t format. The
output will be stored in  <code>key</code> .  
</p>
<p>The  <code>password</code> should be in ASCII. If the password is not provided
or wrong then <code>GNUTLS_E_DECRYPTION_FAILED</code>  will be returned.
</p>
<p>If the Certificate is PEM encoded it should have a header of
&quot;PRIVATE KEY&quot; and the &quot;DEK-Info&quot; header. 
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005fpkcs8-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_pkcs8</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005fpkcs8"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005fpkcs8"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_pkcs8</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>data</var>, gnutls_x509_crt_fmt_t <var>format</var>, const char * <var>password</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>data</var>: The DER or PEM encoded key.
</p>
<p><var>format</var>: One of DER or PEM
</p>
<p><var>password</var>: the password to decrypt the key (if it is encrypted).
</p>
<p><var>flags</var>: 0 if encrypted or GNUTLS_PKCS_PLAIN if not encrypted.
</p>
<p>This function will convert the given DER or PEM encoded PKCS8 2.0
encrypted key to the native gnutls_x509_privkey_t format. The
output will be stored in  <code>key</code> .  Both RSA and DSA keys can be
imported, and flags can only be used to indicate an unencrypted
key.
</p>
<p>The  <code>password</code> can be either ASCII or UTF-8 in the default PBES2
encryption schemas, or ASCII for the PKCS12 schemas.
</p>
<p>If the Certificate is PEM encoded it should have a header of
&quot;ENCRYPTED PRIVATE KEY&quot;, or &quot;PRIVATE KEY&quot;. You only need to
specify the flags if the key is DER encoded, since in that case
the encryption status cannot be auto-detected.
</p>
<p>If the <code>GNUTLS_PKCS_PLAIN</code>  flag is specified and the supplied data
are encrypted then <code>GNUTLS_E_DECRYPTION_FAILED</code>  is returned.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_rsa_raw</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_rsa_raw</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>m</var>, const gnutls_datum_t * <var>e</var>, const gnutls_datum_t * <var>d</var>, const gnutls_datum_t * <var>p</var>, const gnutls_datum_t * <var>q</var>, const gnutls_datum_t * <var>u</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>m</var>: holds the modulus
</p>
<p><var>e</var>: holds the public exponent
</p>
<p><var>d</var>: holds the private exponent
</p>
<p><var>p</var>: holds the first prime (p)
</p>
<p><var>q</var>: holds the second prime (q)
</p>
<p><var>u</var>: holds the coefficient
</p>
<p>This function will convert the given RSA raw parameters to the
native <code>gnutls_x509_privkey_t</code>  format.  The output will be stored in
 <code>key</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw2-1"></a>
<h4 class="subheading">gnutls_x509_privkey_import_rsa_raw2</h4>
<a name="gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw2"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fimport_005frsa_005fraw2"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_import_rsa_raw2</strong> <em>(gnutls_x509_privkey_t <var>key</var>, const gnutls_datum_t * <var>m</var>, const gnutls_datum_t * <var>e</var>, const gnutls_datum_t * <var>d</var>, const gnutls_datum_t * <var>p</var>, const gnutls_datum_t * <var>q</var>, const gnutls_datum_t * <var>u</var>, const gnutls_datum_t * <var>e1</var>, const gnutls_datum_t * <var>e2</var>)</em></dt>
<dd><p><var>key</var>: The data to store the parsed key
</p>
<p><var>m</var>: holds the modulus
</p>
<p><var>e</var>: holds the public exponent
</p>
<p><var>d</var>: holds the private exponent
</p>
<p><var>p</var>: holds the first prime (p)
</p>
<p><var>q</var>: holds the second prime (q)
</p>
<p><var>u</var>: holds the coefficient (optional)
</p>
<p><var>e1</var>: holds e1 = d mod (p-1) (optional)
</p>
<p><var>e2</var>: holds e2 = d mod (q-1) (optional)
</p>
<p>This function will convert the given RSA raw parameters to the
native <code>gnutls_x509_privkey_t</code>  format.  The output will be stored in
 <code>key</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005finit-1"></a>
<h4 class="subheading">gnutls_x509_privkey_init</h4>
<a name="gnutls_005fx509_005fprivkey_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_init</strong> <em>(gnutls_x509_privkey_t * <var>key</var>)</em></dt>
<dd><p><var>key</var>: A pointer to the type to be initialized
</p>
<p>This function will initialize a private key type.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fsec_005fparam-1"></a>
<h4 class="subheading">gnutls_x509_privkey_sec_param</h4>
<a name="gnutls_005fx509_005fprivkey_005fsec_005fparam"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fsec_005fparam"></a>Function: <em>gnutls_sec_param_t</em> <strong>gnutls_x509_privkey_sec_param</strong> <em>(gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p>This function will return the security parameter appropriate with
this private key.
</p>
<p><strong>Returns:</strong> On success, a valid security parameter is returned otherwise
<code>GNUTLS_SEC_PARAM_UNKNOWN</code>  is returned.
</p>
<p><strong>Since:</strong> 2.12.0
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fset_005fpin_005ffunction-1"></a>
<h4 class="subheading">gnutls_x509_privkey_set_pin_function</h4>
<a name="gnutls_005fx509_005fprivkey_005fset_005fpin_005ffunction"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fset_005fpin_005ffunction"></a>Function: <em>void</em> <strong>gnutls_x509_privkey_set_pin_function</strong> <em>(gnutls_x509_privkey_t <var>privkey</var>, gnutls_pin_callback_t <var>fn</var>, void * <var>userdata</var>)</em></dt>
<dd><p><var>privkey</var>: The certificate structure
</p>
<p><var>fn</var>: the callback
</p>
<p><var>userdata</var>: data associated with the callback
</p>
<p>This function will set a callback function to be used when
it is required to access a protected object. This function overrides 
the global function set using <code>gnutls_pkcs11_set_pin_function()</code> .
</p>
<p>Note that this callback is used when decrypting a key.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fsign_005fdata-1"></a>
<h4 class="subheading">gnutls_x509_privkey_sign_data</h4>
<a name="gnutls_005fx509_005fprivkey_005fsign_005fdata"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fsign_005fdata"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_sign_data</strong> <em>(gnutls_x509_privkey_t <var>key</var>, gnutls_digest_algorithm_t <var>digest</var>, unsigned int <var>flags</var>, const gnutls_datum_t * <var>data</var>, void * <var>signature</var>, size_t * <var>signature_size</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p><var>digest</var>: should be MD5 or SHA1
</p>
<p><var>flags</var>: should be 0 for now
</p>
<p><var>data</var>: holds the data to be signed
</p>
<p><var>signature</var>: will contain the signature
</p>
<p><var>signature_size</var>: holds the size of signature (and will be replaced
by the new size)
</p>
<p>This function will sign the given data using a signature algorithm
supported by the private key. Signature algorithms are always used
together with a hash functions.  Different hash functions may be
used for the RSA algorithm, but only SHA-1 for the DSA keys.
</p>
<p>If the buffer provided is not long enough to hold the output, then
* <code>signature_size</code> is updated and <code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  will
be returned.
</p>
<p>Use <code>gnutls_x509_crt_get_preferred_hash_algorithm()</code>  to determine
the hash algorithm.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005fprivkey_005fverify_005fparams-1"></a>
<h4 class="subheading">gnutls_x509_privkey_verify_params</h4>
<a name="gnutls_005fx509_005fprivkey_005fverify_005fparams"></a><dl>
<dt><a name="index-gnutls_005fx509_005fprivkey_005fverify_005fparams"></a>Function: <em>int</em> <strong>gnutls_x509_privkey_verify_params</strong> <em>(gnutls_x509_privkey_t <var>key</var>)</em></dt>
<dd><p><var>key</var>: a key
</p>
<p>This function will verify the private key parameters.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005frdn_005fget-1"></a>
<h4 class="subheading">gnutls_x509_rdn_get</h4>
<a name="gnutls_005fx509_005frdn_005fget"></a><dl>
<dt><a name="index-gnutls_005fx509_005frdn_005fget"></a>Function: <em>int</em> <strong>gnutls_x509_rdn_get</strong> <em>(const gnutls_datum_t * <var>idn</var>, char * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>idn</var>: should contain a DER encoded RDN sequence
</p>
<p><var>buf</var>: a pointer to a structure to hold the peer&rsquo;s name
</p>
<p><var>buf_size</var>: holds the size of  <code>buf</code> 
</p>
<p>This function will return the name of the given RDN sequence.  The
name will be in the form &quot;C=xxxx,O=yyyy,CN=zzzz&quot; as described in
RFC4514.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, or
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  is returned and * <code>buf_size</code> is
updated if the provided buffer is not long enough, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005frdn_005fget_005fby_005foid-1"></a>
<h4 class="subheading">gnutls_x509_rdn_get_by_oid</h4>
<a name="gnutls_005fx509_005frdn_005fget_005fby_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005frdn_005fget_005fby_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_rdn_get_by_oid</strong> <em>(const gnutls_datum_t * <var>idn</var>, const char * <var>oid</var>, int <var>indx</var>, unsigned int <var>raw_flag</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>idn</var>: should contain a DER encoded RDN sequence
</p>
<p><var>oid</var>: an Object Identifier
</p>
<p><var>indx</var>: In case multiple same OIDs exist in the RDN indicates which
to send. Use 0 for the first one.
</p>
<p><var>raw_flag</var>: If non-zero then the raw DER data are returned.
</p>
<p><var>buf</var>: a pointer to a structure to hold the peer&rsquo;s name
</p>
<p><var>buf_size</var>: holds the size of  <code>buf</code> 
</p>
<p>This function will return the name of the given Object identifier,
of the RDN sequence.  The name will be encoded using the rules
from RFC4514.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, or
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  is returned and * <code>buf_size</code> is
updated if the provided buffer is not long enough, otherwise a
negative error value.
</p></dd></dl>

<a name="gnutls_005fx509_005frdn_005fget_005foid-1"></a>
<h4 class="subheading">gnutls_x509_rdn_get_oid</h4>
<a name="gnutls_005fx509_005frdn_005fget_005foid"></a><dl>
<dt><a name="index-gnutls_005fx509_005frdn_005fget_005foid"></a>Function: <em>int</em> <strong>gnutls_x509_rdn_get_oid</strong> <em>(const gnutls_datum_t * <var>idn</var>, int <var>indx</var>, void * <var>buf</var>, size_t * <var>buf_size</var>)</em></dt>
<dd><p><var>idn</var>: should contain a DER encoded RDN sequence
</p>
<p><var>indx</var>: Indicates which OID to return. Use 0 for the first one.
</p>
<p><var>buf</var>: a pointer to a structure to hold the peer&rsquo;s name OID
</p>
<p><var>buf_size</var>: holds the size of  <code>buf</code> 
</p>
<p>This function will return the specified Object identifier, of the
RDN sequence.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, or
<code>GNUTLS_E_SHORT_MEMORY_BUFFER</code>  is returned and * <code>buf_size</code> is
updated if the provided buffer is not long enough, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 2.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fcas-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_cas</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fcas"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fcas-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_cas</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_x509_crt_t * <var>clist</var>, unsigned <var>clist_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>clist</var>: A list of CAs
</p>
<p><var>clist_size</var>: The length of the CA list
</p>
<p><var>flags</var>: should be 0 or an or&rsquo;ed sequence of <code>GNUTLS_TL</code>  options.
</p>
<p>This function will add the given certificate authorities
to the trusted list. The list of CAs must not be deinitialized
during this structure&rsquo;s lifetime.
</p>
<p>If the flag <code>GNUTLS_TL_NO_DUPLICATES</code>  is specified, then
the provided  <code>clist</code> entries that are duplicates will not be
added to the list and will be deinitialized.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fcrls-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_crls</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fcrls"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fcrls-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_crls</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_x509_crl_t * <var>crl_list</var>, int <var>crl_size</var>, unsigned int <var>flags</var>, unsigned int <var>verification_flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>crl_list</var>: A list of CRLs
</p>
<p><var>crl_size</var>: The length of the CRL list
</p>
<p><var>flags</var>: if GNUTLS_TL_VERIFY_CRL is given the CRLs will be verified before being added.
</p>
<p><var>verification_flags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate revocation lists
to the trusted list. The list of CRLs must not be deinitialized
during this structure&rsquo;s lifetime.
</p>
<p>This function must be called after <code>gnutls_x509_trust_list_add_cas()</code> 
to allow verifying the CRLs for validity. If the flag <code>GNUTLS_TL_NO_DUPLICATES</code> 
is given, then any provided CRLs that are a duplicate, will be deinitialized
and not added to the list (that assumes that <code>gnutls_x509_trust_list_deinit()</code> 
will be called with all=1).
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fnamed_005fcrt-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_named_crt</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fnamed_005fcrt"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fnamed_005fcrt-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_named_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t <var>cert</var>, const void * <var>name</var>, size_t <var>name_size</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert</var>: A certificate
</p>
<p><var>name</var>: An identifier for the certificate
</p>
<p><var>name_size</var>: The size of the identifier
</p>
<p><var>flags</var>: should be 0.
</p>
<p>This function will add the given certificate to the trusted
list and associate it with a name. The certificate will not be
be used for verification with <code>gnutls_x509_trust_list_verify_crt()</code> 
but with <code>gnutls_x509_trust_list_verify_named_crt()</code>  or
<code>gnutls_x509_trust_list_verify_crt2()</code>  - the latter only since
GnuTLS 3.4.0 and if a hostname is provided.
</p>
<p>In principle this function can be used to set individual &quot;server&quot;
certificates that are trusted by the user for that specific server
but for no other purposes.
</p>
<p>The certificate must not be deinitialized during the lifetime
of the trusted list.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fsystem_005ftrust-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_system_trust</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005fsystem_005ftrust"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005fsystem_005ftrust-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_system_trust</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The structure of the list
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function adds the system&rsquo;s default trusted certificate
authorities to the trusted list. Note that on unsupported systems
this function returns <code>GNUTLS_E_UNIMPLEMENTED_FEATURE</code> .
</p>
<p>This function implies the flag <code>GNUTLS_TL_NO_DUPLICATES</code> .
</p>
<p><strong>Returns:</strong> The number of added elements or a negative error code on error.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fdir-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_trust_dir</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fdir"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fdir"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_trust_dir</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const char * <var>ca_dir</var>, const char * <var>crl_dir</var>, gnutls_x509_crt_fmt_t <var>type</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>ca_dir</var>: A directory containing the CAs (optional)
</p>
<p><var>crl_dir</var>: A directory containing a list of CRLs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate authorities
to the trusted list. Only directories are accepted by
this function.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.3.6
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005ffile-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_trust_file</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005ffile"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005ffile-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_trust_file</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const char * <var>ca_file</var>, const char * <var>crl_file</var>, gnutls_x509_crt_fmt_t <var>type</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>ca_file</var>: A file containing a list of CAs (optional)
</p>
<p><var>crl_file</var>: A file containing a list of CRLs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate authorities
to the trusted list. PKCS <code>11</code>  URLs are also accepted, instead
of files, by this function. A PKCS <code>11</code>  URL implies a trust
database (a specially marked module in p11-kit); the URL &quot;pkcs11:&quot;
implies all trust databases in the system. Only a single URL specifying
trust databases can be set; they cannot be stacked with multiple calls.
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fmem-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_add_trust_mem</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fmem"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fadd_005ftrust_005fmem-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_add_trust_mem</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_datum_t * <var>cas</var>, const gnutls_datum_t * <var>crls</var>, gnutls_x509_crt_fmt_t <var>type</var>, unsigned int <var>tl_flags</var>, unsigned int <var>tl_vflags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cas</var>: A buffer containing a list of CAs (optional)
</p>
<p><var>crls</var>: A buffer containing a list of CRLs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p><var>tl_flags</var>: GNUTLS_TL_*
</p>
<p><var>tl_vflags</var>: gnutls_certificate_verify_flags if flags specifies GNUTLS_TL_VERIFY_CRL
</p>
<p>This function will add the given certificate authorities
to the trusted list. 
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.1
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_deinit</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_trust_list_deinit</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, unsigned int <var>all</var>)</em></dt>
<dd><p><var>list</var>: The list to be deinitialized
</p>
<p><var>all</var>: if non-zero it will deinitialize all the certificates and CRLs contained in the structure.
</p>
<p>This function will deinitialize a trust list. Note that the
 <code>all</code> flag should be typically non-zero unless you have specified
your certificates using <code>gnutls_x509_trust_list_add_cas()</code>  and you
want to prevent them from being deinitialized by this function.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_get_issuer</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fget_005fissuer"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_get_issuer</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t <var>cert</var>, gnutls_x509_crt_t * <var>issuer</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert</var>: is the certificate to find issuer for
</p>
<p><var>issuer</var>: Will hold the issuer if any. Should be treated as constant.
</p>
<p><var>flags</var>: Use zero or <code>GNUTLS_TL_GET_COPY</code> 
</p>
<p>This function will find the issuer of the given certificate.
If the flag <code>GNUTLS_TL_GET_COPY</code>  is specified a copy of the issuer
will be returned which must be freed using <code>gnutls_x509_crt_deinit()</code> .
Note that the flag <code>GNUTLS_TL_GET_COPY</code>  is required for this function
to work with PKCS <code>11</code>  trust lists in a thread-safe way.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fdn-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_get_issuer_by_dn</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fdn"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fdn"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_get_issuer_by_dn</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_datum_t * <var>dn</var>, gnutls_x509_crt_t * <var>issuer</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>dn</var>: is the issuer&rsquo;s DN
</p>
<p><var>issuer</var>: Will hold the issuer if any. Should be deallocated after use.
</p>
<p><var>flags</var>: Use zero
</p>
<p>This function will find the issuer with the given name, and
return a copy of the issuer, which must be freed using <code>gnutls_x509_crt_deinit()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fsubject_005fkey_005fid-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_get_issuer_by_subject_key_id</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fsubject_005fkey_005fid"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fget_005fissuer_005fby_005fsubject_005fkey_005fid"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_get_issuer_by_subject_key_id</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_datum_t * <var>dn</var>, const gnutls_datum_t * <var>spki</var>, gnutls_x509_crt_t * <var>issuer</var>, unsigned int <var>flags</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>dn</var>: is the issuer&rsquo;s DN (may be <code>NULL</code> )
</p>
<p><var>spki</var>: is the subject key ID
</p>
<p><var>issuer</var>: Will hold the issuer if any. Should be deallocated after use.
</p>
<p><var>flags</var>: Use zero
</p>
<p>This function will find the issuer with the given name and subject key ID, and
return a copy of the issuer, which must be freed using <code>gnutls_x509_crt_deinit()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.2
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005finit-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_init</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005finit"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005finit"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_init</strong> <em>(gnutls_x509_trust_list_t * <var>list</var>, unsigned int <var>size</var>)</em></dt>
<dd><p><var>list</var>: A pointer to the type to be initialized
</p>
<p><var>size</var>: The size of the internal hash table. Use (0) for default size.
</p>
<p>This function will initialize an X.509 trust list structure.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fiter_005fdeinit-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_iter_deinit</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fiter_005fdeinit"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fiter_005fdeinit"></a>Function: <em>void</em> <strong>gnutls_x509_trust_list_iter_deinit</strong> <em>(gnutls_x509_trust_list_iter_t <var>iter</var>)</em></dt>
<dd><p><var>iter</var>: The iterator structure to be deinitialized
</p>
<p>This function will deinitialize an iterator structure.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fiter_005fget_005fca-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_iter_get_ca</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fiter_005fget_005fca"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fiter_005fget_005fca"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_iter_get_ca</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_trust_list_iter_t * <var>iter</var>, gnutls_x509_crt_t * <var>crt</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>iter</var>: A pointer to an iterator (initially the iterator should be <code>NULL</code> )
</p>
<p><var>crt</var>: where the certificate will be copied
</p>
<p>This function obtains a certificate in the trust list and advances the
iterator to the next certificate. The certificate returned in  <code>crt</code> must be
deallocated with <code>gnutls_x509_crt_deinit()</code> .
</p>
<p>When past the last element is accessed <code>GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE</code> 
is returned and the iterator is reset.
</p>
<p>After use, the iterator must be deinitialized usin
<code>gnutls_x509_trust_list_iter_deinit()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.4.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005fcas-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_remove_cas</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005fcas"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fremove_005fcas"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_remove_cas</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_x509_crt_t * <var>clist</var>, int <var>clist_size</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>clist</var>: A list of CAs
</p>
<p><var>clist_size</var>: The length of the CA list
</p>
<p>This function will remove the given certificate authorities
from the trusted list.
</p>
<p>Note that this function can accept certificates and authorities
not yet known. In that case they will be kept in a separate
black list that will be used during certificate verification.
Unlike <code>gnutls_x509_trust_list_add_cas()</code>  there is no deinitialization
restriction for  certificate list provided in this function.
</p>
<p><strong>Returns:</strong> The number of removed elements is returned.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005ffile-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_remove_trust_file</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005ffile"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005ffile"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_remove_trust_file</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const char * <var>ca_file</var>, gnutls_x509_crt_fmt_t <var>type</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>ca_file</var>: A file containing a list of CAs
</p>
<p><var>type</var>: The format of the certificates
</p>
<p>This function will remove the given certificate authorities
from the trusted list, and add them into a black list when needed. 
PKCS 11 URLs are also accepted, instead
of files, by this function.
</p>
<p>See also <code>gnutls_x509_trust_list_remove_cas()</code> .
</p>
<p><strong>Returns:</strong> The number of added elements is returned.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005fmem-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_remove_trust_mem</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005fmem"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fremove_005ftrust_005fmem"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_remove_trust_mem</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, const gnutls_datum_t * <var>cas</var>, gnutls_x509_crt_fmt_t <var>type</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cas</var>: A buffer containing a list of CAs (optional)
</p>
<p><var>type</var>: The format of the certificates
</p>
<p>This function will remove the provided certificate authorities
from the trusted list, and add them into a black list when needed. 
</p>
<p>See also <code>gnutls_x509_trust_list_remove_cas()</code> .
</p>
<p><strong>Returns:</strong> The number of removed elements is returned.
</p>
<p><strong>Since:</strong> 3.1.10
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_verify_crt</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t * <var>cert_list</var>, unsigned int <var>cert_list_size</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert_list</var>: is the certificate list to be verified
</p>
<p><var>cert_list_size</var>: is the certificate list size
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will try to verify the given certificate and return
its status. The  <code>voutput</code> parameter will hold an OR&rsquo;ed sequence of
<code>gnutls_certificate_status_t</code>  flags.
</p>
<p>The details of the verification are the same as in <code>gnutls_x509_trust_list_verify_crt2()</code> .
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt2-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_verify_crt2</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt2"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fcrt2-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_crt2</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t * <var>cert_list</var>, unsigned int <var>cert_list_size</var>, gnutls_typed_vdata_st * <var>data</var>, unsigned int <var>elements</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert_list</var>: is the certificate list to be verified
</p>
<p><var>cert_list_size</var>: is the certificate list size
</p>
<p><var>data</var>: an array of typed data
</p>
<p><var>elements</var>: the number of data elements
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will attempt to verify the given certificate and return
its status. The  <code>voutput</code> parameter will hold an OR&rsquo;ed sequence of
<code>gnutls_certificate_status_t</code>  flags. When a chain of  <code>cert_list_size</code> with 
more than one certificates is provided, the verification status will apply
to the first certificate in the chain that failed verification. The
verification process starts from the end of the chain (from CA to end
certificate).
</p>
<p>Additionally a certificate verification profile can be specified
from the ones in <code>gnutls_certificate_verification_profiles_t</code>  by
ORing the result of <code>GNUTLS_PROFILE_TO_VFLAGS()</code>  to the verification
flags.
</p>
<p>The acceptable  <code>data</code> types are <code>GNUTLS_DT_DNS_HOSTNAME</code>  and <code>GNUTLS_DT_KEY_PURPOSE_OID</code> .
The former accepts as data a null-terminated hostname, and the latter a null-terminated
object identifier (e.g., <code>GNUTLS_KP_TLS_WWW_SERVER</code> ).
If a DNS hostname is provided then this function will compare
the hostname in the certificate against the given. If names do not match the 
<code>GNUTLS_CERT_UNEXPECTED_OWNER</code>  status flag will be set. In addition it
will consider certificates provided with <code>gnutls_x509_trust_list_add_named_crt()</code> .
</p>
<p>If a key purpose OID is provided and the end-certificate contains the extended key
usage PKIX extension, it will be required to match the provided OID
or be marked for any purpose, otherwise verification will fail with 
<code>GNUTLS_CERT_PURPOSE_MISMATCH</code>  status.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value. Note that verification failure will not result to an
error code, only  <code>voutput</code> will be updated.
</p>
<p><strong>Since:</strong> 3.3.8
</p></dd></dl>

<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fnamed_005fcrt-1"></a>
<h4 class="subheading">gnutls_x509_trust_list_verify_named_crt</h4>
<a name="gnutls_005fx509_005ftrust_005flist_005fverify_005fnamed_005fcrt"></a><dl>
<dt><a name="index-gnutls_005fx509_005ftrust_005flist_005fverify_005fnamed_005fcrt-1"></a>Function: <em>int</em> <strong>gnutls_x509_trust_list_verify_named_crt</strong> <em>(gnutls_x509_trust_list_t <var>list</var>, gnutls_x509_crt_t <var>cert</var>, const void * <var>name</var>, size_t <var>name_size</var>, unsigned int <var>flags</var>, unsigned int * <var>voutput</var>, gnutls_verify_output_function <var>func</var>)</em></dt>
<dd><p><var>list</var>: The list
</p>
<p><var>cert</var>: is the certificate to be verified
</p>
<p><var>name</var>: is the certificate&rsquo;s name
</p>
<p><var>name_size</var>: is the certificate&rsquo;s name size
</p>
<p><var>flags</var>: Flags that may be used to change the verification algorithm. Use OR of the gnutls_certificate_verify_flags enumerations.
</p>
<p><var>voutput</var>: will hold the certificate verification output.
</p>
<p><var>func</var>: If non-null will be called on each chain element verification with the output.
</p>
<p>This function will try to find a certificate that is associated with the provided
name &ndash;see <code>gnutls_x509_trust_list_add_named_crt()</code> . If a match is found the
certificate is considered valid. In addition to that this function will also 
check CRLs. The  <code>voutput</code> parameter will hold an OR&rsquo;ed sequence of 
<code>gnutls_certificate_status_t</code>  flags.
</p>
<p>Additionally a certificate verification profile can be specified
from the ones in <code>gnutls_certificate_verification_profiles_t</code>  by
ORing the result of <code>GNUTLS_PROFILE_TO_VFLAGS()</code>  to the verification
flags.
</p>
<p><strong>Returns:</strong> On success, <code>GNUTLS_E_SUCCESS</code>  (0) is returned, otherwise a
negative error value.
</p>
<p><strong>Since:</strong> 3.0.0
</p></dd></dl>


<hr>
<div class="header">
<p>
Next: <a href="PKCS-7-API.html#PKCS-7-API" accesskey="n" rel="next">PKCS 7 API</a>, Previous: <a href="Datagram-TLS-API.html#Datagram-TLS-API" accesskey="p" rel="prev">Datagram TLS API</a>, Up: <a href="API-reference.html#API-reference" accesskey="u" rel="up">API reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Data-Index.html#Function-and-Data-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>