File indexing completed on 2026-09-25 09:22:10
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 #define OSSL_STORE_SEARCH_BY_NAME 1
0214 #define OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 2
0215 #define OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 3
0216 #define OSSL_STORE_SEARCH_BY_ALIAS 4
0217
0218
0219 int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type);
0220
0221
0222
0223
0224
0225
0226 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
0227 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
0228 const ASN1_INTEGER
0229 *serial);
0230 OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
0231 const unsigned char
0232 *bytes,
0233 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,
0246 size_t *length);
0247 const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion);
0248 const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH *criterion);
0249
0250
0251
0252
0253
0254 int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
0255 int OSSL_STORE_find(OSSL_STORE_CTX *ctx, const OSSL_STORE_SEARCH *search);
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)(const OSSL_STORE_LOADER *loader, const char *uri,
0298 const UI_METHOD *ui_method, void *ui_data);
0299 typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_ex_fn)(const OSSL_STORE_LOADER *loader,
0300 const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
0301 const UI_METHOD *ui_method, void *ui_data);
0302
0303 typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_attach_fn)(const OSSL_STORE_LOADER *loader, BIO *bio,
0304 OSSL_LIB_CTX *libctx, const char *propq,
0305 const UI_METHOD *ui_method, void *ui_data);
0306 typedef int (*OSSL_STORE_ctrl_fn)(OSSL_STORE_LOADER_CTX *ctx, int cmd, va_list args);
0307 typedef int (*OSSL_STORE_expect_fn)(OSSL_STORE_LOADER_CTX *ctx, int expected);
0308 typedef int (*OSSL_STORE_find_fn)(OSSL_STORE_LOADER_CTX *ctx, const OSSL_STORE_SEARCH *criteria);
0309 typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx, const UI_METHOD *ui_method, void *ui_data);
0310 typedef int (*OSSL_STORE_eof_fn)(OSSL_STORE_LOADER_CTX *ctx);
0311 typedef int (*OSSL_STORE_error_fn)(OSSL_STORE_LOADER_CTX *ctx);
0312 typedef int (*OSSL_STORE_close_fn)(OSSL_STORE_LOADER_CTX *ctx);
0313
0314 #endif
0315 #ifndef OPENSSL_NO_DEPRECATED_3_0
0316 OSSL_DEPRECATEDIN_3_0
0317 OSSL_STORE_LOADER *OSSL_STORE_LOADER_new(ENGINE *e, const char *scheme);
0318 OSSL_DEPRECATEDIN_3_0
0319 int OSSL_STORE_LOADER_set_open(OSSL_STORE_LOADER *loader,
0320 OSSL_STORE_open_fn open_function);
0321 OSSL_DEPRECATEDIN_3_0
0322 int OSSL_STORE_LOADER_set_open_ex(OSSL_STORE_LOADER *loader,
0323 OSSL_STORE_open_ex_fn open_ex_function);
0324 OSSL_DEPRECATEDIN_3_0
0325 int OSSL_STORE_LOADER_set_attach(OSSL_STORE_LOADER *loader,
0326 OSSL_STORE_attach_fn attach_function);
0327 OSSL_DEPRECATEDIN_3_0
0328 int OSSL_STORE_LOADER_set_ctrl(OSSL_STORE_LOADER *loader,
0329 OSSL_STORE_ctrl_fn ctrl_function);
0330 OSSL_DEPRECATEDIN_3_0
0331 int OSSL_STORE_LOADER_set_expect(OSSL_STORE_LOADER *loader,
0332 OSSL_STORE_expect_fn expect_function);
0333 OSSL_DEPRECATEDIN_3_0
0334 int OSSL_STORE_LOADER_set_find(OSSL_STORE_LOADER *loader,
0335 OSSL_STORE_find_fn find_function);
0336 OSSL_DEPRECATEDIN_3_0
0337 int OSSL_STORE_LOADER_set_load(OSSL_STORE_LOADER *loader,
0338 OSSL_STORE_load_fn load_function);
0339 OSSL_DEPRECATEDIN_3_0
0340 int OSSL_STORE_LOADER_set_eof(OSSL_STORE_LOADER *loader,
0341 OSSL_STORE_eof_fn eof_function);
0342 OSSL_DEPRECATEDIN_3_0
0343 int OSSL_STORE_LOADER_set_error(OSSL_STORE_LOADER *loader,
0344 OSSL_STORE_error_fn error_function);
0345 OSSL_DEPRECATEDIN_3_0
0346 int OSSL_STORE_LOADER_set_close(OSSL_STORE_LOADER *loader,
0347 OSSL_STORE_close_fn close_function);
0348 OSSL_DEPRECATEDIN_3_0
0349 const ENGINE *OSSL_STORE_LOADER_get0_engine(const OSSL_STORE_LOADER *loader);
0350 OSSL_DEPRECATEDIN_3_0
0351 const char *OSSL_STORE_LOADER_get0_scheme(const OSSL_STORE_LOADER *loader);
0352 OSSL_DEPRECATEDIN_3_0
0353 int OSSL_STORE_register_loader(OSSL_STORE_LOADER *loader);
0354 OSSL_DEPRECATEDIN_3_0
0355 OSSL_STORE_LOADER *OSSL_STORE_unregister_loader(const char *scheme);
0356 #endif
0357
0358
0359
0360
0361
0362 #ifndef OPENSSL_NO_DEPRECATED_3_0
0363 OSSL_DEPRECATEDIN_3_0
0364 int OSSL_STORE_do_all_loaders(void (*do_function)(const OSSL_STORE_LOADER *loader,
0365 void *do_arg),
0366 void *do_arg);
0367 #endif
0368
0369 #ifdef __cplusplus
0370 }
0371 #endif
0372 #endif