1=pod
2
3=begin comment
4
5This page collects all existing functions with this pattern:
6
7EVP_{TYPE}_CTX_get_algor()
8EVP_{TYPE}_CTX_get_algor_params()
9EVP_{TYPE}_CTX_set_algor_params()
10
11... where {TYPE} is the name of an EVP operation type.
12
13=end comment
14
15=head1 NAME
16
17EVP_CIPHER_CTX_get_algor,
18EVP_CIPHER_CTX_get_algor_params,
19EVP_CIPHER_CTX_set_algor_params,
20EVP_PKEY_CTX_get_algor,
21EVP_PKEY_CTX_get_algor_params,
22EVP_PKEY_CTX_set_algor_params
23- pass AlgorithmIdentifier and its params to/from algorithm implementations
24
25=head1 SYNOPSIS
26
27=for openssl generic
28
29 int EVP_TYPE_CTX_get_algor(EVP_TYPE_CTX *ctx, X509_ALGOR **alg);
30 int EVP_TYPE_CTX_get_algor_params(EVP_TYPE_CTX *ctx, X509_ALGOR *alg);
31 int EVP_TYPE_CTX_set_algor_params(EVP_TYPE_CTX *ctx, const X509_ALGOR *alg);
32
33=head1 DESCRIPTION
34
35In the description here and the L</SYNOPSIS> above, B<I<TYPE>> is used as a
36placeholder for any EVP operation type.
37
38B<EVP_I<TYPE>_CTX_get_algor>() attempts to retrieve a complete
39AlgorithmIdentifier from the B<EVP_I<TYPE>> implementation, and populates
40I<*alg> with it.
41If I<alg> is NULL, calling this function will serve to see if calling this
42function is supported at all by the B<EVP_I<TYPE>> implementation.
43If I<*alg> is NULL, space will be allocated automatically, and assigned to
44I<*alg>.
45
46B<EVP_I<TYPE>_CTX_get_algor_params>() attempts to retrieve the I<parameters>
47part of an AlgorithmIdentifier from the B<EVP_I<TYPE>> implementation, and
48populates I<alg->parameters> with it.
49If I<alg> is NULL, calling this function will serve to see if calling this
50function is supported at all by the B<EVP_I<TYPE>> implementation.
51If I<< alg->parameters >> is NULL, space will be allocated automatically, and
52assigned to  I<< alg->parameters >>.
53If I<< alg->parameters >> is not NULL, its previous contents will be overwritten
54with the retrieved AlgorithmIdentifier parameters.  Beware!
55
56B<EVP_I<TYPE>_CTX_set_algor_params>() attempts to pass I<< alg->parameters >>
57to the B<EVP_I<TYPE>> implementation.
58If I<alg> is NULL, calling this function will serve to see if calling this
59function is supported at all by the B<EVP_I<TYPE>> implementation.
60
61=head1 RETURN VALUES
62
63All functions return 1 for success, and 0 or a negative number if an error
64occurs.  In particular, -2 is returned when the function isn't supported by
65the B<EVP_I<TYPE>> implementation.
66
67=head1 HISTORY
68
69These functions were added in OpenSSL 3.4.
70
71=head1 COPYRIGHT
72
73Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
74
75Licensed under the Apache License 2.0 (the "License").  You may not use
76this file except in compliance with the License.  You can obtain a copy
77in the file LICENSE in the source distribution or at
78L<https://www.openssl.org/source/license.html>.
79
80=cut
81