EVP_PKEY_CTX_GET0_PKEY(3ossl)
π EVP_PKEY_CTX_GET0_PKEY(3ossl)
okay so bestie, this is an OpenSSL manual page (the 3ossl manual, to be exact) and it's lowkey one of the chillest ones you'll ever read. It's all about peeking at the EVP_PKEY that's vibing inside your EVP_PKEY_CTX β no stealing, no drama, just looking. π
β¨ NAME β¨
EVP_PKEY_CTX_get0_pkey, EVP_PKEY_CTX_get0_peerkey β the little functions for accessing the EVP_PKEY associated with an EVP_PKEY_CTX. That's it. That's the whole job. π
πΈ SYNOPSIS πΈ
#include <openssl/evp.h>
EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);
EVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);
two functions, two pointers, zero chaos. slay. β¨
π¦ DESCRIPTION π¦
EVP_PKEY_CTX_get0_pkey() π
So this one is used to access the EVP_PKEY associated with the given EVP_PKEY_CTX ctx. And like, which EVP_PKEY is it? It's the one β the very key used for creating the EVP_PKEY_CTX in the first place, via either EVP_PKEY_CTX_new(3) or EVP_PKEY_CTX_new_from_pkey(3). main character key energy fr fr. π
EVP_PKEY_CTX_get0_peerkey() π«Ά
And this one? It's used to access the peer EVP_PKEY associated with the given EVP_PKEY_CTX ctx. The peer EVP_PKEY you get back is the one that got set using either EVP_PKEY_derive_set_peer(3) or EVP_PKEY_derive_set_peer_ex(3). so it's literally the other half of the convo, iykyk. π¬
π₯ RETURN VALUES π₯
EVP_PKEY_CTX_get0_pkey()β returns theEVP_PKEYassociated with theEVP_PKEY_CTX, orNULLif it is not set. no key, no problem, justNULL. πEVP_PKEY_CTX_get0_peerkey()β returns the peerEVP_PKEYassociated with theEVP_PKEY_CTX, orNULLif it is not set. same vibe, peer edition. π
β οΈ bestie listen β the returnedEVP_PKEYobjects are owned by theEVP_PKEY_CTX, so you should not explicitly free them yourself. not yours, don't touch, hands off. π
Also important, no cap: these functions do not affect the EVP_PKEY reference count. They merely act as getter functions, and should be treated as such. literally just looking respectfully. πβ¨
π SEE ALSO π
EVP_PKEY_CTX_new(3)EVP_PKEY_CTX_new_from_pkey(3)EVP_PKEY_derive_set_peer(3)EVP_PKEY_derive_set_peer_ex(3)
go read those, they're iconic too. π§
π COPYRIGHT π
Copyright 2022-2023 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, bestie!! π this came from OpenSSL 3.5.0, dated 2026-09-25, page EVP_PKEY_CTX_GET0_PKEY(3ossl) β periodt. π
β¨
π¦ 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