xref: /freebsd/secure/lib/libcrypto/man/man3/OSSL_STORE_SEARCH.3 (revision 9f44a47fd07924afc035991af15d84e6585dea4f)
Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "OSSL_STORE_SEARCH 3"
OSSL_STORE_SEARCH 3 "2023-05-30" "1.1.1u" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"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"
Header "SYNOPSIS" .Vb 1 #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); .Ve
"DESCRIPTION"
Header "DESCRIPTION" These functions are used to specify search criteria to help search for specific objects through other names than just the \s-1URI\s0 that's given to OSSL_STORE_open(). For example, this can be useful for an application that has received a \s-1URI\s0 and then wants to add on search criteria in a uniform and supported manner.
"Types"
Subsection "Types" \fB\s-1OSSL_STORE_SEARCH\s0 is an opaque type that holds the constructed search criterion, and that can be given to an \s-1OSSL_STORE\s0 context with \fBOSSL_STORE_find().

The calling application owns the allocation of an \s-1OSSL_STORE_SEARCH\s0 at all times, and should therefore be careful not to deallocate it before \fBOSSL_STORE_close() has been called for the \s-1OSSL_STORE\s0 context it was given to.

"Application Functions"
Subsection "Application Functions" \fBOSSL_STORE_SEARCH_by_name(), \fBOSSL_STORE_SEARCH_by_issuer_serial(), \fBOSSL_STORE_SEARCH_by_key_fingerprint(), and OSSL_STORE_SEARCH_by_alias() are used to create an \s-1OSSL_STORE_SEARCH\s0 from 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 created \fB\s-1OSSL_STORE_SEARCH\s0.

\fBOSSL_STORE_SEARCH_free() is used to free the \s-1OSSL_STORE_SEARCH\s0.

"Loader Functions"
Subsection "Loader Functions" \fBOSSL_STORE_SEARCH_get_type() returns the criterion type for the given \fB\s-1OSSL_STORE_SEARCH\s0.

\fBOSSL_STORE_SEARCH_get0_name(), OSSL_STORE_SEARCH_get0_serial(), \fBOSSL_STORE_SEARCH_get0_bytes(), OSSL_STORE_SEARCH_get0_string(), and OSSL_STORE_SEARCH_get0_digest() are used to retrieve different data from a \s-1OSSL_STORE_SEARCH\s0, as available for each type. For more information, see \*(L"\s-1SUPPORTED CRITERION TYPES\*(R"\s0 below.

"SUPPORTED CRITERION TYPES"
Header "SUPPORTED CRITERION TYPES" Currently supported criterion types are:
"\s-1OSSL_STORE_SEARCH_BY_NAME\s0" 4
Item "OSSL_STORE_SEARCH_BY_NAME" This criterion supports a search by exact match of subject name. The subject name itself is a X509_NAME pointer. A criterion of this type is created with OSSL_STORE_SEARCH_by_name(), and the actual subject name is retrieved with OSSL_STORE_SEARCH_get0_name().
"\s-1OSSL_STORE_SEARCH_BY_ISSUER_SERIAL\s0" 4
Item "OSSL_STORE_SEARCH_BY_ISSUER_SERIAL" This criterion supports a search by exact match of both issuer name and serial number. The issuer name itself is a X509_NAME pointer, and the serial number is a \s-1ASN1_INTEGER\s0 pointer. A criterion of this type is created with OSSL_STORE_SEARCH_by_issuer_serial() and the actual issuer name and serial number are retrieved with \fBOSSL_STORE_SEARCH_get0_name() and OSSL_STORE_SEARCH_get0_serial().
"\s-1OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT\s0" 4
Item "OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT" This criterion 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 (\s-1NULL\s0), and in that case, the loader has to decide on a default digest and compare fingerprints accordingly. A criterion of this type is created with OSSL_STORE_SEARCH_by_key_fingerprint() and the actual fingerprint and its length can be retrieved with \fBOSSL_STORE_SEARCH_get0_bytes(). The digest can be retrieved with OSSL_STORE_SEARCH_get0_digest().
"\s-1OSSL_STORE_SEARCH_BY_ALIAS\s0" 4
Item "OSSL_STORE_SEARCH_BY_ALIAS" This criterion 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 with OSSL_STORE_SEARCH_by_alias() and the actual alias is retrieved with OSSL_STORE_SEARCH_get0_string().
"RETURN VALUES"
Header "RETURN VALUES" \fBOSSL_STORE_SEARCH_by_name(), \fBOSSL_STORE_SEARCH_by_issuer_serial(), \fBOSSL_STORE_SEARCH_by_key_fingerprint(), and OSSL_STORE_SEARCH_by_alias() return a \s-1OSSL_STORE_SEARCH\s0 pointer on success, or \s-1NULL\s0 on failure.

\fBOSSL_STORE_SEARCH_get_type() returns the criterion type of the given \fB\s-1OSSL_STORE_SEARCH\s0. There is no error value.

\fBOSSL_STORE_SEARCH_get0_name() returns a X509_NAME pointer on success, or \s-1NULL\s0 when the given \s-1OSSL_STORE_SEARCH\s0 was of a different type.

\fBOSSL_STORE_SEARCH_get0_serial() returns a \s-1ASN1_INTEGER\s0 pointer on success, or \s-1NULL\s0 when the given \s-1OSSL_STORE_SEARCH\s0 was of a different type.

\fBOSSL_STORE_SEARCH_get0_bytes() returns a const unsigned char pointer and sets *length to the strings length on success, or \s-1NULL\s0 when the given \fB\s-1OSSL_STORE_SEARCH\s0 was of a different type.

\fBOSSL_STORE_SEARCH_get0_string() returns a const char pointer on success, or \s-1NULL\s0 when the given \s-1OSSL_STORE_SEARCH\s0 was of a different type.

\fBOSSL_STORE_SEARCH_get0_digest() returns a const \s-1EVP_MD\s0 pointer. \fB\s-1NULL\s0 is a valid value and means that the store loader default will be used when applicable.

"SEE ALSO"
Header "SEE ALSO" \fBossl_store\|(7), OSSL_STORE_supports_search\|(3), OSSL_STORE_find\|(3)
"HISTORY"
Header "HISTORY" \fB\s-1OSSL_STORE_SEARCH\s0, \fBOSSL_STORE_SEARCH_by_name(), \fBOSSL_STORE_SEARCH_by_issuer_serial(), \fBOSSL_STORE_SEARCH_by_key_fingerprint(), \fBOSSL_STORE_SEARCH_by_alias(), \fBOSSL_STORE_SEARCH_free(), \fBOSSL_STORE_SEARCH_get_type(), \fBOSSL_STORE_SEARCH_get0_name(), \fBOSSL_STORE_SEARCH_get0_serial(), \fBOSSL_STORE_SEARCH_get0_bytes(), and OSSL_STORE_SEARCH_get0_string() were added in OpenSSL 1.1.1.
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.