EVP_SIGNATURE(3ossl)
π EVP_SIGNATURE β so you wanna manage EVP_SIGNATURE algorithm objects π
okay so real talk, this is a page from the OpenSSL manual set, section 3ossl β it's EVP_SIGNATURE(3ossl) bestie, and it's literally all about the functions that manage EVP_SIGNATURE algorithm objects. no cap, that's the whole gig.
β¨ NAME β¨
EVP_SIGNATURE, EVP_SIGNATURE_fetch, EVP_SIGNATURE_free, EVP_SIGNATURE_up_ref, EVP_SIGNATURE_is_a, EVP_SIGNATURE_get0_provider, EVP_SIGNATURE_do_all_provided, EVP_SIGNATURE_names_do_all, EVP_SIGNATURE_get0_name, EVP_SIGNATURE_get0_description, EVP_SIGNATURE_gettable_ctx_params, EVP_SIGNATURE_settable_ctx_params β the whole friend group π
these are functions to manage EVP_SIGNATURE algorithm objects.
π SYNOPSIS π
like, here's the include and everything, exactly as it is, don't @ me:
#include <openssl/evp.h>
typedef struct evp_signature_st EVP_SIGNATURE;
EVP_SIGNATURE *EVP_SIGNATURE_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
const char *properties);
void EVP_SIGNATURE_free(EVP_SIGNATURE *signature);
int EVP_SIGNATURE_up_ref(EVP_SIGNATURE *signature);
const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature);
int EVP_SIGNATURE_is_a(const EVP_SIGNATURE *signature, const char *name);
OSSL_PROVIDER *EVP_SIGNATURE_get0_provider(const EVP_SIGNATURE *signature);
void EVP_SIGNATURE_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_SIGNATURE *signature,
void *arg),
void *arg);
int EVP_SIGNATURE_names_do_all(const EVP_SIGNATURE *signature,
void (*fn)(const char *name, void *data),
void *data);
const char *EVP_SIGNATURE_get0_name(const EVP_SIGNATURE *signature);
const char *EVP_SIGNATURE_get0_description(const EVP_SIGNATURE *signature);
const OSSL_PARAM *EVP_SIGNATURE_gettable_ctx_params(const EVP_SIGNATURE *sig);
const OSSL_PARAM *EVP_SIGNATURE_settable_ctx_params(const EVP_SIGNATURE *sig);
(yes EVP_SIGNATURE_get0_name shows up twice in there, that's just how the original is, we don't gatekeep πΈ)
π¦ DESCRIPTION π¦
EVP_SIGNATURE_fetch() grabs the implementation for whatever algorithm you asked for, from any provider offering it, inside the criteria you gave in properties. the algorithm is gonna be one of the ones offering functions for signature-related tasks β signing, verifying, all that main character stuff. for the deep lore, go read "ALGORITHM FETCHING" in crypto(7).
π«Ά the value you get back must eventually be freed with EVP_SIGNATURE_free(). don't just leave it hanging, that's not the vibe.
EVP_SIGNATURE_free() decrements the reference count for the EVP_SIGNATURE structure. typically you got this structure from an earlier EVP_SIGNATURE_fetch() call. if the refcount drops to 0, the structure gets freed. and if the argument is NULL, nothing happens β it literally just minds its own business, iconic.
EVP_SIGNATURE_up_ref() increments the reference count for an EVP_SIGNATURE structure. bestie said "you're not going anywhere" π
EVP_SIGNATURE_is_a() returns 1 if signature is an implementation of an algorithm that's identifiable with name, otherwise 0. vibe check passed or not, that's it.
EVP_SIGNATURE_get0_provider() returns the provider that signature was fetched from. finding out where it came from, we love a backstory.
EVP_SIGNATURE_do_all_provided() traverses all SIGNATURE implemented by all activated providers in the given library context libctx, and for each of the implementations, calls the given function fn with the implementation method and the given arg as argument. it's giving roll call, fr fr π£
EVP_SIGNATURE_get0_name() returns the algorithm name from the provided implementation for the given signature. heads up though β the signature may have multiple synonyms associated with it, and in that case the first name from the algorithm definition is the one returned. ownership of the returned string stays with the signature object, so don't you dare free it as the caller. π
EVP_SIGNATURE_names_do_all() traverses all names for signature, and calls fn with each name and data.
EVP_SIGNATURE_get0_description() returns a description of the signature, meant for display and human consumption. the description is at the discretion of the signature implementation β so like, whatever it feels like saying β¨.
EVP_SIGNATURE_gettable_ctx_params() and EVP_SIGNATURE_settable_ctx_params() return a constant OSSL_PARAM(3) array that describes the names and types of key parameters that can be retrieved or set by a signature algorithm using EVP_PKEY_CTX_get_params(3) and EVP_PKEY_CTX_set_params(3). gettable = can get, settable = can set. we stay consistent π
π RETURN VALUES π
EVP_SIGNATURE_fetch()β returns a pointer to anEVP_SIGNATUREfor success, orNULLfor failure πEVP_SIGNATURE_up_ref()β returns1for success or0otherwiseEVP_SIGNATURE_names_do_all()β returns1if the callback was called for all names. a return value of0means the callback was not called for any namesEVP_SIGNATURE_gettable_ctx_params()andEVP_SIGNATURE_settable_ctx_params()β return a constantOSSL_PARAM(3)array, orNULLon error
π SEE ALSO π
go read these next, iykyk:
- "ALGORITHM FETCHING" in
crypto(7) OSSL_PROVIDER(3)
β HISTORY β
the functions described here were added in OpenSSL 3.0. vintage-ish but make it modern π
π 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 that π this was OpenSSL 3.5.0, dated 2026-09-25 β go sign something and slay π β¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms