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