EVP_PKEY_SETTABLE_PARAMS(3ossl)

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

πŸ’… EVP_PKEY_SETTABLE_PARAMS πŸ’…

okay bestie, so this one's from the OpenSSL gang β€” the whole page is called EVP_PKEY_SETTABLE_PARAMS(3ossl) β€” and it's literally all about shoving extra params into a key that already exists. no cap, it's giving "dress up your EVP_PKEY" 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 β€” setting 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);

like, look at all those signatures. gorgeous. iconic. we love to see it 🫢


πŸ’– DESCRIPTION πŸ’–

so these functions are your little toolbox for setting additional parameters into an existing EVP_PKEY. key word: existing. we're not making a new one, we're accessorising the one we've got πŸ’…

  • EVP_PKEY_set_params() β€” sets one or more params into a pkey. if you wanna know what a param even is, go peek at OSSL_PARAM(3), it's all there bestie πŸ“–
  • EVP_PKEY_settable_params() β€” returns a constant list of params telling you the names and types of key parameters that can be set. again, OSSL_PARAM(3) has the deets πŸ¦‹
  • 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! these functions only work for EVP_PKEYs that contain a provider side key. if yours doesn't, this whole vibe check is a fail 😭

✨ 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 πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, iykyk πŸ‘‘


πŸ‘‘ HISTORY πŸ‘‘

these functions were added in OpenSSL 3.0 β€” so they're not ancient, they're just ✨established✨


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


okay that's the whole thing, mwah πŸ’‹ this little beauty is version 3.5.6, dated 2026-04-07, and it lives at EVP_PKEY_SETTABLE_PARAMS(3ossl) β€” go set some params, bestie, you've got this πŸ§šπŸ’œ

πŸ“¦ where this page comes from