EVP_PKEY_SETTABLE_PARAMS(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’– EVP_PKEY_SETTABLE_PARAMS πŸ’–

okay so this is one of those OpenSSL pages, bestie β€” it lives in the 3ossl section of the manual, and it's literally all about stuffing extra parameters into a key you already have. no cap, it's giving "key glow-up" energy ✨


🌸 NAME 🌸

EVP_PKEY_settable_params, EVP_PKEY_set_params, EVP_PKEY_set_int_param, EVP_PKEY_set_size_t_param, EVP_PKEY_set_bn_param, EVP_PKEY_set_utf8_string_param, EVP_PKEY_set_octet_string_param β€” set key parameters into a key πŸŽ€


✨ SYNOPSIS ✨

#include <openssl/evp.h>

const OSSL_PARAM *EVP_PKEY_settable_params(const EVP_PKEY *pkey);
int EVP_PKEY_set_params(EVP_PKEY *pkey, OSSL_PARAM params[]);
int EVP_PKEY_set_int_param(EVP_PKEY *pkey, const char *key_name, int in);
int EVP_PKEY_set_size_t_param(EVP_PKEY *pkey, const char *key_name, size_t in);
int EVP_PKEY_set_bn_param(EVP_PKEY *pkey, const char *key_name,
                          const BIGNUM *bn);
int EVP_PKEY_set_utf8_string_param(EVP_PKEY *pkey, const char *key_name,
                                   const char *str);
int EVP_PKEY_set_octet_string_param(EVP_PKEY *pkey, const char *key_name,
                                    const unsigned char *buf, size_t bsize);

πŸ¦‹ DESCRIPTION πŸ¦‹

so these functions are your little toolkit for setting additional parameters into an already-existing EVP_PKEY πŸ’… like the key's already there, you're just adding accessories. very demure, very mindful.

  • EVP_PKEY_set_params() β€” sets one or more params into a pkey. for the deets on what parameters even are, go read OSSL_PARAM(3) 🫢
  • EVP_PKEY_settable_params() β€” returns a constant list of params that tells you the names and types of key parameters that can actually be set. literally a menu, bestie. again, see OSSL_PARAM(3) for the parameter lore πŸ“‹
  • EVP_PKEY_set_int_param() β€” sets an integer value in into a key pkey for the associated field key_name πŸ”’
  • EVP_PKEY_set_size_t_param() β€” sets a size_t value in into a key pkey for the associated field key_name πŸ“
  • EVP_PKEY_set_bn_param() β€” sets the BIGNUM value bn into a key pkey for the associated field key_name. big number energy πŸ”₯
  • EVP_PKEY_set_utf8_string_param() β€” sets the UTF8 string str into a key pkey for the associated field key_name πŸŽ€
  • EVP_PKEY_set_octet_string_param() β€” sets the octet string value buf with a size bsize into a key pkey for the associated field key_name 🧚

πŸ’€ NOTES πŸ’€

heads up bestie: these functions only work for EVP_PKEYs that contain a provider side key. if yours doesn't, it's not happening. periodt. πŸ™ˆ

🌈 RETURN VALUES 🌈

  • EVP_PKEY_settable_params() returns NULL on error, or if it is not supported 😭
  • all the other methods return 1 if a value was successfully set, or 0 if there was an error. slay or flop, no in-between πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

EVP_PKEY_gettable_params(3), EVP_PKEY_CTX_new(3), provider-keymgmt(7), OSSL_PARAM(3)

like yes go read those too, iykyk 🫢


⭐ HISTORY ⭐

these functions were added in OpenSSL 3.0. vintage-ish but iconic πŸ’œ


Copyright 2020-2021 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>.


aaaand that's the whole page, bestie πŸ§šπŸ’– this one's from 3.5.0, dated 2026-09-25 β€” so go forth and set those params. mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from