OSSL_STORE_expect.3ossl - Man Page

Specify what object type is expected

Synopsis

 #include <openssl/store.h>

 int OSSL_STORE_expect(OSSL_STORE_CTX *ctx, int expected_type);

 int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int criterion_type);

 int OSSL_STORE_find(OSSL_STORE_CTX *ctx, OSSL_STORE_SEARCH *search);

Description

OSSL_STORE_expect() helps applications filter what OSSL_STORE_load() returns by specifying a OSSL_STORE_INFO type. By default, no expectations on the types of objects to be loaded are made. expected_type may be 0 to indicate explicitly that no expectation is made, or it may be any of the known object types (see "SUPPORTED OBJECTS" in OSSL_STORE_INFO(3)) except for OSSL_STORE_INFO_NAME. For example, if file:/foo/bar/store.pem contains several objects of different type and only certificates are interesting, the application can simply say that it expects the type OSSL_STORE_INFO_CERT.

OSSL_STORE_find() helps applications specify a criterion for a more fine grained search of objects.

OSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE context supports the given search type. See "SUPPORTED CRITERION TYPES" in OSSL_STORE_SEARCH(3) for information on the supported search criterion types.

OSSL_STORE_expect() and OSSL_STORE_find must be called before the first OSSL_STORE_load() of a given session, or they will fail.

Notes

If a more elaborate filter is required by the application, a better choice would be to use a post-processing function. See OSSL_STORE_open(3) for more information.

However, some loaders may take advantage of the knowledge of an expected type to make object retrieval more efficient, so if a single type is expected, this method is usually preferable.

Return Values

OSSL_STORE_expect() returns 1 on success, or 0 on failure.

OSSL_STORE_supports_search() returns 1 if the criterion is supported, or 0 otherwise.

OSSL_STORE_find() returns 1 on success, or 0 on failure.

See Also

ossl_store(7), OSSL_STORE_INFO(3), OSSL_STORE_SEARCH(3), OSSL_STORE_load(3)

History

OSSL_STORE_expect(), OSSL_STORE_supports_search() and OSSL_STORE_find() were added in OpenSSL 1.1.1.

Referenced By

ossl_store.7ossl(7).

The man pages OSSL_STORE_find.3ossl(3) and OSSL_STORE_supports_search.3ossl(3) are aliases of OSSL_STORE_expect.3ossl(3).

2024-04-04 3.2.1 OpenSSL