EVP_PKEY_GET_GROUP_NAME(3SSL)
π NAME π
EVP_PKEY_get_group_name β bestie, this is the lil function that tells you the group name of a key π
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
int EVP_PKEY_get_group_name(EVP_PKEY *pkey, char *gname, size_t gname_sz,
size_t *gname_len);
π DESCRIPTION π
okay so EVP_PKEY_get_group_name() does the thing where it fills in the group name of the pkey into gname β and it's giving very "capped, no overflow" energy, because it writes up to at most gname_sz bytes, and yes that count includes the ending NUL byte π«Ά
It also assigns *gname_len the actual length of the name, not including the NUL byte β but only if pkey's key type actually supports it, iykyk.
And here's the cute part: gname and gname_len can individually be NULL, and in that case that one just won't get filled in or assigned. no drama, no crash, we love a flexible API π
πΈ NOTES πΈ
Lowkey important: among the standard OpenSSL key types, this is only supported for DH, EC and SM2 keys. that's it, that's the list π
Other providers may support this for additional key types though β so don't come for the providers that ate π
π RETURN VALUES π
EVP_PKEY_get_group_name() returns 1 if the group name could be filled in β slay β
β otherwise 0. that's the whole vibe check.
π¦ HISTORY π¦
This function was added in OpenSSL 3.0. a classic, an icon, a legend π
π COPYRIGHT π
Copyright 2020-2021 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>.
ok bestie that's the whole page, you literally know this function now, no cap πβ¨ this was OpenSSL version 4.0.3, dated 2026-09-29, filed under EVP_PKEY_GET_GROUP_NAME(3SSL) β mwah, go read a key πππ§
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms