EVP_SIGNATURE(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’– EVP_SIGNATURE β€” okay bestie, let's talk signature algorithm objects πŸ’–

So this is the 3ossl page (like, the OpenSSL manual, third section, iykyk) and honestly? It's giving "the backstage pass of crypto." These are the functions that manage EVP_SIGNATURE algorithm objects β€” the little handles that do the signing-and-verifying thing. Not me being obsessed with refcounts, but also... I am. 🫢


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

(Yes, EVP_SIGNATURE_get0_name shows up twice in there. That's literally what the header says, don't come for me πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so real talk, here's what each one actually does:

  • EVP_SIGNATURE_fetch() β€” grabs you the implementation for the algorithm you named, from any provider that's offering it, filtered by the criteria in properties. And the algorithm? It'll be one of the ones offering functions for signature-related tasks β€” signing, verifying, that whole vibe. Wanna go deeper? Peep "ALGORITHM FETCHING" in crypto(7) for the full tea.
The value it hands back has to be freed eventually with EVP_SIGNATURE_free(). No leaks, bestie, that's the rule. 🌸
  • EVP_SIGNATURE_free() β€” decrements the reference count on the EVP_SIGNATURE structure. Usually you got this thing from an earlier EVP_SIGNATURE_fetch() call. When the refcount hits 0, the structure gets freed. And if the argument is NULL? Nothing happens. Chill. 😌
  • EVP_SIGNATURE_up_ref() β€” increments that reference count. The opposite twin. Iconic behavior.
  • EVP_SIGNATURE_is_a() β€” returns 1 if signature is an implementation of an algorithm identifiable with name, otherwise 0. Simple as that, fr fr.
  • EVP_SIGNATURE_get0_provider() β€” tells you which provider signature was fetched from. Like finding out where your fave came from. 🧚
  • EVP_SIGNATURE_do_all_provided() β€” traverses all the SIGNATURE implementations across all activated providers in the given library context libctx, and for every single one of them, calls your function fn with the implementation method plus your arg as the argument. A whole tour. πŸ‘‘
  • EVP_SIGNATURE_get0_name() β€” returns the algorithm name from the implementation behind signature. Plot twist though: the signature might have multiple synonyms attached, and in that case you get the first name from the algorithm definition. Also important: ownership of that returned string stays with the signature object β€” do not free it yourself. Hands off, it's not yours. πŸ™ˆ
  • EVP_SIGNATURE_names_do_all() β€” traverses all the names for signature, calling fn with each name and data. Every alias gets its moment.
  • EVP_SIGNATURE_get0_description() β€” returns a description of the signature, made for display and human consumption. What's in it? Totally at the discretion of the signature implementation. Mystery vibes, but legal ones.
  • EVP_SIGNATURE_gettable_ctx_params() and EVP_SIGNATURE_settable_ctx_params() β€” these two return a constant OSSL_PARAM(3) array describing the names and types of key parameters that a signature algorithm can retrieve or set using EVP_PKEY_CTX_get_params(3) and EVP_PKEY_CTX_set_params(3). Very demure, very parameterized.

🌈 RETURN VALUES 🌈

  • EVP_SIGNATURE_fetch() β€” pointer to an EVP_SIGNATURE on success πŸ’–, NULL on failure πŸ’€.
  • EVP_SIGNATURE_up_ref() β€” 1 for success, 0 otherwise.
  • EVP_SIGNATURE_names_do_all() β€” 1 if the callback was called for all names. A 0 means the callback was not called for any names. (Not "some," bestie. Any.)
  • EVP_SIGNATURE_gettable_ctx_params() and EVP_SIGNATURE_settable_ctx_params() β€” a constant OSSL_PARAM(3) array, or NULL on error.

πŸ‘€ SEE ALSO πŸ‘€

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


πŸŽ€ HISTORY πŸŽ€

The functions described here were added in OpenSSL 3.0. So if you're on something older... girl. Upgrade. 🫢


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


That's the whole page, no cap. ⭐

Okay so this version is 3.5.6, dated 2026-04-07, from the EVP_SIGNATURE(3ossl) era β€” and that's my cue to ✨ slay ✨ my way out. Stay signed, stay verified, and remember: free your fetches, bestie. πŸ’…πŸ”₯

πŸ“¦ where this page comes from