OSSL_STORE_EXPECT(3ossl)
β¨ OSSL_STORE_EXPECT β¨
okay so bestie, this is the 3ossl girlies' guide to OSSL_STORE_expect, OSSL_STORE_supports_search and OSSL_STORE_find β three lil functions that let you tell an OSSL_STORE context what kind of object you're actually looking for. it's giving "let me filter my feed" energy π
πΈ 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 the main character here, fr fr. it helps your app filter what OSSL_STORE_load() hands back by telling it which OSSL_STORE_INFO type you want. by default, no expectations about the types of objects to be loaded are made β literally zero vibes specified, whatever shows up shows up. π
expected_type can be 0 to say out loud "nope, no expectation here", or it can be any of the known object types (peep "SUPPORTED OBJECTS" in OSSL_STORE_INFO(3)) except for OSSL_STORE_INFO_NAME β that one's not invited to this party. for example, if "file:/foo/bar/store.pem" contains several objects of different type and only certificates are interesting, your app can simply say it expects the type OSSL_STORE_INFO_CERT. iconic, minimal effort, slay π
OSSL_STORE_find() is here for when you want to be picky β it helps applications specify a criterion for a more fine grained search of objects. yes bestie, we're curating π₯
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 info on the supported search criterion types π
β οΈ timing check, bestie:OSSL_STORE_expect()andOSSL_STORE_findmust be called before the firstOSSL_STORE_load()of a given session, or they will fail. no showing up late to the group chat π«Ά
π¦ NOTES π¦
if your app needs a more elaborate filter, a better choice would be to use a post-processing function β see OSSL_STORE_open(3) for more info. that's the "we do it the long way" route π
but lowkey? some loaders may take advantage of the knowledge of an expected type to make object retrieval more efficient, so if you're expecting a single type, this method is usually preferable. efficient queen behavior π§
π RETURN VALUES π
OSSL_STORE_expect()β returns1on success, or0on failure. simple as πOSSL_STORE_supports_search()β returns1if the criterion is supported, or0otherwise.OSSL_STORE_find()β returns1on success, or0on 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. vintage but still ate π
π 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>.
π ok that's the whole page bestie, go filter some objects. this was OpenSSL3.5.6, dated2026-04-07, signing off with a lil mwah π βOSSL_STORE_EXPECT(3ossl), out! π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms