OSSL_STORE_expect.pod 2.4 KB

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