EVP_SIGNATURE(3ossl)

πŸ’– EVP_SIGNATURE πŸ’– (that's the EVP_SIGNATURE(3ossl) page, bestie, from the OpenSSL fam)

okay so. this is the page for all the little functions that manage EVP_SIGNATURE algorithm objects β€” aka the thingies that do the signing and verifying for you. it's giving ✨backend glamour✨, iykyk.


🌸 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 β€” literally all the functions you need to manage EVP_SIGNATURE algorithm objects 🫢


✨ SYNOPSIS ✨

#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);

(and yes, EVP_SIGNATURE_get0_name really does show up twice in there. iconic. we don't question it πŸ’…)


πŸ‘‘ DESCRIPTION πŸ‘‘

EVP_SIGNATURE_fetch() goes and fetches the implementation for whatever algorithm you asked for, from any provider that's offering it, matching the criteria you gave it in properties. the algorithm it hands back is one of the ones offering functions for signature-related tasks β€” y'know, signing, verifying, the whole main-character lineup. want the deep lore? go read "ALGORITHM FETCHING" in crypto(7) πŸ“–

the value it gives you back must eventually be freed with EVP_SIGNATURE_free(). no ghosting your own memory, bestie 🚨

EVP_SIGNATURE_free() decrements the reference count on that EVP_SIGNATURE structure. typically you got this structure from an earlier EVP_SIGNATURE_fetch() call. if the ref count hits 0, the structure gets freed. and if the argument is NULL? nothing happens. zero drama. πŸ’€

EVP_SIGNATURE_up_ref() increments the reference count for an EVP_SIGNATURE structure. (the up, the ref, the slay πŸ“ˆ)

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 passed.

EVP_SIGNATURE_get0_provider() returns the provider that signature was fetched from. gotta know where your faves came from 🏠

EVP_SIGNATURE_do_all_provided() traverses all SIGNATURE implementations from all activated providers in the given library context libctx, and for each one it calls the given function fn, passing it the implementation method and the given arg as the argument. it's a whole tour, bestie 🚌

EVP_SIGNATURE_get0_name() returns the algorithm name from the provided implementation for the given signature. heads up tho: the signature might have multiple synonyms attached to it β€” and in that case, it returns the first name from the algorithm definition. ownership of the returned string stays with the signature object, so do not free it yourself, that's not your job πŸ™…

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 actual wording is entirely at the discretion of the signature implementation, so don't come for it, it's doing its best πŸ’…

EVP_SIGNATURE_gettable_ctx_params() and EVP_SIGNATURE_settable_ctx_params() return a constant OSSL_PARAM(3) array describing 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). yes bestie, they hand you the menu πŸ“‹


πŸŽ€ RETURN VALUES πŸŽ€

  • EVP_SIGNATURE_fetch() β€” returns a pointer to an EVP_SIGNATURE on success, or NULL on failure 😭
  • EVP_SIGNATURE_up_ref() β€” returns 1 for success, or 0 otherwise
  • EVP_SIGNATURE_names_do_all() β€” returns 1 if the callback was called for all names. a return value of 0 means the callback was not called for any names. (yeah. zero. not even one. rough 😬)
  • EVP_SIGNATURE_gettable_ctx_params() and EVP_SIGNATURE_settable_ctx_params() β€” return a constant OSSL_PARAM(3) array, or NULL on error

🌈 SEE ALSO 🌈

"ALGORITHM FETCHING" in crypto(7), OSSL_PROVIDER(3)

go read those, they're the supporting cast and they ate ✨


πŸ¦‹ HISTORY πŸ¦‹

the functions described here were added in OpenSSL 3.0. so they're not ancient artifacts, they're new-gen icons πŸ’–


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 🫢 this was OpenSSL 3.5.9, dated 2026-09-29 β€” EVP_SIGNATURE(3ossl), signing off πŸ’…βœ¨ no cap, go free your fetches.

πŸ“¦ where this page comes from