]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/internal/man3/OSSL_METHOD_STORE.pod
Properties for implementation selection.
[thirdparty/openssl.git] / doc / internal / man3 / OSSL_METHOD_STORE.pod
CommitLineData
1bdbdaff
P
1=pod
2
3=head1 NAME
4
5ossl_method_store_new, ossl_method_store_free, ossl_method_store_init,
6ossl_method_store_cleanup, ossl_method_store_add, ossl_method_store_remove,
7ossl_method_store_fetch, ossl_method_store_set_global_properties,
8ossl_method_store_cache_get and ossl_method_store_cache_set
9- implementation method store and query
10
11=head1 SYNOPSIS
12
13 #include "internal/property.h"
14
15 typedef struct ossl_method_store_st OSSL_METHOD_STORE;
16
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,
23 void *implementation,
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,
29 void **result);
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);
36
37=head1 DESCRIPTION
38
39OSSL_METHOD_STORE stores implementations of algorithms that can be queried using
40properties and a NID.
41
42ossl_method_store_init() initialises the implementation method store subsystem.
43
44ossl_method_store_cleanup() cleans up and shuts down the implementation method
45store subsystem
46
47ossl_method_store_new() create a new empty implementation method store.
48
49ossl_method_store_free() frees resources allocated to B<store>.
50
51ossl_method_store_add() adds the B<implementation> to the B<store> as an
52instance of the algorithm indicated by B<nid> and the property definition
53<properties>.
54The optional B<implementation_destruct> function is called when
55B<implementation> is being released from B<store>.
56
57ossl_method_store_remove() remove the B<implementation> of algorithm B<nid>
58from the B<store>.
59
60ossl_method_store_fetch() query B<store> for an implementation of algorithm
61B<nid> that matches the property query B<prop_query>.
62The result, if any, is returned in B<result>.
63
64ossl_method_store_set_global_properties() sets implementation method B<store>
65wide query properties to B<prop_query>.
66All subsequent fetches will need to meet both these global query properties
67and the ones passed to the fetch function.
68
69ossl_method_store_cache_get() queries the cache associated with the B<store>
70for an implementation of algorithm B<nid> that matches the property query
71B<prop_query>.
72The result, if any, is returned in B<result>.
73
74ossl_method_store_cache_set() sets a cache entry for algorithm B<nid> with the
75property query B<prop_query> in the B<store>.
76Future cache gets will return the specified <result>.
77
78=head1 RETURN VALUES
79
80ossl_method_store_new() a new method store object or B<NULL> on failure.
81
82ossl_method_store_free(), ossl_method_store_add(),
83ossl_method_store_remove(), ossl_method_store_fetch(),
84ossl_method_store_set_global_properties(), ossl_method_store_cache_get()
85and ossl_method_store_cache_set() return B<1> on success and B<0> on error.
86
87ossl_method_store_free() and ossl_method_store_cleanup() do not return values.
88
89=head1 HISTORY
90
91This functionality was added to OpenSSL 3.0.0.
92
93=head1 COPYRIGHT
94
95Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
96Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
97
98Licensed under the Apache License 2.0 (the "License"). You may not use this
99file except in compliance with the License. You can obtain a copy in the file
100LICENSE in the source distribution or at
101L<https://www.openssl.org/source/license.html>.
102
103=cut