EVP_PKEY_CTX_SET_PARAMS(3ossl)
π EVP_PKEY_CTX_SET_PARAMS π
okay bestie, so this is a page from the OpenSSL manual, and it's all about the provider parameter passing operations β¨ like EVP_PKEY_CTX_set_params, EVP_PKEY_CTX_settable_params, EVP_PKEY_CTX_get_params and EVP_PKEY_CTX_gettable_params. yes it's a mouthful, we're gonna get through it together π«Ά
β¨ 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 functions that let you move arbitrary key parameters to and from providers π
. and like, not every provider supports every parameter β that's just how it is, no cap. if you wanna know more about providers, go read OSSL_PROVIDER(3), she explains it better.
the params field is a pointer to a list of OSSL_PARAM structures, and that list is terminated with a OSSL_PARAM_END(3) struct β do not forget the terminator bestie, that's the vibe check. everything you need to know about passing parameters lives in OSSL_PARAM(3) β¨.
β οΈ these functions must only be called after the EVP_PKEY_CTX has been initialised for use in an operation. like, initialise first, then call. that's the order, periodt.
also important: 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 still doing its thing under the hood π.)
and then 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 β i.e. the ones you can actually use with EVP_PKEY_CTX_get_params() and EVP_PKEY_CTX_set_params() respectively π. and yes, same rule as above: 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, and honestly it's giving encyclopedia but we love her:
- "Common parameters" in
provider-keymgmt(7) - "Key Exchange parameters" in
provider-keyexch(7) - "Signature parameters" in
provider-signature(7) - "Common RSA parameters" in
EVP_PKEY-RSA(7) - "RSA key generation parameters" in
EVP_PKEY-RSA(7) - "FFC parameters" in
EVP_PKEY-FFC(7) - "FFC key generation parameters" in
EVP_PKEY-FFC(7) - "DSA parameters" in
EVP_PKEY-DSA(7) - "DSA key generation parameters" in
EVP_PKEY-DSA(7) - "DH parameters" in
EVP_PKEY-DH(7) - "DH key generation parameters" in
EVP_PKEY-DH(7) - "Common EC parameters" in
EVP_PKEY-EC(7) - "Common X25519, X448, ED25519 and ED448 parameters" in
EVP_PKEY-X25519(7) - "Common parameters" in
EVP_PKEY-ML-DSA(7) - "Common parameters" in
EVP_PKEY-ML-KEM(7)
π RETURN VALUES π
EVP_PKEY_CTX_set_params()returns1for success or0otherwise.EVP_PKEY_CTX_settable_params()returns anOSSL_PARAMarray on success orNULLon error. it may also returnNULLif there are no settable parameters available β so like, sometimesNULLjust means "nothing here", not "something broke", iykyk π« .- all other functions and macros described on this page return a positive value for success and
0or a negative value for failure. and specifically, a return value of-2indicates the operation is not supported by the public key algorithm π.
π 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.
π 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>.
and that's the whole page bestie, you ate it up πβ¨ this was EVP_PKEY_CTX_SET_PARAMS(3ossl) from OpenSSL version 3.5.9, dated 2026-09-29 β go forth and pass those params, love u, mwah πππ¦
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms