File indexing completed on 2026-03-29 08:27:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef OPENSSL_STORE_H
0011 # define OPENSSL_STORE_H
0012 # pragma once
0013
0014 # include <openssl/macros.h>
0015 # ifndef OPENSSL_NO_DEPRECATED_3_0
0016 # define HEADER_OSSL_STORE_H
0017 # endif
0018
0019 # include <stdarg.h>
0020 # include <openssl/types.h>
0021 # include <openssl/pem.h>
0022 # include <openssl/storeerr.h>
0023
0024 # ifdef __cplusplus
0025 extern "C" {
0026 # endif
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 typedef struct ossl_store_ctx_st OSSL_STORE_CTX;
0038
0039
0040
0041
0042
0043
0044 typedef OSSL_STORE_INFO *(*OSSL_STORE_post_process_info_fn)(OSSL_STORE_INFO *,
0045 void *);
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 OSSL_STORE_CTX *
0056 OSSL_STORE_open(const char *uri, const UI_METHOD *ui_method, void *ui_data,
0057 OSSL_STORE_post_process_info_fn post_process,
0058 void *post_process_data);
0059 OSSL_STORE_CTX *
0060 OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
0061 const UI_METHOD *ui_method, void *ui_data,
0062 const OSSL_PARAM params[],
0063 OSSL_STORE_post_process_info_fn post_process,
0064 void *post_process_data);
0065
0066
0067
0068
0069
0070
0071
0072 # ifndef OPENSSL_NO_DEPRECATED_3_0
0073 OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_ctrl(OSSL_STORE_CTX *ctx, int cmd,
0074 ... );
0075 OSSL_DEPRECATEDIN_3_0 int OSSL_STORE_vctrl(OSSL_STORE_CTX *ctx, int cmd,
0076 va_list args);
0077 # endif
0078
0079 # ifndef OPENSSL_NO_DEPRECATED_3_0
0080
0081
0082
0083
0084
0085 # define OSSL_STORE_C_USE_SECMEM 1
0086
0087 # define OSSL_STORE_C_CUSTOM_START 100
0088
0089 # endif
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099 OSSL_STORE_INFO *OSSL_STORE_load(OSSL_STORE_CTX *ctx);
0100
0101
0102
0103
0104
0105 int OSSL_STORE_delete(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
0106 const UI_METHOD *ui_method, void *ui_data,
0107 const OSSL_PARAM params[]);
0108
0109
0110
0111
0112
0113 int OSSL_STORE_eof(OSSL_STORE_CTX *ctx);
0114
0115
0116
0117
0118
0119 int OSSL_STORE_error(OSSL_STORE_CTX *ctx);
0120
0121
0122
0123
0124
0125 int OSSL_STORE_close(OSSL_STORE_CTX *ctx);
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140 OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bio, const char *scheme,
0141 OSSL_LIB_CTX *libctx, const char *propq,
0142 const UI_METHOD *ui_method, void *ui_data,
0143 const OSSL_PARAM params[],
0144 OSSL_STORE_post_process_info_fn post_process,
0145 void *post_process_data);
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 # define OSSL_STORE_INFO_NAME 1
0158 # define OSSL_STORE_INFO_PARAMS 2
0159 # define OSSL_STORE_INFO_PUBKEY 3
0160 # define OSSL_STORE_INFO_PKEY 4
0161 # define OSSL_STORE_INFO_CERT 5
0162 # define OSSL_STORE_INFO_CRL 6
0163
0164
0165
0166
0167
0168
0169
0170
0171 OSSL_STORE_INFO *OSSL_STORE_INFO_new(int type, void *data);
0172 OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
0173 int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
0174 OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(EVP_PKEY *params);
0175 OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey);
0176 OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
0177 OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
0178 OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
0179
0180
0181
0182
0183 int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *info);
0184 void *OSSL_STORE_INFO_get0_data(int type, const OSSL_STORE_INFO *info);
0185 const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *info);
0186 char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *info);
0187 const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO *info);
0188 char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *info);
0189 EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *info);
0190 EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *info);
0191 EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info);
0192 EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info);
0193 EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *info);
0194 EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *info);
0195 X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *info);
0196 X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *info);
0197 X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *info);
0198 X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *info);
0199
0200 const char *OSSL_STORE_INFO_type_string(int type);
0201
0202
0203
0204
0205 void OSSL_STORE_INFO_free(OSSL_STORE_INFO *info);
0206
0207
0208
0209
0210
0211
0212
0213
0214 # define OSSL_STORE_SEARCH_BY_NAME 1
0215 # define OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 2
0216 # define OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 3
0217 # define OSSL_STORE_SEARCH_BY_ALIAS 4
0218
0219
0220 int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type);
0221
0222
0223
0224
0225
0226
0227 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
0228 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
0229 const ASN1_INTEGER
0230 *serial);
0231 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
0232 const unsigned char
0233 *bytes, size_t len);
0234 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_alias(const char *alias);
0235
0236
0237 void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search);
0238
0239
0240 int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion);
0241 X509_NAME *OSSL_STORE_SEARCH_get0_name(const OSSL_STORE_SEARCH *criterion);
0242 const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH
0243 *criterion);
0244 const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH
0245 *criterion, size_t *length);
0246 const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion);
0247 const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH *criterion);
0248
0249
0250
0251
0252
0253 int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
0254 int OSSL_STORE_find(OSSL_STORE_CTX *ctx, const OSSL_STORE_SEARCH *search);
0255
0256
0257
0258
0259
0260
0261
0262 typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
0263
0264 OSSL_STORE_LOADER *OSSL_STORE_LOADER_fetch(OSSL_LIB_CTX *libctx,
0265 const char *scheme,
0266 const char *properties);
0267 int OSSL_STORE_LOADER_up_ref(OSSL_STORE_LOADER *loader);
0268 void OSSL_STORE_LOADER_free(OSSL_STORE_LOADER *loader);
0269 const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER *
0270 loader);
0271 const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader);
0272 const char *OSSL_STORE_LOADER_get0_description(const OSSL_STORE_LOADER *loader);
0273 int OSSL_STORE_LOADER_is_a(const OSSL_STORE_LOADER *loader,
0274 const char *scheme);
0275 void OSSL_STORE_LOADER_do_all_provided(OSSL_LIB_CTX *libctx,
0276 void (*fn)(OSSL_STORE_LOADER *loader,
0277 void *arg),
0278 void *arg);
0279 int OSSL_STORE_LOADER_names_do_all(const OSSL_STORE_LOADER *loader,
0280 void (*fn)(const char *name, void *data),
0281 void *data);
0282 const OSSL_PARAM *
0283 OSSL_STORE_LOADER_settable_ctx_params(const OSSL_STORE_LOADER *loader);
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293 # ifndef OPENSSL_NO_DEPRECATED_3_0
0294
0295
0296 typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX;
0297 typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)
0298 (const OSSL_STORE_LOADER *loader, const char *uri,
0299 const UI_METHOD *ui_method, void *ui_data);
0300 typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_ex_fn)
0301 (const OSSL_STORE_LOADER *loader,
0302 const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
0303 const UI_METHOD *ui_method, void *ui_data);
0304
0305 typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)
0306 (const OSSL_STORE_LOADER *loader, BIO *bio,
0307 OSSL_LIB_CTX *libctx, const char *propq,
0308 const UI_METHOD *ui_method, void *ui_data);
0309 typedef int (*OSSL_STORE_ctrl_fn)
0310 (OSSL_STORE_LOADER_CTX *ctx, int cmd, va_list args);
0311 typedef int (*OSSL_STORE_expect_fn)
0312 (OSSL_STORE_LOADER_CTX *ctx, int expected);
0313 typedef int (*OSSL_STORE_find_fn)
0314 (OSSL_STORE_LOADER_CTX *ctx, const OSSL_STORE_SEARCH *criteria);
0315 typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)
0316 (OSSL_STORE_LOADER_CTX *ctx, const UI_METHOD *ui_method, void *ui_data);
0317 typedef int (*OSSL_STORE_eof_fn)(OSSL_STORE_LOADER_CTX *ctx);
0318 typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx);
0319 typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
0320
0321 # endif
0322 # ifndef OPENSSL_NO_DEPRECATED_3_0
0323 OSSL_DEPRECATEDIN_3_0
0324 OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
0325 OSSL_DEPRECATEDIN_3_0
0326 int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
0327 OSSL_STORE_open_fn open_function);
0328 OSSL_DEPRECATEDIN_3_0
0329 int OSSL_STORE_LOADER_set_open_ex(OSSL_STORE_LOADER *loader,
0330 OSSL_STORE_open_ex_fn open_ex_function);
0331 OSSL_DEPRECATEDIN_3_0
0332 int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
0333 OSSL_STORE_attach_fn attach_function);
0334 OSSL_DEPRECATEDIN_3_0
0335 int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
0336 OSSL_STORE_ctrl_fn ctrl_function);
0337 OSSL_DEPRECATEDIN_3_0
0338 int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
0339 OSSL_STORE_expect_fn expect_function);
0340 OSSL_DEPRECATEDIN_3_0
0341 int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader,
0342 OSSL_STORE_find_fn find_function);
0343 OSSL_DEPRECATEDIN_3_0
0344 int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *loader,
0345 OSSL_STORE_load_fn load_function);
0346 OSSL_DEPRECATEDIN_3_0
0347 int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *loader,
0348 OSSL_STORE_eof_fn eof_function);
0349 OSSL_DEPRECATEDIN_3_0
0350 int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *loader,
0351 OSSL_STORE_error_fn error_function);
0352 OSSL_DEPRECATEDIN_3_0
0353 int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader,
0354 OSSL_STORE_close_fn close_function);
0355 OSSL_DEPRECATEDIN_3_0
0356 const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
0357 OSSL_DEPRECATEDIN_3_0
0358 const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
0359 OSSL_DEPRECATEDIN_3_0
0360 int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
0361 OSSL_DEPRECATEDIN_3_0
0362 OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme);
0363 # endif
0364
0365
0366
0367
0368
0369 # ifndef OPENSSL_NO_DEPRECATED_3_0
0370 OSSL_DEPRECATEDIN_3_0
0371 int OSSL_STORE_do_all_loaders(void (*do_function)(const OSSL_STORE_LOADER *loader,
0372 void *do_arg),
0373 void *do_arg);
0374 # endif
0375
0376 # ifdef __cplusplus
0377 }
0378 # endif
0379 #endif