EVP_PKEY_CTX_SET_PARAMS(3ossl)
π 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:
"Common parameters"inprovider-keymgmt(7)"Key Exchange parameters"inprovider-keyexch(7)"Signature parameters"inprovider-signature(7)"Common RSA parameters"inEVP_PKEY-RSA(7)"RSA key generation parameters"inEVP_PKEY-RSA(7)"FFC parameters"inEVP_PKEY-FFC(7)"FFC key generation parameters"inEVP_PKEY-FFC(7)"DSA parameters"inEVP_PKEY-DSA(7)"DSA key generation parameters"inEVP_PKEY-DSA(7)"DH parameters"inEVP_PKEY-DH(7)"DH key generation parameters"inEVP_PKEY-DH(7)"Common EC parameters"inEVP_PKEY-EC(7)"Common X25519, X448, ED25519 and ED448 parameters"inEVP_PKEY-X25519(7)"Common parameters"inEVP_PKEY-ML-DSA(7)"Common parameters"inEVP_PKEY-ML-KEM(7)
β RETURN VALUES β
EVP_PKEY_CTX_set_params()returns1for success or0otherwise. Simple. Slay.EVP_PKEY_CTX_settable_params()returns anOSSL_PARAMarray on success orNULLon error. It may also returnNULLif 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 π
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
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms