EVP_PKEY_CTX_SET_PARAMS(3ossl)

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

πŸ’… EVP_PKEY_CTX_SET_PARAMS(3ossl) β€” the OpenSSL glow-up

okay so bestie, gather round, because this is the OpenSSL manpage for EVP_PKEY_CTX_SET_PARAMS(3ossl) and it's literally about passing parameters around like notes in class. no cap, it's giving backstage-pass energy. πŸŽ€


✨ NAME ✨

EVP_PKEY_CTX_set_params, EVP_PKEY_CTX_settable_params, EVP_PKEY_CTX_get_params, EVP_PKEY_CTX_gettable_params β€” the provider parameter passing operations. yes we're passing params, no we're not passing gas, it's a cryptography thing. πŸ¦‹


🌸 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 two main characters here: they let arbitrary key parameters travel to and from providers. πŸ”₯ "Arbitrary" is doing a lot of work there β€” and like, not all parameters may be supported by all providers. your fave might not take your fave param, it's a whole thing. see OSSL_PROVIDER(3) if you want the full provider lore.

the params field is a pointer to a list of OSSL_PARAM structures, terminated with an OSSL_PARAM_END(3) struct. very "invite list with a definitive last name on it" of them. see OSSL_PARAM(3) for the actual tea on how parameters get passed.

⚠️ important vibe check: these functions must only be called after the EVP_PKEY_CTX has been initialised for use in an operation. do not be out here calling them on a fresh uninitialised ctx, that's not slaying, that's just chaos. πŸ’€

these methods replace the EVP_PKEY_CTX_ctrl() mechanism. (EVP_PKEY_CTX_ctrl now calls these methods internally to interact with providers β€” so it's not gone, it just outsourced the work. iconique.)

then we have EVP_PKEY_CTX_gettable_params() and EVP_PKEY_CTX_settable_params() β€” besties, these get you a constant OSSL_PARAM(3) array that describes the gettable and settable parameters for the current algorithm implementation. like a menu. πŸ“‹ in other words: the params you can use with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params() respectively. and yes, same rule applies β€” these functions must only be called after the EVP_PKEY_CTX has been initialised for use in an operation. double-checked, still true. ✨

🧚 Parameters 🧚

examples of EVP_PKEY parameters include the following β€” and no, i'm not skipping any, we're listing them all because that's the assignment:

and the key-type-specific ones:

go off, parameter catalogue. πŸ‘‘


🌈 RETURN VALUES 🌈

listen up, this part is literally the grading rubric:

  • EVP_PKEY_CTX_set_params() returns 1 for success or 0 otherwise. one is the winner, zero is the flop era. 😭
  • 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's just "nobody signed up". πŸ™ˆ

and all the other functions and macros described on this page return a positive value for success and 0 or a negative value for failure. in particular, a return value of -2 indicates the operation is not supported by the public key algorithm. -2 is the "not my department" of return codes, iykyk.


🫢 SEE ALSO 🫢

go read these next, bestie, they're all linked:

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. (yes, that stray > is in the original, we're preserving it, it's part of the lore now πŸ’€)

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, periodt. πŸŽ€

sign-off corner: this iconic little document is from OpenSSL 3.5.0, dated 2026-09-25, and yes that's EVP_PKEY_CTX_SET_PARAMS(3ossl) on the label. drink water, initialise your ctx before calling these, and slay. πŸ’œβœ¨πŸ¦‹

πŸ“¦ where this page comes from