OSSL_STORE_SEARCH(3ossl)
okay bestie, welcome to OpenSSLβs OSSL_STORE_SEARCH(3ossl) page β the one about the type + functions that create OSSL_STORE search criteria. π
β¨ NAME β¨
OSSL_STORE_SEARCH, OSSL_STORE_SEARCH_by_name, OSSL_STORE_SEARCH_by_issuer_serial, OSSL_STORE_SEARCH_by_key_fingerprint, OSSL_STORE_SEARCH_by_alias, OSSL_STORE_SEARCH_free, OSSL_STORE_SEARCH_get_type, OSSL_STORE_SEARCH_get0_name, OSSL_STORE_SEARCH_get0_serial, OSSL_STORE_SEARCH_get0_bytes, OSSL_STORE_SEARCH_get0_string, OSSL_STORE_SEARCH_get0_digest β type and functions to create OSSL_STORE search criteria. π
ποΈ SYNOPSIS ποΈ
No cap, hereβs the whole cast in code form:
#include <openssl/store.h>
typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_name(X509_NAME *name);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_issuer_serial(X509_NAME *name,
const ASN1_INTEGER
*serial);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest,
const unsigned char
*bytes, int len);
OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_alias(const char *alias);
void OSSL_STORE_SEARCH_free(OSSL_STORE_SEARCH *search);
int OSSL_STORE_SEARCH_get_type(const OSSL_STORE_SEARCH *criterion);
X509_NAME *OSSL_STORE_SEARCH_get0_name(OSSL_STORE_SEARCH *criterion);
const ASN1_INTEGER *OSSL_STORE_SEARCH_get0_serial(const OSSL_STORE_SEARCH
*criterion);
const unsigned char *OSSL_STORE_SEARCH_get0_bytes(const OSSL_STORE_SEARCH
*criterion, size_t *length);
const char *OSSL_STORE_SEARCH_get0_string(const OSSL_STORE_SEARCH *criterion);
const EVP_MD *OSSL_STORE_SEARCH_get0_digest(const OSSL_STORE_SEARCH
*criterion);
π§ DESCRIPTION π§
These functions are used to specify search criteria to help search for specific objects through other names than just the URI that's given to OSSL_STORE_open(). For example, this can be useful for an application that has received a URI and then wants to add on search criteria in a uniform and supported manner. β¨
𧬠Types
OSSL_STORE_SEARCH is an opaque type that holds the constructed search criterion, and it can be given to an OSSL_STORE context with OSSL_STORE_find(). π«Ά
The calling application owns the allocation of an OSSL_STORE_SEARCH at all times, so bestie, please be careful not to deallocate it before OSSL_STORE_close() has been called for the OSSL_STORE context it was given to. That part matters.
π οΈ Application Functions
OSSL_STORE_SEARCH_by_name(),OSSL_STORE_SEARCH_by_issuer_serial(),OSSL_STORE_SEARCH_by_key_fingerprint(), andOSSL_STORE_SEARCH_by_alias()β create anOSSL_STORE_SEARCHfrom a subject name, an issuer name and serial number pair, a key fingerprint, and an alias (for example a friendly name). The parameters that are provided are not copied, only referred to in a criterion, so they must have at least the same life time as the createdOSSL_STORE_SEARCH. πOSSL_STORE_SEARCH_free()β frees theOSSL_STORE_SEARCH. If the argument isNULL, nothing is done. No stress.
π Loader Functions
OSSL_STORE_SEARCH_get_type()β returns the criterion type for the givenOSSL_STORE_SEARCH. πOSSL_STORE_SEARCH_get0_name(),OSSL_STORE_SEARCH_get0_serial(),OSSL_STORE_SEARCH_get0_bytes(),OSSL_STORE_SEARCH_get0_string(), andOSSL_STORE_SEARCH_get0_digest()β retrieve different data from anOSSL_STORE_SEARCH, as available for each type. For more information, see "SUPPORTED CRITERION TYPES" below. π
π SUPPORTED CRITERION TYPES π
Currently supported criterion types are:
OSSL_STORE_SEARCH_BY_NAMEβ supports a search by exact match of subject name. The subject name itself is anX509_NAMEpointer. A criterion of this type is created withOSSL_STORE_SEARCH_by_name(), and the actual subject name is retrieved withOSSL_STORE_SEARCH_get0_name(). πOSSL_STORE_SEARCH_BY_ISSUER_SERIALβ supports a search by exact match of both issuer name and serial number. The issuer name itself is anX509_NAMEpointer, and the serial number is anASN1_INTEGERpointer. A criterion of this type is created withOSSL_STORE_SEARCH_by_issuer_serial()and the actual issuer name and serial number are retrieved withOSSL_STORE_SEARCH_get0_name()andOSSL_STORE_SEARCH_get0_serial(). π¦OSSL_STORE_SEARCH_BY_KEY_FINGERPRINTβ supports a search by exact match of key fingerprint. The key fingerprint in itself is a string of bytes and its length, as well as the algorithm that was used to compute the fingerprint. The digest may be left unspecified (NULL), and in that case, the loader has to decide on a default digest and compare fingerprints accordingly. A criterion of this type is created withOSSL_STORE_SEARCH_by_key_fingerprint()and the actual fingerprint and its length can be retrieved withOSSL_STORE_SEARCH_get0_bytes(). The digest can be retrieved withOSSL_STORE_SEARCH_get0_digest(). π₯OSSL_STORE_SEARCH_BY_ALIASβ supports a search by match of an alias of some kind. The alias in itself is a simple C string. A criterion of this type is created withOSSL_STORE_SEARCH_by_alias()and the actual alias is retrieved withOSSL_STORE_SEARCH_get0_string(). πΈ
π RETURN VALUES π
OSSL_STORE_SEARCH_by_name(),OSSL_STORE_SEARCH_by_issuer_serial(),OSSL_STORE_SEARCH_by_key_fingerprint(), andOSSL_STORE_SEARCH_by_alias()return anOSSL_STORE_SEARCHpointer on success, orNULLon failure. πOSSL_STORE_SEARCH_get_type()returns the criterion type of the givenOSSL_STORE_SEARCH. There is no error value. βOSSL_STORE_SEARCH_get0_name()returns anX509_NAMEpointer on success, orNULLwhen the givenOSSL_STORE_SEARCHwas of a different type.OSSL_STORE_SEARCH_get0_serial()returns anASN1_INTEGERpointer on success, orNULLwhen the givenOSSL_STORE_SEARCHwas of a different type.OSSL_STORE_SEARCH_get0_bytes()returns aconst unsigned charpointer and sets*lengthto the string's length on success, orNULLwhen the givenOSSL_STORE_SEARCHwas of a different type.OSSL_STORE_SEARCH_get0_string()returns aconst charpointer on success, orNULLwhen the givenOSSL_STORE_SEARCHwas of a different type.OSSL_STORE_SEARCH_get0_digest()returns aconst EVP_MDpointer.NULLis a valid value and means that the store loader default will be used when applicable. π
π¦ SEE ALSO π¦
ossl_store(7), OSSL_STORE_supports_search(3), OSSL_STORE_find(3) β go read those next, iykyk. π¦
β HISTORY β
OSSL_STORE_SEARCH, OSSL_STORE_SEARCH_by_name(), OSSL_STORE_SEARCH_by_issuer_serial(), OSSL_STORE_SEARCH_by_key_fingerprint(), OSSL_STORE_SEARCH_by_alias(), OSSL_STORE_SEARCH_free(), OSSL_STORE_SEARCH_get_type(), OSSL_STORE_SEARCH_get0_name(), OSSL_STORE_SEARCH_get0_serial(), OSSL_STORE_SEARCH_get0_bytes(), and OSSL_STORE_SEARCH_get0_string() were added in OpenSSL 1.1.1. periodt.
π COPYRIGHT π
Copyright 2018-2024 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>.
Thatβs the whole vibe check β this page is from OpenSSL version 3.5.6, dated 2026-04-07. Bye bestie, go build something iconic! π¦πβ¨
π¦ 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