EVP_PKEY_SETTABLE_PARAMS(3SSL)

๐Ÿ’– EVP_PKEY_SETTABLE_PARAMS ๐Ÿ’–

okay bestie, so this one is an OpenSSL manual page (manual section 3SSL, iykyk) and literally all it wants to do is teach you how to shove extra params into a key you already have. no cap. let's go ๐Ÿฆ‹


โœจ 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);

copy that exactly bestie, character for character, no improvising ๐Ÿ’…


๐Ÿ‘‘ DESCRIPTION ๐Ÿ‘‘

so the whole vibe of these functions is: you've got an EVP_PKEY that already exists, and you wanna slide some additional parameters into it. that's it. that's the job.

EVP_PKEY_set_params() โ€” sets one or more params into a pkey. if you're like "wait what's a param", go read OSSL_PARAM(3) for information about parameters. it's giving homework but do it ๐Ÿ“š

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. again, OSSL_PARAM(3) for information about parameters. yes she's sending you there twice, she means it.

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 an 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 fr fr ๐Ÿ”ข

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 ๐Ÿ“

these functions only work for EVP_PKEYs that contain a provider side key. if yours doesn't, that's a you problem and the functions are not gonna play along ๐Ÿ˜ญ

๐Ÿ’ซ RETURN VALUES ๐Ÿ’ซ

  • EVP_PKEY_settable_params() โ€” returns NULL on error or if it is not supported. so like, check for NULL bestie, don't be out here dereferencing vibes ๐Ÿ™ˆ
  • all the other methods โ€” return 1 if a value was successfully set, or 0 if there was an error. simple as that. 1 slays, 0 does not ๐ŸŒˆ

๐ŸŽ€ SEE ALSO ๐ŸŽ€

go read those too, they're the supporting cast and honestly? iconic โœจ


๐Ÿงš HISTORY ๐Ÿงš

these functions were added in OpenSSL 3.0. so if you're on something older, no they weren't. ๐Ÿ˜Œ


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 page bestie, you ate that ๐Ÿ“ and quick little sign-off: this was OpenSSL version 4.0.3, dated 2026-09-29, and yeah it's still EVP_PKEY_SETTABLE_PARAMS(3SSL). mwah ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from