xref: /freebsd/crypto/openssl/doc/man3/OSSL_STORE_expect.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1e71b7053SJung-uk Kim=pod
2e71b7053SJung-uk Kim
3e71b7053SJung-uk Kim=head1 NAME
4e71b7053SJung-uk Kim
5e71b7053SJung-uk KimOSSL_STORE_expect,
6e71b7053SJung-uk KimOSSL_STORE_supports_search,
7e71b7053SJung-uk KimOSSL_STORE_find
8e71b7053SJung-uk Kim- Specify what object type is expected
9e71b7053SJung-uk Kim
10e71b7053SJung-uk Kim=head1 SYNOPSIS
11e71b7053SJung-uk Kim
12e71b7053SJung-uk Kim #include <openssl/store.h>
13e71b7053SJung-uk Kim
14e71b7053SJung-uk Kim int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);
15e71b7053SJung-uk Kim
16e71b7053SJung-uk Kim int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int criterion_type);
17e71b7053SJung-uk Kim
18e71b7053SJung-uk Kim int OSSL_STORE_find(OSSL_STORE_CTX *ctx, OSSL_STORE_SEARCH *search);
19e71b7053SJung-uk Kim
20e71b7053SJung-uk Kim=head1 DESCRIPTION
21e71b7053SJung-uk Kim
22e71b7053SJung-uk KimOSSL_STORE_expect() helps applications filter what OSSL_STORE_load() returns
23e71b7053SJung-uk Kimby specifying a B<OSSL_STORE_INFO> type.
24*b077aed3SPierre ProncheryBy default, no expectations on the types of objects to be loaded are made.
25*b077aed3SPierre ProncheryI<expected_type> may be 0 to indicate explicitly that no expectation is made,
26*b077aed3SPierre Proncheryor it may be any of the known object types (see
27*b077aed3SPierre ProncheryL<OSSL_STORE_INFO(3)/SUPPORTED OBJECTS>) except for B<OSSL_STORE_INFO_NAME>.
28*b077aed3SPierre ProncheryFor example, if C<file:/foo/bar/store.pem> contains several objects of different
29*b077aed3SPierre Proncherytype and only certificates are interesting, the application can simply say
30e71b7053SJung-uk Kimthat it expects the type B<OSSL_STORE_INFO_CERT>.
31e71b7053SJung-uk Kim
32e71b7053SJung-uk KimOSSL_STORE_find() helps applications specify a criterion for a more fine
33e71b7053SJung-uk Kimgrained search of objects.
34e71b7053SJung-uk Kim
35e71b7053SJung-uk KimOSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE
36e71b7053SJung-uk Kimcontext supports the given search type.
37*b077aed3SPierre ProncherySee L<OSSL_STORE_SEARCH(3)/SUPPORTED CRITERION TYPES> for information on the
38e71b7053SJung-uk Kimsupported search criterion types.
39e71b7053SJung-uk Kim
40e71b7053SJung-uk KimOSSL_STORE_expect() and OSSL_STORE_find I<must> be called before the first
41e71b7053SJung-uk KimOSSL_STORE_load() of a given session, or they will fail.
42e71b7053SJung-uk Kim
43e71b7053SJung-uk Kim=head1 NOTES
44e71b7053SJung-uk Kim
45e71b7053SJung-uk KimIf a more elaborate filter is required by the application, a better choice
46e71b7053SJung-uk Kimwould be to use a post-processing function.
47e71b7053SJung-uk KimSee L<OSSL_STORE_open(3)> for more information.
48e71b7053SJung-uk Kim
49e71b7053SJung-uk KimHowever, some loaders may take advantage of the knowledge of an expected type
50e71b7053SJung-uk Kimto make object retrieval more efficient, so if a single type is expected, this
51e71b7053SJung-uk Kimmethod is usually preferable.
52e71b7053SJung-uk Kim
53e71b7053SJung-uk Kim=head1 RETURN VALUES
54e71b7053SJung-uk Kim
55e71b7053SJung-uk KimOSSL_STORE_expect() returns 1 on success, or 0 on failure.
56e71b7053SJung-uk Kim
57e71b7053SJung-uk KimOSSL_STORE_supports_search() returns 1 if the criterion is supported, or 0
58e71b7053SJung-uk Kimotherwise.
59e71b7053SJung-uk Kim
60e71b7053SJung-uk KimOSSL_STORE_find() returns 1 on success, or 0 on failure.
61e71b7053SJung-uk Kim
62e71b7053SJung-uk Kim=head1 SEE ALSO
63e71b7053SJung-uk Kim
64e71b7053SJung-uk KimL<ossl_store(7)>, L<OSSL_STORE_INFO(3)>, L<OSSL_STORE_SEARCH(3)>,
65e71b7053SJung-uk KimL<OSSL_STORE_load(3)>
66e71b7053SJung-uk Kim
67e71b7053SJung-uk Kim=head1 HISTORY
68e71b7053SJung-uk Kim
69e71b7053SJung-uk KimOSSL_STORE_expect(), OSSL_STORE_supports_search() and OSSL_STORE_find()
706935a639SJung-uk Kimwere added in OpenSSL 1.1.1.
71e71b7053SJung-uk Kim
72e71b7053SJung-uk Kim=head1 COPYRIGHT
73e71b7053SJung-uk Kim
74*b077aed3SPierre ProncheryCopyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
75e71b7053SJung-uk Kim
76*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
77e71b7053SJung-uk Kimthis file except in compliance with the License.  You can obtain a copy
78e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at
79e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>.
80e71b7053SJung-uk Kim
81e71b7053SJung-uk Kim=cut
82