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