xref: /freebsd-src/crypto/openssl/doc/man3/EVP_PKEY_CTX_get0_pkey.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_pkey,
6*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_peerkey
7*b077aed3SPierre Pronchery- functions for accessing the EVP_PKEY associated with an EVP_PKEY_CTX
8*b077aed3SPierre Pronchery
9*b077aed3SPierre Pronchery=head1 SYNOPSIS
10*b077aed3SPierre Pronchery
11*b077aed3SPierre Pronchery #include <openssl/evp.h>
12*b077aed3SPierre Pronchery
13*b077aed3SPierre Pronchery EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
14*b077aed3SPierre Pronchery EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
15*b077aed3SPierre Pronchery
16*b077aed3SPierre Pronchery=head1 DESCRIPTION
17*b077aed3SPierre Pronchery
18*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_pkey() is used to access the B<EVP_PKEY>
19*b077aed3SPierre Proncheryassociated with the given B<EVP_PKEY_CTX> I<ctx>.
20*b077aed3SPierre ProncheryThe B<EVP_PKEY> obtained is the one used for creating the B<EVP_PKEY_CTX>
21*b077aed3SPierre Proncheryusing either L<EVP_PKEY_CTX_new(3)> or L<EVP_PKEY_CTX_new_from_pkey(3)>.
22*b077aed3SPierre Pronchery
23*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_peerkey() is used to access the peer B<EVP_PKEY>
24*b077aed3SPierre Proncheryassociated with the given B<EVP_PKEY_CTX> I<ctx>.
25*b077aed3SPierre ProncheryThe peer B<EVP_PKEY> obtained is the one set using
26*b077aed3SPierre Proncheryeither L<EVP_PKEY_derive_set_peer(3)> or L<EVP_PKEY_derive_set_peer_ex(3)>.
27*b077aed3SPierre Pronchery
28*b077aed3SPierre Pronchery=head1 RETURN VALUES
29*b077aed3SPierre Pronchery
30*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_pkey() returns the B<EVP_PKEY> associated with the
31*b077aed3SPierre ProncheryEVP_PKEY_CTX or NULL if it is not set.
32*b077aed3SPierre Pronchery
33*b077aed3SPierre ProncheryEVP_PKEY_CTX_get0_peerkey() returns the peer B<EVP_PKEY> associated with the
34*b077aed3SPierre ProncheryEVP_PKEY_CTX or NULL if it is not set.
35*b077aed3SPierre Pronchery
36*b077aed3SPierre ProncheryThe returned EVP_PKEY objects are owned by the EVP_PKEY_CTX,
37*b077aed3SPierre Proncheryand therefore should not explicitly be freed by the caller.
38*b077aed3SPierre Pronchery
39*b077aed3SPierre ProncheryThese functions do not affect the EVP_PKEY reference count.
40*b077aed3SPierre ProncheryThey merely act as getter functions, and should be treated as such.
41*b077aed3SPierre Pronchery
42*b077aed3SPierre Pronchery=head1 SEE ALSO
43*b077aed3SPierre Pronchery
44*b077aed3SPierre ProncheryL<EVP_PKEY_CTX_new(3)>, L<EVP_PKEY_CTX_new_from_pkey(3)>,
45*b077aed3SPierre ProncheryL<EVP_PKEY_derive_set_peer(3)>, L<EVP_PKEY_derive_set_peer_ex(3)>
46*b077aed3SPierre Pronchery
47*b077aed3SPierre Pronchery=head1 COPYRIGHT
48*b077aed3SPierre Pronchery
49*b077aed3SPierre ProncheryCopyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
50*b077aed3SPierre Pronchery
51*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").
52*b077aed3SPierre ProncheryYou may not use this file except in compliance with the License.
53*b077aed3SPierre ProncheryYou can obtain a copy in the file LICENSE in the source distribution or at
54*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
55*b077aed3SPierre Pronchery
56*b077aed3SPierre Pronchery=cut
57