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