OSSL_STORE_INFO(3ossl)
π OSSL_STORE_INFO β bestie's guide to OpenSSL's little object-holder β¨
okay so. this is OSSL_STORE_INFO(3ossl) from OpenSSL, and it's genuinely one of those pages that looks scary but is actually just a cute little wrapper situation. let's get into it π«Ά
πΈ NAME πΈ
OSSL_STORE_INFO, OSSL_STORE_INFO_get_type, OSSL_STORE_INFO_get0_NAME, OSSL_STORE_INFO_get0_NAME_description, OSSL_STORE_INFO_get0_PARAMS, OSSL_STORE_INFO_get0_PUBKEY, OSSL_STORE_INFO_get0_PKEY, OSSL_STORE_INFO_get0_CERT, OSSL_STORE_INFO_get0_CRL, OSSL_STORE_INFO_get1_NAME, OSSL_STORE_INFO_get1_NAME_description, OSSL_STORE_INFO_get1_PARAMS, OSSL_STORE_INFO_get1_PUBKEY, OSSL_STORE_INFO_get1_PKEY, OSSL_STORE_INFO_get1_CERT, OSSL_STORE_INFO_get1_CRL, OSSL_STORE_INFO_type_string, OSSL_STORE_INFO_free, OSSL_STORE_INFO_new_NAME, OSSL_STORE_INFO_set0_NAME_description, OSSL_STORE_INFO_new_PARAMS, OSSL_STORE_INFO_new_PUBKEY, OSSL_STORE_INFO_new_PKEY, OSSL_STORE_INFO_new_CERT, OSSL_STORE_INFO_new_CRL, OSSL_STORE_INFO_new, OSSL_STORE_INFO_get0_data β these are literally just functions to manipulate OSSL_STORE_INFO objects. that's it. that's the whole vibe π
β¨ SYNOPSIS β¨
#include <openssl/store.h>
typedef struct ossl_store_info_st OSSL_STORE_INFO;
int OSSL_STORE_INFO_get_type(const OSSL_STORE_INFO *store_info);
const char *OSSL_STORE_INFO_get0_NAME(const OSSL_STORE_INFO *store_info);
char *OSSL_STORE_INFO_get1_NAME(const OSSL_STORE_INFO *store_info);
const char *OSSL_STORE_INFO_get0_NAME_description(const OSSL_STORE_INFO
*store_info);
char *OSSL_STORE_INFO_get1_NAME_description(const OSSL_STORE_INFO *store_info);
EVP_PKEY *OSSL_STORE_INFO_get0_PARAMS(const OSSL_STORE_INFO *store_info);
EVP_PKEY *OSSL_STORE_INFO_get1_PARAMS(const OSSL_STORE_INFO *store_info);
EVP_PKEY *OSSL_STORE_INFO_get0_PUBKEY(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get1_PUBKEY(const OSSL_STORE_INFO *info);
EVP_PKEY *OSSL_STORE_INFO_get0_PKEY(const OSSL_STORE_INFO *store_info);
EVP_PKEY *OSSL_STORE_INFO_get1_PKEY(const OSSL_STORE_INFO *store_info);
X509 *OSSL_STORE_INFO_get0_CERT(const OSSL_STORE_INFO *store_info);
X509 *OSSL_STORE_INFO_get1_CERT(const OSSL_STORE_INFO *store_info);
X509_CRL *OSSL_STORE_INFO_get0_CRL(const OSSL_STORE_INFO *store_info);
X509_CRL *OSSL_STORE_INFO_get1_CRL(const OSSL_STORE_INFO *store_info);
const char *OSSL_STORE_INFO_type_string(int type);
void OSSL_STORE_INFO_free(OSSL_STORE_INFO *store_info);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_NAME(char *name);
int OSSL_STORE_INFO_set0_NAME_description(OSSL_STORE_INFO *info, char *desc);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_PARAMS(DSA *dsa_params);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_PUBKEY(EVP_PKEY *pubkey);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_PKEY(EVP_PKEY *pkey);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_CERT(X509 *x509);
OSSL_STORE_INFO *OSSL_STORE_INFO_new_CRL(X509_CRL *crl);
OSSL_STORE_INFO *OSSL_STORE_INFO_new(int type, void *data);
void *OSSL_STORE_INFO_get0_data(int type, const OSSL_STORE_INFO *info);
π DESCRIPTION π
so these functions are here for two main-character reasons:
- so applications can pull the objects they support out of
OSSL_STORE_INFOobjects π - so scheme-specific loaders can make
OSSL_STORE_INFOholders π
π¦ Types π¦
OSSL_STORE_INFO is an opaque type β like, you don't get to peek inside, bestie, it's giving mysterious β¨. it's just an intermediary holder for objects that got retrieved by OSSL_STORE_load() and friends.
any supported OpenSSL type object can be extracted with one of the STORE_INFO_get0_<TYPE>() functions, where <TYPE> can be NAME, PARAMS, PKEY, CERT, or CRL.
β οΈ important!! the lifetime of the object you extract this way is only as long as the lifetime of theOSSL_STORE_INFOyou extracted it from. so do NOT free thatOSSL_STORE_INFOtoo early, ok? it will not slay. it will be a crime scene π
as an alternative, STORE_INFO_get1_<TYPE>() extracts a duplicate (or the same object with its reference count bumped up π), which you can use after the containing OSSL_STORE_INFO has been freed. but β and hear me out β the object returned by STORE_INFO_get1_<TYPE>() must be freed separately by the caller. your problem now π
peep "SUPPORTED OBJECTS" below for the deets on which types are supported π
πΈ Functions πΈ
OSSL_STORE_INFO_get_type()β takes anOSSL_STORE_INFOand hands you back the STORE type number of the object inside. that's the whole job. iconic.STORE_INFO_get_type_string()β takes a STORE type number and gives you a short string describing it. little label moment π·οΈOSSL_STORE_INFO_get0_NAME(),OSSL_STORE_INFO_get0_NAME_description(),OSSL_STORE_INFO_get0_PARAMS(),OSSL_STORE_INFO_get0_PUBKEY(),OSSL_STORE_INFO_get0_PKEY(),OSSL_STORE_INFO_get0_CERT(),OSSL_STORE_INFO_get0_CRL()β all of these take anOSSL_STORE_INFOand return the object it holds, but only if theOSSL_STORE_INFOtype (as returned byOSSL_STORE_INFO_get_type()) matches the function. otherwise you getNULL. type mismatch = left on read πOSSL_STORE_INFO_get1_NAME(),OSSL_STORE_INFO_get1_NAME_description(),OSSL_STORE_INFO_get1_PARAMS(),OSSL_STORE_INFO_get1_PUBKEY(),OSSL_STORE_INFO_get1_PKEY(),OSSL_STORE_INFO_get1_CERT(),OSSL_STORE_INFO_get1_CRL()β same energy as theget0girlies, except they return a duplicate of the object it holds, if theOSSL_STORE_INFOtype (again, as returned byOSSL_STORE_INFO_get_type()) matches. otherwiseNULL. β¨OSSL_STORE_INFO_free()β frees anOSSL_STORE_INFOand its contained type. if the argument isNULL, nothing happens. it's unbothered. it's at peace π§OSSL_STORE_INFO_new_NAME(),OSSL_STORE_INFO_new_PARAMS(),OSSL_STORE_INFO_new_PUBKEY(),OSSL_STORE_INFO_new_PKEY(),OSSL_STORE_INFO_new_CERT(),OSSL_STORE_INFO_new_CRL()β create anOSSL_STORE_INFOobject to hold the input object you give them. on success the input object is consumed. it's eaten. gone. absorbed. π½οΈOSSL_STORE_INFO_set0_NAME_description()β forOSSL_STORE_INFO_NAMEobjects specifically, this adds an extra description. this description is meant to be human readable and should be used for information printout. it's for the people π£OSSL_STORE_INFO_new()β creates anOSSL_STORE_INFOwith an arbitrary type number and data structure. it's your responsibility, the caller's, to define type numbers other than the ones defined by<openssl/store.h>, and to handle freeing the associated data structure on your own. π«΅
π do not use type numbers that are defined by<openssl/store.h>withOSSL_STORE_INFO_new()β this may cause undefined behaviours, including crashes. no cap. crashes. we don't do that here.
OSSL_STORE_INFO_get0_data()β returns the data pointer that was passed toOSSL_STORE_INFO_new(), if type matches the type number in info. match made in heaven or nothing π
OSSL_STORE_INFO_new() and OSSL_STORE_INFO_get0_data() may be useful for applications that define their own STORE data, but must be used with care. proceed with caution bestie π§
π SUPPORTED OBJECTS π
currently supported object types are:
OSSL_STORE_INFO_NAMEβ a name is exactly that, a name. it's like a name in a directory, but formatted as a complete URI. for example, the path in URI"file:/foo/bar/"could include a file named"cookie.pem", and in that case, the returnedOSSL_STORE_INFO_NAMEobject would have the URI"file:/foo/bar/cookie.pem", which the application can use to get the objects in that file. this can be applied to all schemes that can somehow support a listing of object URIs. π
for "file:" URIs that are used without the explicit scheme, the returned name will be the path of each object, so if "/foo/bar" was given and that path has the file "cookie.pem", the name "/foo/bar/cookie.pem" will be returned. πͺ
the returned URI is considered canonical and must be unique and permanent for the storage where the object (or collection of objects) resides. each loader is responsible for ensuring that it only returns canonical URIs. however, it's possible that certain schemes allow an object (or collection thereof) to be reached with alternative URIs; just because one URI is canonical doesn't mean that other variants can't be used. multiple paths, one destiny β¨
at the discretion of the loader that was used to get these names, an extra description may be attached as well. π
OSSL_STORE_INFO_PARAMSβ key parameters.OSSL_STORE_INFO_PKEYβ a keypair or just a private key (possibly with key parameters).OSSL_STORE_INFO_PUBKEYβ a public key (possibly with key parameters).OSSL_STORE_INFO_CERTβ an X.509 certificate.OSSL_STORE_INFO_CRLβ a X.509 certificate revocation list.
β RETURN VALUES β
OSSL_STORE_INFO_get_type()β returns the STORE type number of the givenOSSL_STORE_INFO. there is no error value. it always comes through. reliable queen πOSSL_STORE_INFO_get0_NAME(),OSSL_STORE_INFO_get0_NAME_description(),OSSL_STORE_INFO_get0_PARAMS(),OSSL_STORE_INFO_get0_PKEY(),OSSL_STORE_INFO_get0_CERT(),OSSL_STORE_INFO_get0_CRL()β all return a pointer to the OpenSSL object on success,NULLotherwise.OSSL_STORE_INFO_get1_NAME(),OSSL_STORE_INFO_get1_NAME_description(),OSSL_STORE_INFO_get1_PARAMS(),OSSL_STORE_INFO_get1_PKEY(),OSSL_STORE_INFO_get1_CERT(),OSSL_STORE_INFO_get1_CRL()β all return a pointer to a duplicate of the OpenSSL object on success,NULLotherwise.OSSL_STORE_INFO_type_string()β returns a string on success, orNULLon failure.OSSL_STORE_INFO_new_NAME(),OSSL_STORE_INFO_new_PARAMS(),OSSL_STORE_INFO_new_PKEY(),OSSL_STORE_INFO_new_CERT(),OSSL_STORE_INFO_new_CRL()β return anOSSL_STORE_INFOpointer on success, orNULLon failure.OSSL_STORE_INFO_set0_NAME_description()β returns1on success, or0on failure.
π SEE ALSO π
ossl_store(7), OSSL_STORE_open(3), OSSL_STORE_register_loader(3)
go read those next, bestie, the lore runs deep π
π HISTORY π
- the
OSSL_STOREAPI was added in OpenSSL 1.1.1. - the
OSSL_STORE_INFO_PUBKEYobject type was added in OpenSSL 3.0.
glow-up timeline fr fr π±β‘οΈπΈ
π COPYRIGHT π
Copyright 2016-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>.
and that's the whole page, babe π«Ά this was OpenSSL 3.5.9, dated 2026-09-29, and it's the OSSL_STORE_INFO(3ossl) man page. stay canonical, stay unique, stay permanent β¨π
π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms