EVP_KEYMGMT(3SSL)
π EVP_KEYMGMT π
okay bestie come CLOSE. this is EVP_KEYMGMT, live from the OpenSSL manual pages, and she's the key management method object of your dreams. multiple functions, one whole squad: EVP_KEYMGMT, EVP_KEYMGMT_fetch, EVP_KEYMGMT_up_ref, EVP_KEYMGMT_free, EVP_KEYMGMT_get0_provider, EVP_KEYMGMT_is_a, EVP_KEYMGMT_get0_description, EVP_KEYMGMT_get0_name, EVP_KEYMGMT_do_all_provided, EVP_KEYMGMT_names_do_all, EVP_KEYMGMT_gettable_params, EVP_KEYMGMT_settable_params, EVP_KEYMGMT_gen_gettable_params, EVP_KEYMGMT_gen_settable_params. all of them are EVP key management routines. the whole girlband. let's go π
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
typedef struct evp_keymgmt_st EVP_KEYMGMT;
EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
const OSSL_PROVIDER *EVP_KEYMGMT_get0_provider(const EVP_KEYMGMT *keymgmt);
int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name);
const char *EVP_KEYMGMT_get0_name(const EVP_KEYMGMT *keymgmt);
const char *EVP_KEYMGMT_get0_description(const EVP_KEYMGMT *keymgmt);
void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
void *arg);
int EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
void (*fn)(const char *name, void *data),
void *data);
const OSSL_PARAM *EVP_KEYMGMT_gettable_params(const EVP_KEYMGMT *keymgmt);
const OSSL_PARAM *EVP_KEYMGMT_settable_params(const EVP_KEYMGMT *keymgmt);
const OSSL_PARAM *EVP_KEYMGMT_gen_settable_params(const EVP_KEYMGMT *keymgmt);
const OSSL_PARAM *EVP_KEYMGMT_gen_gettable_params(const EVP_KEYMGMT *keymgmt);
πΈ DESCRIPTION πΈ
EVP_KEYMGMT is a method object that represents key management implementations for different cryptographic algorithms. iconic behavior. this method object provides functionality to have providers import key material from the outside, and also to export key material to the outside (the way she moves between the group chat and the real world, honestly). most of this functionality can only be used internally and has no public interface β the object is simply passed into other functions when needed. yeah she's lowkey backstage crew with main character energy π
EVP_KEYMGMT_fetch()β hunts for an algorithm inside the provider that's been loaded into theOSSL_LIB_CTXgiven by ctx, that has the name given by algorithm and the properties given by properties. it's giving "looking for that one specific girl in the crowd".EVP_KEYMGMT_up_ref()β increments the reference count for the givenEVP_KEYMGMTkeymgmt. more friends, more refs, no cap β¨EVP_KEYMGMT_free()β decrements the reference count for the givenEVP_KEYMGMTkeymgmt, and when that count hits zero, frees it. and if the argument isNULL? nothing is done. she simply does not perceive it. πEVP_KEYMGMT_get0_provider()β returns the provider that has this particular implementation. who's her provider? everybody wants to know πEVP_KEYMGMT_is_a()β checks if keymgmt is an implementation of an algorithm that's identifiable with name. vibe check on the algorithm name, basically.EVP_KEYMGMT_get0_name()β returns the algorithm name from the provided implementation for the given keymgmt. heads up bestie: the keymgmt may have multiple synonyms associated with it, and in that case the first name from the algorithm definition is returned. also ownership of the returned string is retained by the keymgmt object and should NOT be freed by the caller β do not touch, do notfree(), she is not yours to release π«ΆEVP_KEYMGMT_names_do_all()β traverses all names for the keymgmt, and calls fn with each name and data. a whole hallway walk-through of every alias she goes by.EVP_KEYMGMT_get0_description()β returns a description of the keymgmt, meant for display and human consumption. the description is at the discretion of the keymgmt implementation β so it's her own words, her own bios, and honestly slay.EVP_KEYMGMT_do_all_provided()β traverses all key keymgmt implementations by all activated providers in the library context libctx, and for each of the implementations, calls fn with the implementation method and data as arguments. every single one, no skips. periodt.EVP_KEYMGMT_gettable_params()andEVP_KEYMGMT_settable_params()β return a constantOSSL_PARAM(3)array that describes the names and types of key parameters that can be retrieved or set. andEVP_KEYMGMT_gettable_params()is the one used byEVP_PKEY_gettable_params(3). πEVP_KEYMGMT_gen_gettable_params()andEVP_KEYMGMT_gen_settable_params()β return a constantOSSL_PARAM(3)array describing the names and types of key generation parameters that can be retrieved or set viaEVP_PKEY_CTX_get_params(3)orEVP_PKEY_CTX_set_params(3)respectively. get-vibes and set-vibes, matched set π
β NOTES β
EVP_KEYMGMT_fetch() may be called implicitly by other fetching functions, using the same library context and properties. any other API that uses keys will typically do this. so likeβ¦ you might not even be the one calling her, and she still shows up. she's always there. π
π RETURN VALUES π
EVP_KEYMGMT_fetch()returns a pointer to the key management implementation represented by anEVP_KEYMGMTobject, orNULLon error.EVP_KEYMGMT_up_ref()returns1on success, or0on error.EVP_KEYMGMT_names_do_all()returns1if the callback was called for all names. a return value of0means that the callback was not called for any names πEVP_KEYMGMT_free()doesn't return any value. she simply leaves, no goodbyes, no return type. nothing. void. ghosted fr fr.EVP_KEYMGMT_get0_provider()returns a pointer to a provider object, orNULLon error.EVP_KEYMGMT_is_a()returns1if keymgmt was identifiable, otherwise0. β or β, no in-between.EVP_KEYMGMT_get0_name()returns the algorithm name, orNULLon error.EVP_KEYMGMT_get0_description()returns a pointer to a description, orNULLif there isn't one.EVP_KEYMGMT_gettable_params(),EVP_KEYMGMT_settable_params(),EVP_KEYMGMT_gen_gettable_params()andEVP_KEYMGMT_gen_settable_params()return a constantOSSL_PARAM(3)array orNULLon error.
π¦ SEE ALSO π¦
EVP_MD_fetch(3), OSSL_LIB_CTX(3)
go read those next bestie, it's giving required reading β¨
π HISTORY π
the function EVP_KEYMGMT_gen_gettable_params() was added in OpenSSL 3.4.0. all other functions described here were added in OpenSSL 3.0. so yeah, the gen one is the baby of the family, born late but still iconic π
π COPYRIGHT π
Copyright 2019-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, bestie!! no cap, every single flag, pointer, return value and caveat is right there where you left it, we did not lose a single detail π
OpenSSL 4.0.3 β dated 2026-09-29 β EVP_KEYMGMT(3SSL) πβ¨π¦π π§πΈππβπππ«Άπππ₯
π¦ 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