EVP_PKEY_CTX_GET0_PKEY(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… 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 the EVP_PKEY associated with the EVP_PKEY_CTX, or NULL if it is not set. no key, no problem, just NULL. πŸ™ˆ
  • EVP_PKEY_CTX_get0_peerkey() β€” returns the peer EVP_PKEY associated with the EVP_PKEY_CTX, or NULL if it is not set. same vibe, peer edition. πŸ“
⚠️ bestie listen β€” the returned EVP_PKEY objects are owned by the EVP_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 🌈

go read those, they're iconic too. 🧚


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