EVP_ASYM_CIPHER_FREE(3ossl)
β¨ NAME β¨
EVP_ASYM_CIPHER_fetch, EVP_ASYM_CIPHER_free, EVP_ASYM_CIPHER_up_ref, EVP_ASYM_CIPHER_is_a, EVP_ASYM_CIPHER_get0_provider, EVP_ASYM_CIPHER_do_all_provided, EVP_ASYM_CIPHER_names_do_all, EVP_ASYM_CIPHER_get0_name, EVP_ASYM_CIPHER_get0_description, EVP_ASYM_CIPHER_gettable_ctx_params, EVP_ASYM_CIPHER_settable_ctx_params β bestie, these are the little helpers that manage your EVP_ASYM_CIPHER algorithm objects π
(also hi, this is the 3ossl manual page, welcome to the group chat π«Ά)
πΈ SYNOPSIS πΈ
#include <openssl/evp.h>
EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher);
const char *EVP_ASYM_CIPHER_get0_name(const EVP_ASYM_CIPHER *cipher);
int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name);
OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher);
void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_ASYM_CIPHER *cipher,
void *arg),
void *arg);
int EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher,
void (*fn)(const char *name, void *data),
void *data);
const char *EVP_ASYM_CIPHER_get0_description(const EVP_ASYM_CIPHER *cipher);
const OSSL_PARAM *EVP_ASYM_CIPHER_gettable_ctx_params(const EVP_ASYM_CIPHER *cip);
const OSSL_PARAM *EVP_ASYM_CIPHER_settable_ctx_params(const EVP_ASYM_CIPHER *cip);
π¦ DESCRIPTION π¦
okay so let's go one by one, no skimming bestie, every single one matters π
EVP_ASYM_CIPHER_fetch() β this one goes out and fetches the implementation for the algorithm you asked for, from any provider that's offering it, staying inside the criteria given by the properties and in the scope of the library context you pass as ctx (peep OSSL_LIB_CTX(3) for that one). The algorithm you get back will be one that offers functions for doing asymmetric cipher things β think asymmetric encryption and decryption, the whole vibe. Want more tea on this? Check out "ALGORITHM FETCHING" in crypto(7).
π¨ bestie listen: the value you get back must eventually be freed with EVP_ASYM_CIPHER_free(). Don't just leave it hanging, that's not the move.
EVP_ASYM_CIPHER_free() β decrements the reference count on the EVP_ASYM_CIPHER structure. Usually you got this structure from an earlier EVP_ASYM_CIPHER_fetch() call, iykyk. The moment that reference count hits 0, the structure gets freed. And if the argument is NULL? Literally nothing happens, we move on, no drama. π
EVP_ASYM_CIPHER_up_ref() β the opposite energy: increments the reference count for an EVP_ASYM_CIPHER structure. β¨
EVP_ASYM_CIPHER_is_a() β vibe check! Returns 1 if cipher is an implementation of an algorithm that's identifiable with name, and 0 otherwise.
EVP_ASYM_CIPHER_get0_provider() β tells you which provider cipher was fetched from. Where did she come from, we love a backstory. π
EVP_ASYM_CIPHER_do_all_provided() β walks through all the EVP_ASYM_CIPHERs implemented by every activated provider in the given library context libctx, and for each one of those implementations it calls your function fn with the implementation method and the given arg as argument. A whole tour, bestie. π
EVP_ASYM_CIPHER_get0_name() β returns the algorithm name from the provided implementation for the given cipher. Heads up though: a cipher can have multiple synonyms attached to it, and in that case it returns the first name from the algorithm definition. Also the returned string's ownership stays with the cipher object, so do not free it yourself, that's not yours to touch. π
EVP_ASYM_CIPHER_names_do_all() β traverses all the names for cipher, and calls fn with each name and data. Every alias, every nickname, all of them.
EVP_ASYM_CIPHER_get0_description() β returns a description of the cipher, meant for display and human consumption (yes, actual readable words for actual humans π«Ά). What that description says is completely at the discretion of the cipher implementation.
EVP_ASYM_CIPHER_gettable_ctx_params() and EVP_ASYM_CIPHER_settable_ctx_params() β these two return a constant OSSL_PARAM(3) array that describes the names and types of key parameters that can be retrieved or set by a key encryption algorithm using EVP_PKEY_CTX_get_params(3) and EVP_PKEY_CTX_set_params(3).
π RETURN VALUES π
EVP_ASYM_CIPHER_fetch()returns a pointer to anEVP_ASYM_CIPHERon success, orNULLon failure. Slay or flop, no in between.EVP_ASYM_CIPHER_up_ref()returns1for success, or0otherwise.EVP_ASYM_CIPHER_names_do_all()returns1if the callback was called for all names. A return value of0means the callback wasn't called for any names. πEVP_ASYM_CIPHER_gettable_ctx_params()andEVP_ASYM_CIPHER_settable_ctx_params()return a constantOSSL_PARAM(3)array, orNULLon error.
π₯ SEE ALSO π₯
"ALGORITHM FETCHING" in crypto(7), OSSL_PROVIDER(3)
β HISTORY β
The functions described here were added in OpenSSL 3.0. iconic behavior, honestly. π
π 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>.
okay that's the whole page bestie, you ate it, no cap π and for the receipt: this was OpenSSL 3.5.9, dated 2026-09-29, and yes the manual name is EVP_ASYM_CIPHER_FREE(3ossl) β mwah, go forth and manage your algorithm objects responsibly β¨π¦π
π¦ 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