EVP_PKEY_CTX_SET_PARAMS(3SSL)

πŸ’… EVP_PKEY_CTX_SET_PARAMS πŸ’…

okay bestie, we're in the OpenSSL section 3SSL man pages and this one? it's about provider parameter passing operations. lowkey iconic, honestly. let's get into it 🫢

✨ NAME ✨

EVP_PKEY_CTX_set_params, EVP_PKEY_CTX_settable_params, EVP_PKEY_CTX_get_params, EVP_PKEY_CTX_gettable_params β€” provider parameter passing operations. that's the whole vibe: sending params to providers and getting params back from them πŸ’–

🌈 SYNOPSIS 🌈

#include <openssl/evp.h>

int EVP_PKEY_CTX_set_params(EVP_PKEY_CTX *ctx, const OSSL_PARAM *params);
const OSSL_PARAM *EVP_PKEY_CTX_settable_params(const EVP_PKEY_CTX *ctx);
int EVP_PKEY_CTX_get_params(EVP_PKEY_CTX *ctx, OSSL_PARAM *params);
const OSSL_PARAM *EVP_PKEY_CTX_gettable_params(const EVP_PKEY_CTX *ctx);

πŸ¦‹ DESCRIPTION πŸ¦‹

so EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params() are the ones that let arbitrary key parameters travel to and from providers. and no cap: not all parameters are supported by all providers, that's just how it is. if you wanna know more about providers, go read OSSL_PROVIDER(3) β€” she explains it all πŸ’«

the params field? it's a pointer to a list of OSSL_PARAM structures, and the whole thing gets terminated with an OSSL_PARAM_END(3) struct. yes, you need the terminator, it's the periodt of the sentence. for the deets on passing parameters, OSSL_PARAM(3) has you covered.

⚠️ important bestie: these functions must only be called after the EVP_PKEY_CTX has been initialised for use in an operation. no calling them on a half-baked context, okay? πŸ™ˆ

and here's the tea: these methods replace the EVP_PKEY_CTX_ctrl() mechanism. like, EVP_PKEY_CTX_ctrl now calls these methods internally to interact with providers. it's giving legacy-to-modern glow-up ✨

EVP_PKEY_CTX_gettable_params() and EVP_PKEY_CTX_settable_params() hand you a constant OSSL_PARAM(3) array that describes the gettable and settable parameters for the current algorithm implementation β€” aka the params you can actually use with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params() respectively. and yup, same rule applies: these must only be called after the EVP_PKEY_CTX has been initialised for use in an operation πŸ‘‘

πŸŽ€ Parameters πŸŽ€

examples of EVP_PKEY parameters include the following (copying these down exactly because they matter, iykyk):


⭐ RETURN VALUES ⭐

  • EVP_PKEY_CTX_set_params() returns 1 for success or 0 otherwise.
  • EVP_PKEY_CTX_settable_params() returns an OSSL_PARAM array on success or NULL on error. it may also return NULL if there are no settable parameters available β€” so NULL isn't always a disaster, sometimes it just means "nothing here bestie" πŸ’€
  • all the other functions and macros described on this page return a positive value for success and 0 or a negative value for failure. and specifically: a return value of -2 indicates the operation is not supported by the public key algorithm. write that down πŸ“

πŸ”₯ NOTES πŸ”₯

LMS support is disabled by default at compile-time. if you want it, you gotta specify the enable-lms build configuration option. that's the whole gate πŸšͺ

🌸 SEE ALSO 🌸

EVP_PKEY_CTX_new(3), EVP_PKEY_encrypt(3), EVP_PKEY_decrypt(3), EVP_PKEY_sign(3), EVP_PKEY_verify(3), EVP_PKEY_verify_recover(3), EVP_PKEY_derive(3), EVP_PKEY_keygen(3)

πŸ‘‘ HISTORY πŸ‘‘

  • all functions were added in OpenSSL 3.0.
  • support for ML-DSA> and ML-KEM was added in OpenSSL 3.5.
  • support for LMS was added in OpenSSL 3.6.

Copyright 2020-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 was OpenSSL 4.0.3, dated 2026-09-29, and it's the EVP_PKEY_CTX_SET_PARAMS(3SSL) page. go forth and pass your params responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from