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 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