EVP_PKEY_CTX_GET_ALGOR(3SSL)

πŸ’– EVP_PKEY_CTX_GET_ALGOR πŸ’–

okay bestie, welcome to EVP_PKEY_CTX_GET_ALGOR(3SSL) β€” this is the girlies' guide to handing AlgorithmIdentifiers back and forth with algorithm implementations πŸ¦‹βœ¨


✨ NAME ✨

EVP_CIPHER_CTX_get_algor</p>, EVP_CIPHER_CTX_get_algor_params</p>, EVP_CIPHER_CTX_set_algor_params</p>, EVP_PKEY_CTX_get_algor</p>, EVP_PKEY_CTX_get_algor_params</p>, EVP_PKEY_CTX_set_algor_params</p> β€” passing an AlgorithmIdentifier and its params to and from algorithm implementations, no cap πŸŽ€


✨ SYNOPSIS ✨

int EVP_TYPE_CTX_get_algor(EVP_TYPE_CTX *ctx, X509_ALGOR **alg);
int EVP_TYPE_CTX_get_algor_params(EVP_TYPE_CTX *ctx, X509_ALGOR *alg);
int EVP_TYPE_CTX_set_algor_params(EVP_TYPE_CTX *ctx, const X509_ALGOR *alg);

✨ DESCRIPTION ✨

so like, in this whole description and in the SYNOPSIS up there ⬆️, TYPE is serving as a lil placeholder for, literally, any EVP operation type. it's giving "insert your fave here" πŸ’…

🌸 EVP_TYPE_CTX_get_algor()

she attempts to retrieve a whole entire AlgorithmIdentifier from the EVP_TYPE implementation, and populates *alg with it. πŸ’«

if alg is NULL, calling her is lowkey just a vibe check β€” it tells you whether calling this function is even supported at all by the EVP_TYPE implementation. πŸ‘€

and if *alg is NULL, space gets allocated automatically and assigned to *alg. iconic, she does it herself. ✨

πŸŽ€ EVP_TYPE_CTX_get_algor_params()

she attempts to retrieve the parameters part of an AlgorithmIdentifier from the EVP_TYPE implementation and populates alg-parameters> with it. same energy as above: if alg is NULL, calling her is just the support-check vibe check for the EVP_TYPE implementation. 🫢

if alg->parameters is NULL, space will be allocated automatically and assigned to alg->parameters. 🌈

if alg->parameters is not NULL... girl. 😭 its previous contents will be overwritten with the retrieved AlgorithmIdentifier parameters. Beware! πŸ’€

πŸ¦‹ EVP_TYPE_CTX_set_algor_params()

she attempts to pass alg->parameters to the EVP_TYPE implementation. and yep, you already know β€” if alg is NULL, calling her serves to see if calling her is supported at all by the EVP_TYPE implementation. main character check-in behavior fr fr πŸ‘‘


✨ RETURN VALUES ✨

all of these functions return 1 for success πŸŽ‰ and 0 or a negative number if an error occurs 😭.

in particular, -2 is returned when the function isn't supported by the EVP_TYPE implementation. not supported = not invited, periodt. πŸ’…


✨ HISTORY ✨

these functions were added in OpenSSL 3.4. new girls on the block, we love to see it 🌸✨


Copyright 2024 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>. πŸ“œ


mwah πŸ’‹ that's the whole page bestie β€” go forth and pass those AlgorithmIdentifiers around responsibly.

version 4.0.3 Β· dated 2026-09-29 Β· signing off, xoxo πŸ«ΆπŸ’–

πŸ“¦ where this page comes from