EVP_SKEYMGMT(3ossl)

πŸ’– EVP_SKEYMGMT(3ossl) β€” EVP key management routines for opaque symmetric keys πŸ’–

okay bestie, sit down, hydrate, and let me tell you about the EVP_SKEYMGMT glow-up ✨ this is from the OpenSSL manuals, and it's giving serious provider-side main character energy 🫢


🌸 NAME 🌸

EVP_SKEYMGMT, EVP_SKEYMGMT_fetch, EVP_SKEYMGMT_up_ref, EVP_SKEYMGMT_free, EVP_SKEYMGMT_get0_provider, EVP_SKEYMGMT_is_a, EVP_SKEYMGMT_get0_description, EVP_SKEYMGMT_get0_name, EVP_SKEYMGMT_do_all_provided, EVP_SKEYMGMT_names_do_all, EVP_SKEYMGMT_get0_gen_settable_params, EVP_SKEYMGMT_get0_imp_settable_params β€” EVP key management routines for opaque symmetric keys. iykyk πŸ’…


✨ SYNOPSIS ✨

#include <openssl/evp.h>

typedef struct evp_sskeymgmt_st EVP_SKEYMGMT;

EVP_SKEYMGMT *EVP_SKEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
                                 const char *properties);
int EVP_SKEYMGMT_up_ref(EVP_SKEYMGMT *skeymgmt);
void EVP_SKEYMGMT_free(EVP_SKEYMGMT *skeymgmt);
const OSSL_PROVIDER *EVP_SKEYMGMT_get0_provider(const EVP_SKEYMGMT *skeymgmt);
int EVP_SKEYMGMT_is_a(const EVP_SKEYMGMT *skeymgmt, const char *name);
const char *EVP_SKEYMGMT_get0_name(const EVP_SKEYMGMT *skeymgmt);
const char *EVP_SKEYMGMT_get0_description(const EVP_SKEYMGMT *skeymgmt);

void EVP_SKEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
                                  void (*fn)(EVP_SKEYMGMT *skeymgmt, void *arg),
                                  void *arg);
int EVP_SKEYMGMT_names_do_all(const EVP_SKEYMGMT *skeymgmt,
                              void (*fn)(const char *name, void *data),
                              void *data);
const OSSL_PARAM *EVP_SKEYMGMT_get0_gen_settable_params(const EVP_SKEYMGMT *skeymgmt);
const OSSL_PARAM *EVP_SKEYMGMT_get0_imp_settable_params(const EVP_SKEYMGMT *skeymgmt);

πŸ¦‹ DESCRIPTION πŸ¦‹

EVP_SKEYMGMT is a method object that represents symmetric key management implementations for all the different cryptographic algorithms out there. lowkey iconic. πŸ’« This method object is the plug that lets providers import key material from the outside, and also export key material to the outside.

ngl, most of the functionality can only be used internally and has no public interface β€” this opaque object just gets passed into other functions whenever it's needed. it's the quiet friend who shows up to every party but never posts πŸ“΅

Here's the full roster, bestie, one by one πŸ‘‘

  • EVP_SKEYMGMT_fetch() β€” goes looking for an algorithm inside a provider that's been loaded into the OSSL_LIB_CTX given by ctx, matching the name given by algorithm and the properties given by properties.
  • EVP_SKEYMGMT_up_ref() β€” bumps up the reference count for the given EVP_SKEYMGMT skeymgmt. ⬆️
  • EVP_SKEYMGMT_free() β€” drops the reference count for the given EVP_SKEYMGMT skeymgmt, and when that count hits zero, it frees it. and if the argument is NULL? nothing happens, we simply do not engage πŸ™ˆ
  • EVP_SKEYMGMT_get0_provider() β€” returns the provider that has this particular implementation. 🏠
  • EVP_SKEYMGMT_is_a() β€” checks if skeymgmt is an implementation of an algorithm that's identified by name. vibe check βœ…
  • EVP_SKEYMGMT_get0_name() β€” returns the algorithm name from the provided implementation for the given skeymgmt. heads up though: the skeymgmt may have multiple synonyms associated with it, and in that case the first name from the algorithm definition is the one that comes back. Ownership of the returned string stays with the skeymgmt object, so do not free it yourself, that's not your job 🚫
  • EVP_SKEYMGMT_names_do_all() β€” traverses all names for the skeymgmt, and calls fn with each name and data. πŸšΆβ™€οΈπŸšΆβ™€οΈπŸšΆβ™€οΈ
  • EVP_SKEYMGMT_get0_description() β€” returns a description of the skeymgmt, meant for display and human consumption. the description is entirely at the discretion of the skeymgmt implementation, so it can be as extra as it wants πŸ’…
  • EVP_SKEYMGMT_do_all_provided() β€” traverses all key skeymgmt implementations by all activated providers in the library context libctx, and for each of those implementations, calls fn with the implementation method and data as arguments. full tour, no skips 🌈
  • EVP_SKEYMGMT_get0_gen_settable_params() and EVP_SKEYMGMT_get0_imp_settable_params() β€” get a constant OSSL_PARAM(3) array that describes the settable parameters that can be used with EVP_SKEY_generate() and EVP_SKEY_import() correspondingly. πŸŽ€

πŸ“ NOTES πŸ“

EVP_SKEYMGMT_fetch() may be called implicitly by other fetching functions, using the same library context and properties. any other API that uses symmetric keys will typically do this too. so like, it might already be in the group chat without you adding it πŸ‘€


πŸ’― RETURN VALUES πŸ’―

  • EVP_SKEYMGMT_fetch() β€” returns a pointer to the key management implementation represented by an EVP_SKEYMGMT object, or NULL on error. 😭
  • EVP_SKEYMGMT_up_ref() β€” returns 1 on success, or 0 on error.
  • EVP_SKEYMGMT_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.
  • EVP_SKEYMGMT_free() β€” doesn't return any value. it just ✨exists✨
  • EVP_SKEYMGMT_get0_provider() β€” returns a pointer to a provider object, or NULL on error.
  • EVP_SKEYMGMT_is_a() β€” returns 1 if skeymgmt was identifiable, otherwise 0.
  • EVP_SKEYMGMT_get0_name() β€” returns the algorithm name, or NULL on error.
  • EVP_SKEYMGMT_get0_description() β€” returns a pointer to a description, or NULL if there isn't one.

πŸ‘€ SEE ALSO πŸ‘€

EVP_SKEY(3), EVP_MD_fetch(3), OSSL_LIB_CTX(3)

go read those next, bestie, they're all connected fr fr πŸ”—


πŸ•°οΈ HISTORY πŸ•°οΈ

The EVP_SKEYMGMT structure and the functions EVP_SKEYMGMT_fetch(), EVP_SKEYMGMT_up_ref(), EVP_SKEYMGMT_free(), EVP_SKEYMGMT_get0_provider(), EVP_SKEYMGMT_is_a(), EVP_SKEYMGMT_get0_description(), EVP_SKEYMGMT_get0_name(), EVP_SKEYMGMT_do_all_provided(), EVP_SKEYMGMT_names_do_all(), EVP_SKEYMGMT_get0_gen_settable_params(), EVP_SKEYMGMT_get0_imp_settable_params() were added in OpenSSL 3.5. a whole era was born πŸŽ‰


Copyright 2025 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 one's stamped 3.5.9 and dated 2026-09-29, straight from the EVP_SKEYMGMT(3ossl) OpenSSL manual. now go forth and manage those symmetric keys like the icon you are πŸ‘‘βœ¨πŸ¦‹

πŸ“¦ where this page comes from