EVP_PKEY_CTX_SET_PARAMS(3ossl)
π 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:
- "Common parameters" in
provider-keymgmt(7) - "Key Exchange parameters" in
provider-keyexch(7) - "Signature parameters" in
provider-signature(7)
and the key-type-specific ones:
- "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)
go off, parameter catalogue. π
π RETURN VALUES π
listen up, this part is literally the grading rubric:
EVP_PKEY_CTX_set_params()returns1for success or0otherwise. one is the winner, zero is the flop era. πEVP_PKEY_CTX_settable_params()returns anOSSL_PARAMarray on success orNULLon error. it may also returnNULLif there are no settable parameters available β soNULLisn'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 π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms