EVP_PKEY_CTX_SET_PARAMS(3ossl)

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

πŸ’… EVP_PKEY_CTX_set_params β€” provider parameter passing operations

Okay so bestie, this is the OpenSSL 3ossl page for the whole parameter-passing friend group: EVP_PKEY_CTX_set_params, EVP_PKEY_CTX_settable_params, EVP_PKEY_CTX_get_params, and EVP_PKEY_CTX_gettable_params. They're the ones who actually talk to providers. Main character energy, honestly. πŸ¦‹


✨ 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 literally the vibe-check duo that let you yeet arbitrary key parameters to and from providers. Not all parameters are supported by all providers, though β€” like, nobody supports everything, that's just life. Peep OSSL_PROVIDER(3) if you want the whole provider lore.

The params field is a pointer to a list of OSSL_PARAM structures, and the list is terminated with an OSSL_PARAM_END(3) struct β€” that's the "okay we're done here πŸ’…" marker. For the full tea on passing parameters, go read OSSL_PARAM(3).

⚠️ Timing matters, bestie: these functions must only be called after the EVP_PKEY_CTX has been initialised for use in an operation. No skipping ahead. πŸ™ˆ

These methods are the glow-up that replace the EVP_PKEY_CTX_ctrl() mechanism. And yes, EVP_PKEY_CTX_ctrl now calls these methods internally to interact with providers β€” it's giving "we're still friends, it just goes through the group chat now." 😌

Then we have EVP_PKEY_CTX_gettable_params() and EVP_PKEY_CTX_settable_params(), which hand you a constant OSSL_PARAM(3) array describing the gettable and settable parameters for the current algorithm implementation β€” like a lil menu of what you're actually allowed to use with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params() respectively. Same rule applies, no cap: these functions 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, bestie β€” bookmark this list, it's a whole mood board:


⭐ RETURN VALUES ⭐

  • EVP_PKEY_CTX_set_params() returns 1 for success or 0 otherwise. Simple. Slay.
  • 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 like, don't panic, sometimes the menu is just empty. 🫢

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 heads up: a return value of -2 specifically means the operation is not supported by the public key algorithm. That's the algorithm saying "not my department," no hard feelings. πŸ’€


πŸ¦‹ 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. Iconic behaviour.

Support for ML-DSA and ML-KEM was added in OpenSSL 3.5. We love an upgrade. πŸ”₯


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


That's the whole page, bestie β€” go forth and pass those params responsibly. πŸŒˆπŸ’– This was the OpenSSL 3.5.6 edition, dated 2026-04-07, page EVP_PKEY_CTX_SET_PARAMS(3ossl), signing off with a dramatic hair flip. πŸŽ€βœ¨

πŸ“¦ where this page comes from