OSSL_STORE_EXPECT(3SSL)
π OSSL_STORE_EXPECT π
okay bestie, gather round, because this is the OSSL_STORE_EXPECT(3SSL) page and it's literally about telling your loader what kind of object you're looking for before it goes rummaging around in your files. Three functions, one very specific job: specify what object type is expected. no cap. π
β¨ 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() is your little helper for filtering what OSSL_STORE_load() hands back to you β it does that by specifying a OSSL_STORE_INFO type. π
By default? literally no expectations on the types of objects to be loaded are made. anything goes, it's giving chaos. π
expected_type can be 0 if you wanna say explicitly that you're making no expectation at all, or it can be any of the known object types (peep <hotpink>"SUPPORTED OBJECTS"</hotpink> in OSSL_STORE_INFO(3) for the full menu) β with one exception: not OSSL_STORE_INFO_NAME. sorry bestie, that one's off the table. π
ngl the example here is so clean: 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. icon behavior honestly. πΈ
OSSL_STORE_find() is the next level up β it helps applications specify a criterion for a more fine grained search of objects. so like, β¨pickyβ¨ in the best way.
OSSL_STORE_supports_search() checks if the loader of the given OSSL_STORE context supports the given search type. want the tea on which search criterion types are a thing? go read <hotpink>"SUPPORTED CRITERION TYPES"</hotpink> in OSSL_STORE_SEARCH(3). iykyk. π«Ά
π¨ TIMING CHECK, BESTIE π¨ βOSSL_STORE_expect()andOSSL_STORE_findmust be called before the firstOSSL_STORE_load()of a given session, or they will fail. don't show up late to this party, fr fr. π
π 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 β and this is the slay part β 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()returns1on success, or0on failure.OSSL_STORE_supports_search()returns1if the criterion is supported, or0otherwise.OSSL_STORE_find()returns1on success, or0on failure.
π SEE ALSO π
π HISTORY π
OSSL_STORE_expect(), OSSL_STORE_supports_search() and OSSL_STORE_find() were added in OpenSSL 1.1.1. so they're not even new new, they've been serving looks for a minute. π
π COPYRIGHT π
Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page bestie, no crumbs left π β this was OSSL_STORE_EXPECT(3SSL), OpenSSL 4.0.3, dated 2026-09-29. go filter some objects, you're gonna eat. πβ¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms