17# define OPENSSL_X509_H
20# include <openssl/macros.h>
21# ifndef OPENSSL_NO_DEPRECATED_3_0
25# include <openssl/e_os2.h>
26# include <openssl/types.h>
27# include <openssl/symhacks.h>
28# include <openssl/buffer.h>
29# include <openssl/evp.h>
30# include <openssl/bio.h>
31# include <openssl/asn1.h>
32# include <openssl/safestack.h>
33# include <openssl/ec.h>
35# ifndef OPENSSL_NO_DEPRECATED_1_1_0
36# include <openssl/rsa.h>
37# include <openssl/dsa.h>
38# include <openssl/dh.h>
41# include <openssl/sha.h>
42# include <openssl/x509err.h>
49SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME, X509_NAME, X509_NAME)
50#define sk_X509_NAME_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_sk_type(sk))
51#define sk_X509_NAME_value(sk, idx) ((X509_NAME *)OPENSSL_sk_value(ossl_check_const_X509_NAME_sk_type(sk), (idx)))
52#define sk_X509_NAME_new(cmp) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new(ossl_check_X509_NAME_compfunc_type(cmp)))
53#define sk_X509_NAME_new_null() ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_null())
54#define sk_X509_NAME_new_reserve(cmp, n) ((STACK_OF(X509_NAME) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_compfunc_type(cmp), (n)))
55#define sk_X509_NAME_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_sk_type(sk), (n))
56#define sk_X509_NAME_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_sk_type(sk))
57#define sk_X509_NAME_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_sk_type(sk))
58#define sk_X509_NAME_delete(sk, i) ((X509_NAME *)OPENSSL_sk_delete(ossl_check_X509_NAME_sk_type(sk), (i)))
59#define sk_X509_NAME_delete_ptr(sk, ptr) ((X509_NAME *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr)))
60#define sk_X509_NAME_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
61#define sk_X509_NAME_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
62#define sk_X509_NAME_pop(sk) ((X509_NAME *)OPENSSL_sk_pop(ossl_check_X509_NAME_sk_type(sk)))
63#define sk_X509_NAME_shift(sk) ((X509_NAME *)OPENSSL_sk_shift(ossl_check_X509_NAME_sk_type(sk)))
64#define sk_X509_NAME_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_sk_type(sk),ossl_check_X509_NAME_freefunc_type(freefunc))
65#define sk_X509_NAME_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), (idx))
66#define sk_X509_NAME_set(sk, idx, ptr) ((X509_NAME *)OPENSSL_sk_set(ossl_check_X509_NAME_sk_type(sk), (idx), ossl_check_X509_NAME_type(ptr)))
67#define sk_X509_NAME_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
68#define sk_X509_NAME_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr))
69#define sk_X509_NAME_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_type(ptr), pnum)
70#define sk_X509_NAME_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_sk_type(sk))
71#define sk_X509_NAME_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_sk_type(sk))
72#define sk_X509_NAME_dup(sk) ((STACK_OF(X509_NAME) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_sk_type(sk)))
73#define sk_X509_NAME_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_sk_type(sk), ossl_check_X509_NAME_copyfunc_type(copyfunc), ossl_check_X509_NAME_freefunc_type(freefunc)))
74#define sk_X509_NAME_set_cmp_func(sk, cmp) ((sk_X509_NAME_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_sk_type(sk), ossl_check_X509_NAME_compfunc_type(cmp)))
75SKM_DEFINE_STACK_OF_INTERNAL(X509, X509, X509)
76#define sk_X509_num(sk) OPENSSL_sk_num(ossl_check_const_X509_sk_type(sk))
77#define sk_X509_value(sk, idx) ((X509 *)OPENSSL_sk_value(ossl_check_const_X509_sk_type(sk), (idx)))
78#define sk_X509_new(cmp) ((STACK_OF(X509) *)OPENSSL_sk_new(ossl_check_X509_compfunc_type(cmp)))
79#define sk_X509_new_null() ((STACK_OF(X509) *)OPENSSL_sk_new_null())
80#define sk_X509_new_reserve(cmp, n) ((STACK_OF(X509) *)OPENSSL_sk_new_reserve(ossl_check_X509_compfunc_type(cmp), (n)))
81#define sk_X509_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_sk_type(sk), (n))
82#define sk_X509_free(sk) OPENSSL_sk_free(ossl_check_X509_sk_type(sk))
83#define sk_X509_zero(sk) OPENSSL_sk_zero(ossl_check_X509_sk_type(sk))
84#define sk_X509_delete(sk, i) ((X509 *)OPENSSL_sk_delete(ossl_check_X509_sk_type(sk), (i)))
85#define sk_X509_delete_ptr(sk, ptr) ((X509 *)OPENSSL_sk_delete_ptr(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr)))
86#define sk_X509_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
87#define sk_X509_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
88#define sk_X509_pop(sk) ((X509 *)OPENSSL_sk_pop(ossl_check_X509_sk_type(sk)))
89#define sk_X509_shift(sk) ((X509 *)OPENSSL_sk_shift(ossl_check_X509_sk_type(sk)))
90#define sk_X509_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_sk_type(sk),ossl_check_X509_freefunc_type(freefunc))
91#define sk_X509_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), (idx))
92#define sk_X509_set(sk, idx, ptr) ((X509 *)OPENSSL_sk_set(ossl_check_X509_sk_type(sk), (idx), ossl_check_X509_type(ptr)))
93#define sk_X509_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
94#define sk_X509_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr))
95#define sk_X509_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_sk_type(sk), ossl_check_X509_type(ptr), pnum)
96#define sk_X509_sort(sk) OPENSSL_sk_sort(ossl_check_X509_sk_type(sk))
97#define sk_X509_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_sk_type(sk))
98#define sk_X509_dup(sk) ((STACK_OF(X509) *)OPENSSL_sk_dup(ossl_check_const_X509_sk_type(sk)))
99#define sk_X509_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_sk_type(sk), ossl_check_X509_copyfunc_type(copyfunc), ossl_check_X509_freefunc_type(freefunc)))
100#define sk_X509_set_cmp_func(sk, cmp) ((sk_X509_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_sk_type(sk), ossl_check_X509_compfunc_type(cmp)))
101SKM_DEFINE_STACK_OF_INTERNAL(X509_REVOKED, X509_REVOKED, X509_REVOKED)
102#define sk_X509_REVOKED_num(sk) OPENSSL_sk_num(ossl_check_const_X509_REVOKED_sk_type(sk))
103#define sk_X509_REVOKED_value(sk, idx) ((X509_REVOKED *)OPENSSL_sk_value(ossl_check_const_X509_REVOKED_sk_type(sk), (idx)))
104#define sk_X509_REVOKED_new(cmp) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new(ossl_check_X509_REVOKED_compfunc_type(cmp)))
105#define sk_X509_REVOKED_new_null() ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_null())
106#define sk_X509_REVOKED_new_reserve(cmp, n) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_new_reserve(ossl_check_X509_REVOKED_compfunc_type(cmp), (n)))
107#define sk_X509_REVOKED_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_REVOKED_sk_type(sk), (n))
108#define sk_X509_REVOKED_free(sk) OPENSSL_sk_free(ossl_check_X509_REVOKED_sk_type(sk))
109#define sk_X509_REVOKED_zero(sk) OPENSSL_sk_zero(ossl_check_X509_REVOKED_sk_type(sk))
110#define sk_X509_REVOKED_delete(sk, i) ((X509_REVOKED *)OPENSSL_sk_delete(ossl_check_X509_REVOKED_sk_type(sk), (i)))
111#define sk_X509_REVOKED_delete_ptr(sk, ptr) ((X509_REVOKED *)OPENSSL_sk_delete_ptr(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr)))
112#define sk_X509_REVOKED_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
113#define sk_X509_REVOKED_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
114#define sk_X509_REVOKED_pop(sk) ((X509_REVOKED *)OPENSSL_sk_pop(ossl_check_X509_REVOKED_sk_type(sk)))
115#define sk_X509_REVOKED_shift(sk) ((X509_REVOKED *)OPENSSL_sk_shift(ossl_check_X509_REVOKED_sk_type(sk)))
116#define sk_X509_REVOKED_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_REVOKED_sk_type(sk),ossl_check_X509_REVOKED_freefunc_type(freefunc))
117#define sk_X509_REVOKED_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), (idx))
118#define sk_X509_REVOKED_set(sk, idx, ptr) ((X509_REVOKED *)OPENSSL_sk_set(ossl_check_X509_REVOKED_sk_type(sk), (idx), ossl_check_X509_REVOKED_type(ptr)))
119#define sk_X509_REVOKED_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
120#define sk_X509_REVOKED_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr))
121#define sk_X509_REVOKED_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_type(ptr), pnum)
122#define sk_X509_REVOKED_sort(sk) OPENSSL_sk_sort(ossl_check_X509_REVOKED_sk_type(sk))
123#define sk_X509_REVOKED_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_REVOKED_sk_type(sk))
124#define sk_X509_REVOKED_dup(sk) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_dup(ossl_check_const_X509_REVOKED_sk_type(sk)))
125#define sk_X509_REVOKED_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_REVOKED) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_copyfunc_type(copyfunc), ossl_check_X509_REVOKED_freefunc_type(freefunc)))
126#define sk_X509_REVOKED_set_cmp_func(sk, cmp) ((sk_X509_REVOKED_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_REVOKED_sk_type(sk), ossl_check_X509_REVOKED_compfunc_type(cmp)))
127SKM_DEFINE_STACK_OF_INTERNAL(X509_CRL, X509_CRL, X509_CRL)
128#define sk_X509_CRL_num(sk) OPENSSL_sk_num(ossl_check_const_X509_CRL_sk_type(sk))
129#define sk_X509_CRL_value(sk, idx) ((X509_CRL *)OPENSSL_sk_value(ossl_check_const_X509_CRL_sk_type(sk), (idx)))
130#define sk_X509_CRL_new(cmp) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new(ossl_check_X509_CRL_compfunc_type(cmp)))
131#define sk_X509_CRL_new_null() ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_null())
132#define sk_X509_CRL_new_reserve(cmp, n) ((STACK_OF(X509_CRL) *)OPENSSL_sk_new_reserve(ossl_check_X509_CRL_compfunc_type(cmp), (n)))
133#define sk_X509_CRL_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_CRL_sk_type(sk), (n))
134#define sk_X509_CRL_free(sk) OPENSSL_sk_free(ossl_check_X509_CRL_sk_type(sk))
135#define sk_X509_CRL_zero(sk) OPENSSL_sk_zero(ossl_check_X509_CRL_sk_type(sk))
136#define sk_X509_CRL_delete(sk, i) ((X509_CRL *)OPENSSL_sk_delete(ossl_check_X509_CRL_sk_type(sk), (i)))
137#define sk_X509_CRL_delete_ptr(sk, ptr) ((X509_CRL *)OPENSSL_sk_delete_ptr(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr)))
138#define sk_X509_CRL_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
139#define sk_X509_CRL_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
140#define sk_X509_CRL_pop(sk) ((X509_CRL *)OPENSSL_sk_pop(ossl_check_X509_CRL_sk_type(sk)))
141#define sk_X509_CRL_shift(sk) ((X509_CRL *)OPENSSL_sk_shift(ossl_check_X509_CRL_sk_type(sk)))
142#define sk_X509_CRL_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_CRL_sk_type(sk),ossl_check_X509_CRL_freefunc_type(freefunc))
143#define sk_X509_CRL_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), (idx))
144#define sk_X509_CRL_set(sk, idx, ptr) ((X509_CRL *)OPENSSL_sk_set(ossl_check_X509_CRL_sk_type(sk), (idx), ossl_check_X509_CRL_type(ptr)))
145#define sk_X509_CRL_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
146#define sk_X509_CRL_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr))
147#define sk_X509_CRL_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_type(ptr), pnum)
148#define sk_X509_CRL_sort(sk) OPENSSL_sk_sort(ossl_check_X509_CRL_sk_type(sk))
149#define sk_X509_CRL_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_CRL_sk_type(sk))
150#define sk_X509_CRL_dup(sk) ((STACK_OF(X509_CRL) *)OPENSSL_sk_dup(ossl_check_const_X509_CRL_sk_type(sk)))
151#define sk_X509_CRL_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_CRL) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_CRL_sk_type(sk), ossl_check_X509_CRL_copyfunc_type(copyfunc), ossl_check_X509_CRL_freefunc_type(freefunc)))
152#define sk_X509_CRL_set_cmp_func(sk, cmp) ((sk_X509_CRL_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_CRL_sk_type(sk), ossl_check_X509_CRL_compfunc_type(cmp)))
157# define X509_SIG_INFO_VALID 0x1
159# define X509_SIG_INFO_TLS 0x2
161# define X509_FILETYPE_PEM 1
162# define X509_FILETYPE_ASN1 2
163# define X509_FILETYPE_DEFAULT 3
165# define X509v3_KU_DIGITAL_SIGNATURE 0x0080
166# define X509v3_KU_NON_REPUDIATION 0x0040
167# define X509v3_KU_KEY_ENCIPHERMENT 0x0020
168# define X509v3_KU_DATA_ENCIPHERMENT 0x0010
169# define X509v3_KU_KEY_AGREEMENT 0x0008
170# define X509v3_KU_KEY_CERT_SIGN 0x0004
171# define X509v3_KU_CRL_SIGN 0x0002
172# define X509v3_KU_ENCIPHER_ONLY 0x0001
173# define X509v3_KU_DECIPHER_ONLY 0x8000
174# define X509v3_KU_UNDEF 0xffff
177 ASN1_OBJECT *algorithm;
178 ASN1_TYPE *parameter;
181typedef STACK_OF(X509_ALGOR) X509_ALGORS;
184 ASN1_TIME *notBefore;
188typedef struct X509_sig_st X509_SIG;
190typedef struct X509_name_entry_st X509_NAME_ENTRY;
192SKM_DEFINE_STACK_OF_INTERNAL(X509_NAME_ENTRY, X509_NAME_ENTRY, X509_NAME_ENTRY)
193#define sk_X509_NAME_ENTRY_num(sk) OPENSSL_sk_num(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
194#define sk_X509_NAME_ENTRY_value(sk, idx) ((X509_NAME_ENTRY *)OPENSSL_sk_value(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), (idx)))
195#define sk_X509_NAME_ENTRY_new(cmp) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
196#define sk_X509_NAME_ENTRY_new_null() ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_null())
197#define sk_X509_NAME_ENTRY_new_reserve(cmp, n) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_new_reserve(ossl_check_X509_NAME_ENTRY_compfunc_type(cmp), (n)))
198#define sk_X509_NAME_ENTRY_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_NAME_ENTRY_sk_type(sk), (n))
199#define sk_X509_NAME_ENTRY_free(sk) OPENSSL_sk_free(ossl_check_X509_NAME_ENTRY_sk_type(sk))
200#define sk_X509_NAME_ENTRY_zero(sk) OPENSSL_sk_zero(ossl_check_X509_NAME_ENTRY_sk_type(sk))
201#define sk_X509_NAME_ENTRY_delete(sk, i) ((X509_NAME_ENTRY *)OPENSSL_sk_delete(ossl_check_X509_NAME_ENTRY_sk_type(sk), (i)))
202#define sk_X509_NAME_ENTRY_delete_ptr(sk, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_delete_ptr(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr)))
203#define sk_X509_NAME_ENTRY_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
204#define sk_X509_NAME_ENTRY_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
205#define sk_X509_NAME_ENTRY_pop(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_pop(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
206#define sk_X509_NAME_ENTRY_shift(sk) ((X509_NAME_ENTRY *)OPENSSL_sk_shift(ossl_check_X509_NAME_ENTRY_sk_type(sk)))
207#define sk_X509_NAME_ENTRY_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_NAME_ENTRY_sk_type(sk),ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc))
208#define sk_X509_NAME_ENTRY_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), (idx))
209#define sk_X509_NAME_ENTRY_set(sk, idx, ptr) ((X509_NAME_ENTRY *)OPENSSL_sk_set(ossl_check_X509_NAME_ENTRY_sk_type(sk), (idx), ossl_check_X509_NAME_ENTRY_type(ptr)))
210#define sk_X509_NAME_ENTRY_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
211#define sk_X509_NAME_ENTRY_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr))
212#define sk_X509_NAME_ENTRY_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_type(ptr), pnum)
213#define sk_X509_NAME_ENTRY_sort(sk) OPENSSL_sk_sort(ossl_check_X509_NAME_ENTRY_sk_type(sk))
214#define sk_X509_NAME_ENTRY_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_NAME_ENTRY_sk_type(sk))
215#define sk_X509_NAME_ENTRY_dup(sk) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_dup(ossl_check_const_X509_NAME_ENTRY_sk_type(sk)))
216#define sk_X509_NAME_ENTRY_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_NAME_ENTRY) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_copyfunc_type(copyfunc), ossl_check_X509_NAME_ENTRY_freefunc_type(freefunc)))
217#define sk_X509_NAME_ENTRY_set_cmp_func(sk, cmp) ((sk_X509_NAME_ENTRY_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_NAME_ENTRY_sk_type(sk), ossl_check_X509_NAME_ENTRY_compfunc_type(cmp)))
220# define X509_EX_V_NETSCAPE_HACK 0x8000
221# define X509_EX_V_INIT 0x0001
222typedef struct X509_extension_st X509_EXTENSION;
223SKM_DEFINE_STACK_OF_INTERNAL(X509_EXTENSION, X509_EXTENSION, X509_EXTENSION)
224#define sk_X509_EXTENSION_num(sk) OPENSSL_sk_num(ossl_check_const_X509_EXTENSION_sk_type(sk))
225#define sk_X509_EXTENSION_value(sk, idx) ((X509_EXTENSION *)OPENSSL_sk_value(ossl_check_const_X509_EXTENSION_sk_type(sk), (idx)))
226#define sk_X509_EXTENSION_new(cmp) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new(ossl_check_X509_EXTENSION_compfunc_type(cmp)))
227#define sk_X509_EXTENSION_new_null() ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_null())
228#define sk_X509_EXTENSION_new_reserve(cmp, n) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_new_reserve(ossl_check_X509_EXTENSION_compfunc_type(cmp), (n)))
229#define sk_X509_EXTENSION_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_EXTENSION_sk_type(sk), (n))
230#define sk_X509_EXTENSION_free(sk) OPENSSL_sk_free(ossl_check_X509_EXTENSION_sk_type(sk))
231#define sk_X509_EXTENSION_zero(sk) OPENSSL_sk_zero(ossl_check_X509_EXTENSION_sk_type(sk))
232#define sk_X509_EXTENSION_delete(sk, i) ((X509_EXTENSION *)OPENSSL_sk_delete(ossl_check_X509_EXTENSION_sk_type(sk), (i)))
233#define sk_X509_EXTENSION_delete_ptr(sk, ptr) ((X509_EXTENSION *)OPENSSL_sk_delete_ptr(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr)))
234#define sk_X509_EXTENSION_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
235#define sk_X509_EXTENSION_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
236#define sk_X509_EXTENSION_pop(sk) ((X509_EXTENSION *)OPENSSL_sk_pop(ossl_check_X509_EXTENSION_sk_type(sk)))
237#define sk_X509_EXTENSION_shift(sk) ((X509_EXTENSION *)OPENSSL_sk_shift(ossl_check_X509_EXTENSION_sk_type(sk)))
238#define sk_X509_EXTENSION_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_EXTENSION_sk_type(sk),ossl_check_X509_EXTENSION_freefunc_type(freefunc))
239#define sk_X509_EXTENSION_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), (idx))
240#define sk_X509_EXTENSION_set(sk, idx, ptr) ((X509_EXTENSION *)OPENSSL_sk_set(ossl_check_X509_EXTENSION_sk_type(sk), (idx), ossl_check_X509_EXTENSION_type(ptr)))
241#define sk_X509_EXTENSION_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
242#define sk_X509_EXTENSION_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr))
243#define sk_X509_EXTENSION_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_type(ptr), pnum)
244#define sk_X509_EXTENSION_sort(sk) OPENSSL_sk_sort(ossl_check_X509_EXTENSION_sk_type(sk))
245#define sk_X509_EXTENSION_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_EXTENSION_sk_type(sk))
246#define sk_X509_EXTENSION_dup(sk) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_dup(ossl_check_const_X509_EXTENSION_sk_type(sk)))
247#define sk_X509_EXTENSION_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_EXTENSION) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_copyfunc_type(copyfunc), ossl_check_X509_EXTENSION_freefunc_type(freefunc)))
248#define sk_X509_EXTENSION_set_cmp_func(sk, cmp) ((sk_X509_EXTENSION_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_EXTENSION_sk_type(sk), ossl_check_X509_EXTENSION_compfunc_type(cmp)))
250typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
251typedef struct x509_attributes_st X509_ATTRIBUTE;
252SKM_DEFINE_STACK_OF_INTERNAL(X509_ATTRIBUTE, X509_ATTRIBUTE, X509_ATTRIBUTE)
253#define sk_X509_ATTRIBUTE_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
254#define sk_X509_ATTRIBUTE_value(sk, idx) ((X509_ATTRIBUTE *)OPENSSL_sk_value(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), (idx)))
255#define sk_X509_ATTRIBUTE_new(cmp) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
256#define sk_X509_ATTRIBUTE_new_null() ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_null())
257#define sk_X509_ATTRIBUTE_new_reserve(cmp, n) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_new_reserve(ossl_check_X509_ATTRIBUTE_compfunc_type(cmp), (n)))
258#define sk_X509_ATTRIBUTE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ATTRIBUTE_sk_type(sk), (n))
259#define sk_X509_ATTRIBUTE_free(sk) OPENSSL_sk_free(ossl_check_X509_ATTRIBUTE_sk_type(sk))
260#define sk_X509_ATTRIBUTE_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ATTRIBUTE_sk_type(sk))
261#define sk_X509_ATTRIBUTE_delete(sk, i) ((X509_ATTRIBUTE *)OPENSSL_sk_delete(ossl_check_X509_ATTRIBUTE_sk_type(sk), (i)))
262#define sk_X509_ATTRIBUTE_delete_ptr(sk, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_delete_ptr(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr)))
263#define sk_X509_ATTRIBUTE_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
264#define sk_X509_ATTRIBUTE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
265#define sk_X509_ATTRIBUTE_pop(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_pop(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
266#define sk_X509_ATTRIBUTE_shift(sk) ((X509_ATTRIBUTE *)OPENSSL_sk_shift(ossl_check_X509_ATTRIBUTE_sk_type(sk)))
267#define sk_X509_ATTRIBUTE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ATTRIBUTE_sk_type(sk),ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc))
268#define sk_X509_ATTRIBUTE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), (idx))
269#define sk_X509_ATTRIBUTE_set(sk, idx, ptr) ((X509_ATTRIBUTE *)OPENSSL_sk_set(ossl_check_X509_ATTRIBUTE_sk_type(sk), (idx), ossl_check_X509_ATTRIBUTE_type(ptr)))
270#define sk_X509_ATTRIBUTE_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
271#define sk_X509_ATTRIBUTE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr))
272#define sk_X509_ATTRIBUTE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_type(ptr), pnum)
273#define sk_X509_ATTRIBUTE_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ATTRIBUTE_sk_type(sk))
274#define sk_X509_ATTRIBUTE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ATTRIBUTE_sk_type(sk))
275#define sk_X509_ATTRIBUTE_dup(sk) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_dup(ossl_check_const_X509_ATTRIBUTE_sk_type(sk)))
276#define sk_X509_ATTRIBUTE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ATTRIBUTE) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_copyfunc_type(copyfunc), ossl_check_X509_ATTRIBUTE_freefunc_type(freefunc)))
277#define sk_X509_ATTRIBUTE_set_cmp_func(sk, cmp) ((sk_X509_ATTRIBUTE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ATTRIBUTE_sk_type(sk), ossl_check_X509_ATTRIBUTE_compfunc_type(cmp)))
279typedef struct X509_req_info_st X509_REQ_INFO;
280typedef struct X509_req_st X509_REQ;
281typedef struct x509_cert_aux_st X509_CERT_AUX;
282typedef struct x509_cinf_st X509_CINF;
286# define X509_FLAG_COMPAT 0
287# define X509_FLAG_NO_HEADER 1L
288# define X509_FLAG_NO_VERSION (1L << 1)
289# define X509_FLAG_NO_SERIAL (1L << 2)
290# define X509_FLAG_NO_SIGNAME (1L << 3)
291# define X509_FLAG_NO_ISSUER (1L << 4)
292# define X509_FLAG_NO_VALIDITY (1L << 5)
293# define X509_FLAG_NO_SUBJECT (1L << 6)
294# define X509_FLAG_NO_PUBKEY (1L << 7)
295# define X509_FLAG_NO_EXTENSIONS (1L << 8)
296# define X509_FLAG_NO_SIGDUMP (1L << 9)
297# define X509_FLAG_NO_AUX (1L << 10)
298# define X509_FLAG_NO_ATTRIBUTES (1L << 11)
299# define X509_FLAG_NO_IDS (1L << 12)
300# define X509_FLAG_EXTENSIONS_ONLY_KID (1L << 13)
306# define XN_FLAG_SEP_MASK (0xf << 16)
308# define XN_FLAG_COMPAT 0
309# define XN_FLAG_SEP_COMMA_PLUS (1 << 16)
310# define XN_FLAG_SEP_CPLUS_SPC (2 << 16)
311# define XN_FLAG_SEP_SPLUS_SPC (3 << 16)
312# define XN_FLAG_SEP_MULTILINE (4 << 16)
314# define XN_FLAG_DN_REV (1 << 20)
318# define XN_FLAG_FN_MASK (0x3 << 21)
320# define XN_FLAG_FN_SN 0
321# define XN_FLAG_FN_LN (1 << 21)
322# define XN_FLAG_FN_OID (2 << 21)
323# define XN_FLAG_FN_NONE (3 << 21)
325# define XN_FLAG_SPC_EQ (1 << 23)
332# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)
334# define XN_FLAG_FN_ALIGN (1 << 25)
339# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \
340 XN_FLAG_SEP_COMMA_PLUS | \
343 XN_FLAG_DUMP_UNKNOWN_FIELDS)
347# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \
348 ASN1_STRFLGS_ESC_QUOTE | \
349 XN_FLAG_SEP_CPLUS_SPC | \
355# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \
356 ASN1_STRFLGS_ESC_MSB | \
357 XN_FLAG_SEP_MULTILINE | \
362typedef struct X509_crl_info_st X509_CRL_INFO;
367 X509_ALGOR *enc_algor;
368 ASN1_OCTET_STRING *enc_pkey;
376 EVP_CIPHER_INFO cipher;
383 EVP_CIPHER_INFO enc_cipher;
388#define sk_X509_INFO_num(sk) OPENSSL_sk_num(ossl_check_const_X509_INFO_sk_type(sk))
389#define sk_X509_INFO_value(sk, idx) ((X509_INFO *)OPENSSL_sk_value(ossl_check_const_X509_INFO_sk_type(sk), (idx)))
390#define sk_X509_INFO_new(cmp) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new(ossl_check_X509_INFO_compfunc_type(cmp)))
391#define sk_X509_INFO_new_null() ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_null())
392#define sk_X509_INFO_new_reserve(cmp, n) ((STACK_OF(X509_INFO) *)OPENSSL_sk_new_reserve(ossl_check_X509_INFO_compfunc_type(cmp), (n)))
393#define sk_X509_INFO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_INFO_sk_type(sk), (n))
394#define sk_X509_INFO_free(sk) OPENSSL_sk_free(ossl_check_X509_INFO_sk_type(sk))
395#define sk_X509_INFO_zero(sk) OPENSSL_sk_zero(ossl_check_X509_INFO_sk_type(sk))
396#define sk_X509_INFO_delete(sk, i) ((X509_INFO *)OPENSSL_sk_delete(ossl_check_X509_INFO_sk_type(sk), (i)))
397#define sk_X509_INFO_delete_ptr(sk, ptr) ((X509_INFO *)OPENSSL_sk_delete_ptr(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr)))
398#define sk_X509_INFO_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
399#define sk_X509_INFO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
400#define sk_X509_INFO_pop(sk) ((X509_INFO *)OPENSSL_sk_pop(ossl_check_X509_INFO_sk_type(sk)))
401#define sk_X509_INFO_shift(sk) ((X509_INFO *)OPENSSL_sk_shift(ossl_check_X509_INFO_sk_type(sk)))
402#define sk_X509_INFO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_INFO_sk_type(sk),ossl_check_X509_INFO_freefunc_type(freefunc))
403#define sk_X509_INFO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), (idx))
404#define sk_X509_INFO_set(sk, idx, ptr) ((X509_INFO *)OPENSSL_sk_set(ossl_check_X509_INFO_sk_type(sk), (idx), ossl_check_X509_INFO_type(ptr)))
405#define sk_X509_INFO_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
406#define sk_X509_INFO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr))
407#define sk_X509_INFO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_type(ptr), pnum)
408#define sk_X509_INFO_sort(sk) OPENSSL_sk_sort(ossl_check_X509_INFO_sk_type(sk))
409#define sk_X509_INFO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_INFO_sk_type(sk))
410#define sk_X509_INFO_dup(sk) ((STACK_OF(X509_INFO) *)OPENSSL_sk_dup(ossl_check_const_X509_INFO_sk_type(sk)))
411#define sk_X509_INFO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_INFO) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_INFO_sk_type(sk), ossl_check_X509_INFO_copyfunc_type(copyfunc), ossl_check_X509_INFO_freefunc_type(freefunc)))
412#define sk_X509_INFO_set_cmp_func(sk, cmp) ((sk_X509_INFO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_INFO_sk_type(sk), ossl_check_X509_INFO_compfunc_type(cmp)))
421 ASN1_IA5STRING *challenge;
426 X509_ALGOR sig_algor;
427 ASN1_BIT_STRING *signature;
433 STACK_OF(X509) *certs;
446 ASN1_OCTET_STRING *salt;
454 X509_ALGOR *encryption;
461 ASN1_INTEGER *keylength;
465#ifndef OPENSSL_NO_SCRYPT
467 ASN1_OCTET_STRING *salt;
468 ASN1_INTEGER *costParameter;
469 ASN1_INTEGER *blockSize;
470 ASN1_INTEGER *parallelizationParameter;
471 ASN1_INTEGER *keyLength;
479# include <openssl/x509_vfy.h>
480# include <openssl/pkcs7.h>
486# define X509_EXT_PACK_UNKNOWN 1
487# define X509_EXT_PACK_STRING 2
489# define X509_extract_key(x) X509_get_pubkey(x)
490# define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)
491# define X509_name_cmp(a,b) X509_NAME_cmp((a),(b))
493void X509_CRL_set_default_method(
const X509_CRL_METHOD *meth);
494X509_CRL_METHOD *X509_CRL_METHOD_new(
int (*crl_init) (X509_CRL *crl),
495 int (*crl_free) (X509_CRL *crl),
496 int (*crl_lookup) (X509_CRL *crl,
499 ASN1_INTEGER *serial,
502 int (*crl_verify) (X509_CRL *crl,
504void X509_CRL_METHOD_free(X509_CRL_METHOD *m);
506void X509_CRL_set_meth_data(X509_CRL *crl,
void *dat);
507void *X509_CRL_get_meth_data(X509_CRL *crl);
509const char *X509_verify_cert_error_string(
long n);
511int X509_verify(X509 *a, EVP_PKEY *r);
512int X509_self_signed(X509 *cert,
int verify_signature);
514int X509_REQ_verify_ex(X509_REQ *a, EVP_PKEY *r, OSSL_LIB_CTX *libctx,
516int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);
517int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);
520NETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(
const char *str,
int len);
523int NETSCAPE_SPKI_set_pubkey(
NETSCAPE_SPKI *x, EVP_PKEY *pkey);
527int X509_signature_dump(BIO *bp,
const ASN1_STRING *sig,
int indent);
528int X509_signature_print(BIO *bp,
const X509_ALGOR *alg,
529 const ASN1_STRING *sig);
531int X509_sign(X509 *x, EVP_PKEY *pkey,
const EVP_MD *md);
532int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);
533int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey,
const EVP_MD *md);
534int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);
535int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey,
const EVP_MD *md);
536int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);
537int NETSCAPE_SPKI_sign(
NETSCAPE_SPKI *x, EVP_PKEY *pkey,
const EVP_MD *md);
539int X509_pubkey_digest(
const X509 *data,
const EVP_MD *type,
540 unsigned char *md,
unsigned int *len);
541int X509_digest(
const X509 *data,
const EVP_MD *type,
542 unsigned char *md,
unsigned int *len);
543ASN1_OCTET_STRING *X509_digest_sig(
const X509 *cert,
544 EVP_MD **md_used,
int *md_is_fallback);
545int X509_CRL_digest(
const X509_CRL *data,
const EVP_MD *type,
546 unsigned char *md,
unsigned int *len);
547int X509_REQ_digest(
const X509_REQ *data,
const EVP_MD *type,
548 unsigned char *md,
unsigned int *len);
549int X509_NAME_digest(
const X509_NAME *data,
const EVP_MD *type,
550 unsigned char *md,
unsigned int *len);
552X509 *X509_load_http(
const char *url, BIO *bio, BIO *rbio,
int timeout);
553X509_CRL *X509_CRL_load_http(
const char *url, BIO *bio, BIO *rbio,
int timeout);
554# ifndef OPENSSL_NO_DEPRECATED_3_0
555# include <openssl/http.h>
556# define X509_http_nbio(rctx, pcert) \
557 OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcert, ASN1_ITEM_rptr(X509))
558# define X509_CRL_http_nbio(rctx, pcrl) \
559 OSSL_HTTP_REQ_CTX_nbio_d2i(rctx, pcrl, ASN1_ITEM_rptr(X509_CRL))
562# ifndef OPENSSL_NO_STDIO
563X509 *d2i_X509_fp(FILE *fp, X509 **x509);
564int i2d_X509_fp(FILE *fp,
const X509 *x509);
565X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);
566int i2d_X509_CRL_fp(FILE *fp,
const X509_CRL *crl);
567X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);
568int i2d_X509_REQ_fp(FILE *fp,
const X509_REQ *req);
569# ifndef OPENSSL_NO_DEPRECATED_3_0
570OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);
571OSSL_DEPRECATEDIN_3_0
int i2d_RSAPrivateKey_fp(FILE *fp,
const RSA *rsa);
572OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);
573OSSL_DEPRECATEDIN_3_0
int i2d_RSAPublicKey_fp(FILE *fp,
const RSA *rsa);
574OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);
575OSSL_DEPRECATEDIN_3_0
int i2d_RSA_PUBKEY_fp(FILE *fp,
const RSA *rsa);
577# ifndef OPENSSL_NO_DEPRECATED_3_0
578# ifndef OPENSSL_NO_DSA
579OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);
580OSSL_DEPRECATEDIN_3_0
int i2d_DSA_PUBKEY_fp(FILE *fp,
const DSA *dsa);
581OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);
582OSSL_DEPRECATEDIN_3_0
int i2d_DSAPrivateKey_fp(FILE *fp,
const DSA *dsa);
585# ifndef OPENSSL_NO_DEPRECATED_3_0
586# ifndef OPENSSL_NO_EC
587OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);
588OSSL_DEPRECATEDIN_3_0
int i2d_EC_PUBKEY_fp(FILE *fp,
const EC_KEY *eckey);
589OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);
590OSSL_DEPRECATEDIN_3_0
int i2d_ECPrivateKey_fp(FILE *fp,
const EC_KEY *eckey);
593X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);
594int i2d_PKCS8_fp(FILE *fp,
const X509_SIG *p8);
595X509_PUBKEY *d2i_X509_PUBKEY_fp(FILE *fp, X509_PUBKEY **xpk);
596int i2d_X509_PUBKEY_fp(FILE *fp,
const X509_PUBKEY *xpk);
597PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
598 PKCS8_PRIV_KEY_INFO **p8inf);
599int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,
const PKCS8_PRIV_KEY_INFO *p8inf);
600int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp,
const EVP_PKEY *key);
601int i2d_PrivateKey_fp(FILE *fp,
const EVP_PKEY *pkey);
602EVP_PKEY *d2i_PrivateKey_ex_fp(FILE *fp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
604EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);
605int i2d_PUBKEY_fp(FILE *fp,
const EVP_PKEY *pkey);
606EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);
609X509 *d2i_X509_bio(BIO *bp, X509 **x509);
610int i2d_X509_bio(BIO *bp,
const X509 *x509);
611X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);
612int i2d_X509_CRL_bio(BIO *bp,
const X509_CRL *crl);
613X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);
614int i2d_X509_REQ_bio(BIO *bp,
const X509_REQ *req);
615# ifndef OPENSSL_NO_DEPRECATED_3_0
616OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);
617OSSL_DEPRECATEDIN_3_0
int i2d_RSAPrivateKey_bio(BIO *bp,
const RSA *rsa);
618OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);
619OSSL_DEPRECATEDIN_3_0
int i2d_RSAPublicKey_bio(BIO *bp,
const RSA *rsa);
620OSSL_DEPRECATEDIN_3_0 RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);
621OSSL_DEPRECATEDIN_3_0
int i2d_RSA_PUBKEY_bio(BIO *bp,
const RSA *rsa);
623# ifndef OPENSSL_NO_DEPRECATED_3_0
624# ifndef OPENSSL_NO_DSA
625OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);
626OSSL_DEPRECATEDIN_3_0
int i2d_DSA_PUBKEY_bio(BIO *bp,
const DSA *dsa);
627OSSL_DEPRECATEDIN_3_0 DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);
628OSSL_DEPRECATEDIN_3_0
int i2d_DSAPrivateKey_bio(BIO *bp,
const DSA *dsa);
632# ifndef OPENSSL_NO_DEPRECATED_3_0
633# ifndef OPENSSL_NO_EC
634OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);
635OSSL_DEPRECATEDIN_3_0
int i2d_EC_PUBKEY_bio(BIO *bp,
const EC_KEY *eckey);
636OSSL_DEPRECATEDIN_3_0 EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);
637OSSL_DEPRECATEDIN_3_0
int i2d_ECPrivateKey_bio(BIO *bp,
const EC_KEY *eckey);
641X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);
642int i2d_PKCS8_bio(BIO *bp,
const X509_SIG *p8);
643X509_PUBKEY *d2i_X509_PUBKEY_bio(BIO *bp, X509_PUBKEY **xpk);
644int i2d_X509_PUBKEY_bio(BIO *bp,
const X509_PUBKEY *xpk);
645PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
646 PKCS8_PRIV_KEY_INFO **p8inf);
647int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,
const PKCS8_PRIV_KEY_INFO *p8inf);
648int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp,
const EVP_PKEY *key);
649int i2d_PrivateKey_bio(BIO *bp,
const EVP_PKEY *pkey);
650EVP_PKEY *d2i_PrivateKey_ex_bio(BIO *bp, EVP_PKEY **a, OSSL_LIB_CTX *libctx,
652EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);
653int i2d_PUBKEY_bio(BIO *bp,
const EVP_PKEY *pkey);
654EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);
656DECLARE_ASN1_DUP_FUNCTION(X509)
657DECLARE_ASN1_DUP_FUNCTION(X509_ALGOR)
658DECLARE_ASN1_DUP_FUNCTION(X509_ATTRIBUTE)
659DECLARE_ASN1_DUP_FUNCTION(X509_CRL)
660DECLARE_ASN1_DUP_FUNCTION(X509_EXTENSION)
661DECLARE_ASN1_DUP_FUNCTION(X509_PUBKEY)
662DECLARE_ASN1_DUP_FUNCTION(X509_REQ)
663DECLARE_ASN1_DUP_FUNCTION(X509_REVOKED)
664int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj,
int ptype,
666void X509_ALGOR_get0(
const ASN1_OBJECT **paobj,
int *pptype,
667 const void **ppval,
const X509_ALGOR *algor);
668void X509_ALGOR_set_md(X509_ALGOR *alg,
const EVP_MD *md);
669int X509_ALGOR_cmp(
const X509_ALGOR *a,
const X509_ALGOR *b);
670int X509_ALGOR_copy(X509_ALGOR *dest,
const X509_ALGOR *src);
672DECLARE_ASN1_DUP_FUNCTION(X509_NAME)
673DECLARE_ASN1_DUP_FUNCTION(X509_NAME_ENTRY)
675int X509_cmp_time(
const ASN1_TIME *s, time_t *t);
676int X509_cmp_current_time(
const ASN1_TIME *s);
677int X509_cmp_timeframe(
const X509_VERIFY_PARAM *vpm,
678 const ASN1_TIME *start,
const ASN1_TIME *end);
679ASN1_TIME *X509_time_adj(ASN1_TIME *s,
long adj, time_t *t);
680ASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,
681 int offset_day,
long offset_sec, time_t *t);
682ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s,
long adj);
684const char *X509_get_default_cert_area(
void);
685const char *X509_get_default_cert_dir(
void);
686const char *X509_get_default_cert_file(
void);
687const char *X509_get_default_cert_dir_env(
void);
688const char *X509_get_default_cert_file_env(
void);
689const char *X509_get_default_private_dir(
void);
691X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey,
const EVP_MD *md);
692X509 *X509_REQ_to_X509(X509_REQ *r,
int days, EVP_PKEY *pkey);
694DECLARE_ASN1_FUNCTIONS(X509_ALGOR)
695DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
698DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
700X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
701int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
702EVP_PKEY *X509_PUBKEY_get0(
const X509_PUBKEY *key);
703EVP_PKEY *X509_PUBKEY_get(
const X509_PUBKEY *key);
704int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);
705long X509_get_pathlen(X509 *x);
706DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY)
707EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a,
const unsigned char **pp,
long length,
708 OSSL_LIB_CTX *libctx,
const char *propq);
709# ifndef OPENSSL_NO_DEPRECATED_3_0
710DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,RSA, RSA_PUBKEY)
712# ifndef OPENSSL_NO_DEPRECATED_3_0
713# ifndef OPENSSL_NO_DSA
714DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0,DSA, DSA_PUBKEY)
717# ifndef OPENSSL_NO_DEPRECATED_3_0
718# ifndef OPENSSL_NO_EC
719DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(OSSL_DEPRECATEDIN_3_0, EC_KEY, EC_PUBKEY)
723DECLARE_ASN1_FUNCTIONS(X509_SIG)
724void X509_SIG_get0(
const X509_SIG *sig,
const X509_ALGOR **palg,
725 const ASN1_OCTET_STRING **pdigest);
726void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg,
727 ASN1_OCTET_STRING **pdigest);
729DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)
730DECLARE_ASN1_FUNCTIONS(X509_REQ)
731X509_REQ *X509_REQ_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
733DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)
734X509_ATTRIBUTE *X509_ATTRIBUTE_create(
int nid,
int atrtype,
void *value);
736DECLARE_ASN1_FUNCTIONS(X509_EXTENSION)
737DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)
739DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)
741DECLARE_ASN1_FUNCTIONS(X509_NAME)
743int X509_NAME_set(X509_NAME **xn,
const X509_NAME *name);
745DECLARE_ASN1_FUNCTIONS(X509_CINF)
746DECLARE_ASN1_FUNCTIONS(X509)
747X509 *X509_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
748DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)
750#define X509_get_ex_new_index(l, p, newf, dupf, freef) \
751 CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, l, p, newf, dupf, freef)
752int X509_set_ex_data(X509 *r,
int idx,
void *arg);
753void *X509_get_ex_data(
const X509 *r,
int idx);
754DECLARE_ASN1_ENCODE_FUNCTIONS_only(X509,X509_AUX)
756int i2d_re_X509_tbs(X509 *x,
unsigned char **pp);
758int X509_SIG_INFO_get(
const X509_SIG_INFO *siginf,
int *mdnid,
int *pknid,
759 int *secbits, uint32_t *flags);
760void X509_SIG_INFO_set(X509_SIG_INFO *siginf,
int mdnid,
int pknid,
761 int secbits, uint32_t flags);
763int X509_get_signature_info(X509 *x,
int *mdnid,
int *pknid,
int *secbits,
766void X509_get0_signature(
const ASN1_BIT_STRING **psig,
767 const X509_ALGOR **palg,
const X509 *x);
768int X509_get_signature_nid(
const X509 *x);
770void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id);
771ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
772void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id);
773ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
775int X509_alias_set1(X509 *x,
const unsigned char *name,
int len);
776int X509_keyid_set1(X509 *x,
const unsigned char *
id,
int len);
777unsigned char *X509_alias_get0(X509 *x,
int *len);
778unsigned char *X509_keyid_get0(X509 *x,
int *len);
780DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
781DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
782DECLARE_ASN1_FUNCTIONS(X509_CRL)
783X509_CRL *X509_CRL_new_ex(OSSL_LIB_CTX *libctx,
const char *propq);
785int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
786int X509_CRL_get0_by_serial(X509_CRL *crl,
787 X509_REVOKED **ret,
const ASN1_INTEGER *serial);
788int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
799char *X509_NAME_oneline(
const X509_NAME *a,
char *buf,
int size);
801#ifndef OPENSSL_NO_DEPRECATED_3_0
803int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,
804 ASN1_BIT_STRING *signature,
char *data, EVP_PKEY *pkey);
806int ASN1_digest(i2d_of_void *i2d,
const EVP_MD *type,
char *data,
807 unsigned char *md,
unsigned int *len);
809int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2,
810 ASN1_BIT_STRING *signature,
char *data, EVP_PKEY *pkey,
813int ASN1_item_digest(
const ASN1_ITEM *it,
const EVP_MD *type,
void *data,
814 unsigned char *md,
unsigned int *len);
815int ASN1_item_verify(
const ASN1_ITEM *it,
const X509_ALGOR *alg,
816 const ASN1_BIT_STRING *signature,
const void *data,
818int ASN1_item_verify_ctx(
const ASN1_ITEM *it,
const X509_ALGOR *alg,
819 const ASN1_BIT_STRING *signature,
const void *data,
821int ASN1_item_sign(
const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
822 ASN1_BIT_STRING *signature,
const void *data,
823 EVP_PKEY *pkey,
const EVP_MD *md);
824int ASN1_item_sign_ctx(
const ASN1_ITEM *it, X509_ALGOR *algor1,
825 X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
826 const void *data, EVP_MD_CTX *ctx);
828#define X509_VERSION_1 0
829#define X509_VERSION_2 1
830#define X509_VERSION_3 2
832long X509_get_version(
const X509 *x);
833int X509_set_version(X509 *x,
long version);
834int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
835ASN1_INTEGER *X509_get_serialNumber(X509 *x);
836const ASN1_INTEGER *X509_get0_serialNumber(
const X509 *x);
837int X509_set_issuer_name(X509 *x,
const X509_NAME *name);
838X509_NAME *X509_get_issuer_name(
const X509 *a);
839int X509_set_subject_name(X509 *x,
const X509_NAME *name);
840X509_NAME *X509_get_subject_name(
const X509 *a);
841const ASN1_TIME * X509_get0_notBefore(
const X509 *x);
842ASN1_TIME *X509_getm_notBefore(
const X509 *x);
843int X509_set1_notBefore(X509 *x,
const ASN1_TIME *
tm);
844const ASN1_TIME *X509_get0_notAfter(
const X509 *x);
845ASN1_TIME *X509_getm_notAfter(
const X509 *x);
846int X509_set1_notAfter(X509 *x,
const ASN1_TIME *
tm);
847int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
848int X509_up_ref(X509 *x);
849int X509_get_signature_type(
const X509 *x);
851# ifndef OPENSSL_NO_DEPRECATED_1_1_0
852# define X509_get_notBefore X509_getm_notBefore
853# define X509_get_notAfter X509_getm_notAfter
854# define X509_set_notBefore X509_set1_notBefore
855# define X509_set_notAfter X509_set1_notAfter
863X509_PUBKEY *X509_get_X509_PUBKEY(
const X509 *x);
864const STACK_OF(X509_EXTENSION) *X509_get0_extensions(
const X509 *x);
865void X509_get0_uids(
const X509 *x,
const ASN1_BIT_STRING **piuid,
866 const ASN1_BIT_STRING **psuid);
867const X509_ALGOR *X509_get0_tbs_sigalg(
const X509 *x);
869EVP_PKEY *X509_get0_pubkey(
const X509 *x);
870EVP_PKEY *X509_get_pubkey(X509 *x);
871ASN1_BIT_STRING *X509_get0_pubkey_bitstr(
const X509 *x);
873#define X509_REQ_VERSION_1 0
875long X509_REQ_get_version(
const X509_REQ *req);
876int X509_REQ_set_version(X509_REQ *x,
long version);
877X509_NAME *X509_REQ_get_subject_name(
const X509_REQ *req);
878int X509_REQ_set_subject_name(X509_REQ *req,
const X509_NAME *name);
879void X509_REQ_get0_signature(
const X509_REQ *req,
const ASN1_BIT_STRING **psig,
880 const X509_ALGOR **palg);
881void X509_REQ_set0_signature(X509_REQ *req, ASN1_BIT_STRING *psig);
882int X509_REQ_set1_signature_algo(X509_REQ *req, X509_ALGOR *palg);
883int X509_REQ_get_signature_nid(
const X509_REQ *req);
884int i2d_re_X509_REQ_tbs(X509_REQ *req,
unsigned char **pp);
885int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
886EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);
887EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req);
888X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req);
889int X509_REQ_extension_nid(
int nid);
890int *X509_REQ_get_extension_nids(
void);
891void X509_REQ_set_extension_nids(
int *nids);
892STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
893int X509_REQ_add_extensions_nid(X509_REQ *req,
894 const STACK_OF(X509_EXTENSION) *exts,
int nid);
895int X509_REQ_add_extensions(X509_REQ *req,
const STACK_OF(X509_EXTENSION) *ext);
896int X509_REQ_get_attr_count(
const X509_REQ *req);
897int X509_REQ_get_attr_by_NID(
const X509_REQ *req,
int nid,
int lastpos);
898int X509_REQ_get_attr_by_OBJ(
const X509_REQ *req,
const ASN1_OBJECT *obj,
900X509_ATTRIBUTE *X509_REQ_get_attr(
const X509_REQ *req,
int loc);
901X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req,
int loc);
902int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);
903int X509_REQ_add1_attr_by_OBJ(X509_REQ *req,
904 const ASN1_OBJECT *obj,
int type,
905 const unsigned char *bytes,
int len);
906int X509_REQ_add1_attr_by_NID(X509_REQ *req,
908 const unsigned char *bytes,
int len);
909int X509_REQ_add1_attr_by_txt(X509_REQ *req,
910 const char *attrname,
int type,
911 const unsigned char *bytes,
int len);
913#define X509_CRL_VERSION_1 0
914#define X509_CRL_VERSION_2 1
916int X509_CRL_set_version(X509_CRL *x,
long version);
917int X509_CRL_set_issuer_name(X509_CRL *x,
const X509_NAME *name);
918int X509_CRL_set1_lastUpdate(X509_CRL *x,
const ASN1_TIME *
tm);
919int X509_CRL_set1_nextUpdate(X509_CRL *x,
const ASN1_TIME *
tm);
920int X509_CRL_sort(X509_CRL *crl);
921int X509_CRL_up_ref(X509_CRL *crl);
923# ifndef OPENSSL_NO_DEPRECATED_1_1_0
924# define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate
925# define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate
928long X509_CRL_get_version(
const X509_CRL *crl);
929const ASN1_TIME *X509_CRL_get0_lastUpdate(
const X509_CRL *crl);
930const ASN1_TIME *X509_CRL_get0_nextUpdate(
const X509_CRL *crl);
931#ifndef OPENSSL_NO_DEPRECATED_1_1_0
932OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
933OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
935X509_NAME *X509_CRL_get_issuer(
const X509_CRL *crl);
936const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(
const X509_CRL *crl);
937STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(X509_CRL *crl);
938void X509_CRL_get0_signature(
const X509_CRL *crl,
const ASN1_BIT_STRING **psig,
939 const X509_ALGOR **palg);
940int X509_CRL_get_signature_nid(
const X509_CRL *crl);
941int i2d_re_X509_CRL_tbs(X509_CRL *req,
unsigned char **pp);
943const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(
const X509_REVOKED *x);
944int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
945const ASN1_TIME *X509_REVOKED_get0_revocationDate(
const X509_REVOKED *x);
946int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *
tm);
947const STACK_OF(X509_EXTENSION) *
948X509_REVOKED_get0_extensions(
const X509_REVOKED *r);
950X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
951 EVP_PKEY *skey,
const EVP_MD *md,
unsigned int flags);
953int X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey);
955int X509_check_private_key(
const X509 *x509,
const EVP_PKEY *pkey);
956int X509_chain_check_suiteb(
int *perror_depth,
957 X509 *x, STACK_OF(X509) *chain,
958 unsigned long flags);
959int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk,
unsigned long flags);
960STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);
962int X509_issuer_and_serial_cmp(
const X509 *a,
const X509 *b);
963unsigned long X509_issuer_and_serial_hash(X509 *a);
965int X509_issuer_name_cmp(
const X509 *a,
const X509 *b);
966unsigned long X509_issuer_name_hash(X509 *a);
968int X509_subject_name_cmp(
const X509 *a,
const X509 *b);
969unsigned long X509_subject_name_hash(X509 *x);
971# ifndef OPENSSL_NO_MD5
972unsigned long X509_issuer_name_hash_old(X509 *a);
973unsigned long X509_subject_name_hash_old(X509 *x);
976# define X509_ADD_FLAG_DEFAULT 0
977# define X509_ADD_FLAG_UP_REF 0x1
978# define X509_ADD_FLAG_PREPEND 0x2
979# define X509_ADD_FLAG_NO_DUP 0x4
980# define X509_ADD_FLAG_NO_SS 0x8
981int X509_add_cert(STACK_OF(X509) *sk, X509 *cert,
int flags);
982int X509_add_certs(STACK_OF(X509) *sk, STACK_OF(X509) *certs,
int flags);
984int X509_cmp(
const X509 *a,
const X509 *b);
985int X509_NAME_cmp(
const X509_NAME *a,
const X509_NAME *b);
986#ifndef OPENSSL_NO_DEPRECATED_3_0
987# define X509_NAME_hash(x) X509_NAME_hash_ex(x, NULL, NULL, NULL)
988OSSL_DEPRECATEDIN_3_0
int X509_certificate_type(
const X509 *x,
989 const EVP_PKEY *pubkey);
991unsigned long X509_NAME_hash_ex(
const X509_NAME *x, OSSL_LIB_CTX *libctx,
992 const char *propq,
int *ok);
993unsigned long X509_NAME_hash_old(
const X509_NAME *x);
995int X509_CRL_cmp(
const X509_CRL *a,
const X509_CRL *b);
996int X509_CRL_match(
const X509_CRL *a,
const X509_CRL *b);
997int X509_aux_print(BIO *out, X509 *x,
int indent);
998# ifndef OPENSSL_NO_STDIO
999int X509_print_ex_fp(FILE *bp, X509 *x,
unsigned long nmflag,
1000 unsigned long cflag);
1001int X509_print_fp(FILE *bp, X509 *x);
1002int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
1003int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
1004int X509_NAME_print_ex_fp(FILE *fp,
const X509_NAME *nm,
int indent,
1005 unsigned long flags);
1008int X509_NAME_print(BIO *bp,
const X509_NAME *name,
int obase);
1009int X509_NAME_print_ex(BIO *out,
const X509_NAME *nm,
int indent,
1010 unsigned long flags);
1011int X509_print_ex(BIO *bp, X509 *x,
unsigned long nmflag,
1012 unsigned long cflag);
1013int X509_print(BIO *bp, X509 *x);
1014int X509_ocspid_print(BIO *bp, X509 *x);
1015int X509_CRL_print_ex(BIO *out, X509_CRL *x,
unsigned long nmflag);
1016int X509_CRL_print(BIO *bp, X509_CRL *x);
1017int X509_REQ_print_ex(BIO *bp, X509_REQ *x,
unsigned long nmflag,
1018 unsigned long cflag);
1019int X509_REQ_print(BIO *bp, X509_REQ *req);
1021int X509_NAME_entry_count(
const X509_NAME *name);
1022int X509_NAME_get_text_by_NID(
const X509_NAME *name,
int nid,
1023 char *buf,
int len);
1024int X509_NAME_get_text_by_OBJ(
const X509_NAME *name,
const ASN1_OBJECT *obj,
1025 char *buf,
int len);
1031int X509_NAME_get_index_by_NID(
const X509_NAME *name,
int nid,
int lastpos);
1032int X509_NAME_get_index_by_OBJ(
const X509_NAME *name,
const ASN1_OBJECT *obj,
1034X509_NAME_ENTRY *X509_NAME_get_entry(
const X509_NAME *name,
int loc);
1035X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name,
int loc);
1036int X509_NAME_add_entry(X509_NAME *name,
const X509_NAME_ENTRY *ne,
1038int X509_NAME_add_entry_by_OBJ(X509_NAME *name,
const ASN1_OBJECT *obj,
int type,
1039 const unsigned char *bytes,
int len,
int loc,
1041int X509_NAME_add_entry_by_NID(X509_NAME *name,
int nid,
int type,
1042 const unsigned char *bytes,
int len,
int loc,
1044X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
1045 const char *field,
int type,
1046 const unsigned char *bytes,
1048X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne,
int nid,
1050 const unsigned char *bytes,
1052int X509_NAME_add_entry_by_txt(X509_NAME *name,
const char *field,
int type,
1053 const unsigned char *bytes,
int len,
int loc,
1055X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,
1056 const ASN1_OBJECT *obj,
int type,
1057 const unsigned char *bytes,
1059int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
const ASN1_OBJECT *obj);
1060int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne,
int type,
1061 const unsigned char *bytes,
int len);
1062ASN1_OBJECT *X509_NAME_ENTRY_get_object(
const X509_NAME_ENTRY *ne);
1063ASN1_STRING * X509_NAME_ENTRY_get_data(
const X509_NAME_ENTRY *ne);
1064int X509_NAME_ENTRY_set(
const X509_NAME_ENTRY *ne);
1066int X509_NAME_get0_der(
const X509_NAME *nm,
const unsigned char **pder,
1069int X509v3_get_ext_count(
const STACK_OF(X509_EXTENSION) *x);
1070int X509v3_get_ext_by_NID(
const STACK_OF(X509_EXTENSION) *x,
1071 int nid,
int lastpos);
1072int X509v3_get_ext_by_OBJ(
const STACK_OF(X509_EXTENSION) *x,
1073 const ASN1_OBJECT *obj,
int lastpos);
1074int X509v3_get_ext_by_critical(
const STACK_OF(X509_EXTENSION) *x,
1075 int crit,
int lastpos);
1076X509_EXTENSION *X509v3_get_ext(
const STACK_OF(X509_EXTENSION) *x,
int loc);
1077X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x,
int loc);
1078STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
1079 X509_EXTENSION *ex,
int loc);
1081int X509_get_ext_count(
const X509 *x);
1082int X509_get_ext_by_NID(
const X509 *x,
int nid,
int lastpos);
1083int X509_get_ext_by_OBJ(
const X509 *x,
const ASN1_OBJECT *obj,
int lastpos);
1084int X509_get_ext_by_critical(
const X509 *x,
int crit,
int lastpos);
1085X509_EXTENSION *X509_get_ext(
const X509 *x,
int loc);
1086X509_EXTENSION *X509_delete_ext(X509 *x,
int loc);
1087int X509_add_ext(X509 *x, X509_EXTENSION *ex,
int loc);
1088void *X509_get_ext_d2i(
const X509 *x,
int nid,
int *crit,
int *idx);
1089int X509_add1_ext_i2d(X509 *x,
int nid,
void *value,
int crit,
1090 unsigned long flags);
1092int X509_CRL_get_ext_count(
const X509_CRL *x);
1093int X509_CRL_get_ext_by_NID(
const X509_CRL *x,
int nid,
int lastpos);
1094int X509_CRL_get_ext_by_OBJ(
const X509_CRL *x,
const ASN1_OBJECT *obj,
1096int X509_CRL_get_ext_by_critical(
const X509_CRL *x,
int crit,
int lastpos);
1097X509_EXTENSION *X509_CRL_get_ext(
const X509_CRL *x,
int loc);
1098X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x,
int loc);
1099int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex,
int loc);
1100void *X509_CRL_get_ext_d2i(
const X509_CRL *x,
int nid,
int *crit,
int *idx);
1101int X509_CRL_add1_ext_i2d(X509_CRL *x,
int nid,
void *value,
int crit,
1102 unsigned long flags);
1104int X509_REVOKED_get_ext_count(
const X509_REVOKED *x);
1105int X509_REVOKED_get_ext_by_NID(
const X509_REVOKED *x,
int nid,
int lastpos);
1106int X509_REVOKED_get_ext_by_OBJ(
const X509_REVOKED *x,
const ASN1_OBJECT *obj,
1108int X509_REVOKED_get_ext_by_critical(
const X509_REVOKED *x,
int crit,
1110X509_EXTENSION *X509_REVOKED_get_ext(
const X509_REVOKED *x,
int loc);
1111X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x,
int loc);
1112int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex,
int loc);
1113void *X509_REVOKED_get_ext_d2i(
const X509_REVOKED *x,
int nid,
int *crit,
1115int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x,
int nid,
void *value,
int crit,
1116 unsigned long flags);
1118X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,
1120 ASN1_OCTET_STRING *data);
1121X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
1122 const ASN1_OBJECT *obj,
int crit,
1123 ASN1_OCTET_STRING *data);
1124int X509_EXTENSION_set_object(X509_EXTENSION *ex,
const ASN1_OBJECT *obj);
1125int X509_EXTENSION_set_critical(X509_EXTENSION *ex,
int crit);
1126int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);
1127ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
1128ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
1129int X509_EXTENSION_get_critical(
const X509_EXTENSION *ex);
1131int X509at_get_attr_count(
const STACK_OF(X509_ATTRIBUTE) *x);
1132int X509at_get_attr_by_NID(
const STACK_OF(X509_ATTRIBUTE) *x,
int nid,
1134int X509at_get_attr_by_OBJ(
const STACK_OF(X509_ATTRIBUTE) *sk,
1135 const ASN1_OBJECT *obj,
int lastpos);
1136X509_ATTRIBUTE *X509at_get_attr(
const STACK_OF(X509_ATTRIBUTE) *x,
int loc);
1137X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x,
int loc);
1138STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,
1139 X509_ATTRIBUTE *attr);
1140STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)
1141 **x,
const ASN1_OBJECT *obj,
1143 const unsigned char *bytes,
1145STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)
1146 **x,
int nid,
int type,
1147 const unsigned char *bytes,
1149STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
1150 **x,
const char *attrname,
1152 const unsigned char *bytes,
1154void *X509at_get0_data_by_OBJ(
const STACK_OF(X509_ATTRIBUTE) *x,
1155 const ASN1_OBJECT *obj,
int lastpos,
int type);
1156X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr,
int nid,
1157 int atrtype,
const void *data,
1159X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
1160 const ASN1_OBJECT *obj,
1161 int atrtype,
const void *data,
1163X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,
1164 const char *atrname,
int type,
1165 const unsigned char *bytes,
1167int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr,
const ASN1_OBJECT *obj);
1168int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr,
int attrtype,
1169 const void *data,
int len);
1170void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr,
int idx,
int atrtype,
1172int X509_ATTRIBUTE_count(
const X509_ATTRIBUTE *attr);
1173ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);
1174ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr,
int idx);
1176int EVP_PKEY_get_attr_count(
const EVP_PKEY *key);
1177int EVP_PKEY_get_attr_by_NID(
const EVP_PKEY *key,
int nid,
int lastpos);
1178int EVP_PKEY_get_attr_by_OBJ(
const EVP_PKEY *key,
const ASN1_OBJECT *obj,
1180X509_ATTRIBUTE *EVP_PKEY_get_attr(
const EVP_PKEY *key,
int loc);
1181X509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key,
int loc);
1182int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);
1183int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,
1184 const ASN1_OBJECT *obj,
int type,
1185 const unsigned char *bytes,
int len);
1186int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,
1188 const unsigned char *bytes,
int len);
1189int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,
1190 const char *attrname,
int type,
1191 const unsigned char *bytes,
int len);
1194X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,
const X509_NAME *name,
1195 const ASN1_INTEGER *serial);
1196X509 *X509_find_by_subject(STACK_OF(X509) *sk,
const X509_NAME *name);
1201#ifndef OPENSSL_NO_SCRYPT
1205int PKCS5_pbe_set0_algor(X509_ALGOR *algor,
int alg,
int iter,
1206 const unsigned char *salt,
int saltlen);
1207int PKCS5_pbe_set0_algor_ex(X509_ALGOR *algor,
int alg,
int iter,
1208 const unsigned char *salt,
int saltlen,
1209 OSSL_LIB_CTX *libctx);
1211X509_ALGOR *PKCS5_pbe_set(
int alg,
int iter,
1212 const unsigned char *salt,
int saltlen);
1213X509_ALGOR *PKCS5_pbe_set_ex(
int alg,
int iter,
1214 const unsigned char *salt,
int saltlen,
1215 OSSL_LIB_CTX *libctx);
1217X509_ALGOR *PKCS5_pbe2_set(
const EVP_CIPHER *cipher,
int iter,
1218 unsigned char *salt,
int saltlen);
1219X509_ALGOR *PKCS5_pbe2_set_iv(
const EVP_CIPHER *cipher,
int iter,
1220 unsigned char *salt,
int saltlen,
1221 unsigned char *aiv,
int prf_nid);
1222X509_ALGOR *PKCS5_pbe2_set_iv_ex(
const EVP_CIPHER *cipher,
int iter,
1223 unsigned char *salt,
int saltlen,
1224 unsigned char *aiv,
int prf_nid,
1225 OSSL_LIB_CTX *libctx);
1227#ifndef OPENSSL_NO_SCRYPT
1228X509_ALGOR *PKCS5_pbe2_set_scrypt(
const EVP_CIPHER *cipher,
1229 const unsigned char *salt,
int saltlen,
1230 unsigned char *aiv, uint64_t N, uint64_t r,
1234X509_ALGOR *PKCS5_pbkdf2_set(
int iter,
unsigned char *salt,
int saltlen,
1235 int prf_nid,
int keylen);
1236X509_ALGOR *PKCS5_pbkdf2_set_ex(
int iter,
unsigned char *salt,
int saltlen,
1237 int prf_nid,
int keylen,
1238 OSSL_LIB_CTX *libctx);
1242DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)
1244EVP_PKEY *EVP_PKCS82PKEY(
const PKCS8_PRIV_KEY_INFO *p8);
1245EVP_PKEY *EVP_PKCS82PKEY_ex(
const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx,
1247PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(
const EVP_PKEY *pkey);
1249int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,
1250 int version,
int ptype,
void *pval,
1251 unsigned char *penc,
int penclen);
1252int PKCS8_pkey_get0(
const ASN1_OBJECT **ppkalg,
1253 const unsigned char **pk,
int *ppklen,
1254 const X509_ALGOR **pa,
const PKCS8_PRIV_KEY_INFO *p8);
1256const STACK_OF(X509_ATTRIBUTE) *
1257PKCS8_pkey_get0_attrs(
const PKCS8_PRIV_KEY_INFO *p8);
1258int PKCS8_pkey_add1_attr(PKCS8_PRIV_KEY_INFO *p8, X509_ATTRIBUTE *attr);
1259int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8,
int nid,
int type,
1260 const unsigned char *bytes,
int len);
1261int PKCS8_pkey_add1_attr_by_OBJ(PKCS8_PRIV_KEY_INFO *p8,
const ASN1_OBJECT *obj,
1262 int type,
const unsigned char *bytes,
int len);
1265int X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,
1266 int ptype,
void *pval,
1267 unsigned char *penc,
int penclen);
1268int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,
1269 const unsigned char **pk,
int *ppklen,
1270 X509_ALGOR **pa,
const X509_PUBKEY *pub);
1271int X509_PUBKEY_eq(
const X509_PUBKEY *a,
const X509_PUBKEY *b);