5 ossl_method_store_new, ossl_method_store_free, ossl_method_store_init,
6 ossl_method_store_cleanup, ossl_method_store_add, ossl_method_store_remove,
7 ossl_method_store_fetch, ossl_method_store_set_global_properties,
8 ossl_method_store_cache_get and ossl_method_store_cache_set
9 - implementation method store and query
13 #include "internal/property.h"
15 typedef struct ossl_method_store_st OSSL_METHOD_STORE;
17 OSSL_METHOD_STORE *ossl_method_store_new(void);
18 void ossl_method_store_free(OSSL_METHOD_STORE *store);
19 int ossl_method_store_init(void);
20 void ossl_method_store_cleanup(void);
21 int ossl_method_store_add(OSSL_METHOD_STORE *store,
22 int nid, const char *properties,
24 void (*implementation_destruct)(void *));
25 int ossl_method_store_remove(OSSL_METHOD_STORE *store,
26 int nid, const void *implementation);
27 int ossl_method_store_fetch(OSSL_METHOD_STORE *store,
28 int nid, const char *properties,
30 int ossl_method_store_set_global_properties(OSSL_METHOD_STORE *store,
31 const char *prop_query);
32 int ossl_method_store_cache_get(OSSL_METHOD_STORE *store, int nid,
33 const char *prop_query, void **result);
34 int ossl_method_store_cache_set(OSSL_METHOD_STORE *store, int nid,
35 const char *prop_query, void *result);
39 OSSL_METHOD_STORE stores implementations of algorithms that can be queried using
42 ossl_method_store_init() initialises the implementation method store subsystem.
44 ossl_method_store_cleanup() cleans up and shuts down the implementation method
47 ossl_method_store_new() create a new empty implementation method store.
49 ossl_method_store_free() frees resources allocated to B<store>.
51 ossl_method_store_add() adds the B<implementation> to the B<store> as an
52 instance of the algorithm indicated by B<nid> and the property definition
54 The optional B<implementation_destruct> function is called when
55 B<implementation> is being released from B<store>.
57 ossl_method_store_remove() remove the B<implementation> of algorithm B<nid>
60 ossl_method_store_fetch() query B<store> for an implementation of algorithm
61 B<nid> that matches the property query B<prop_query>.
62 The result, if any, is returned in B<result>.
64 ossl_method_store_set_global_properties() sets implementation method B<store>
65 wide query properties to B<prop_query>.
66 All subsequent fetches will need to meet both these global query properties
67 and the ones passed to the fetch function.
69 ossl_method_store_cache_get() queries the cache associated with the B<store>
70 for an implementation of algorithm B<nid> that matches the property query
72 The result, if any, is returned in B<result>.
74 ossl_method_store_cache_set() sets a cache entry for algorithm B<nid> with the
75 property query B<prop_query> in the B<store>.
76 Future cache gets will return the specified <result>.
80 ossl_method_store_new() a new method store object or B<NULL> on failure.
82 ossl_method_store_free(), ossl_method_store_add(),
83 ossl_method_store_remove(), ossl_method_store_fetch(),
84 ossl_method_store_set_global_properties(), ossl_method_store_cache_get()
85 and ossl_method_store_cache_set() return B<1> on success and B<0> on error.
87 ossl_method_store_free() and ossl_method_store_cleanup() do not return values.
91 This functionality was added to OpenSSL 3.0.0.
95 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
96 Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
98 Licensed under the Apache License 2.0 (the "License"). You may not use this
99 file except in compliance with the License. You can obtain a copy in the file
100 LICENSE in the source distribution or at
101 L<https://www.openssl.org/source/license.html>.