EVP_PKEY_GET_FIELD_TYPE(3ossl)

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

✨ EVP_PKEY_GET_FIELD_TYPE β€” get field type or point conversion form of a key ✨

okay so hi bestie πŸ’– welcome to the 3ossl corner of the internet, where we learn how to peek at a key and ask it the important questions: what's your field type? and what's your point conversion form? no cap, that's literally the whole vibe of this page. let's go πŸŽ€


🌸 SYNOPSIS 🌸

#include <openssl/evp.h>

int EVP_PKEY_get_field_type(const EVP_PKEY *pkey);
int EVP_PKEY_get_ec_point_conv_form(const EVP_PKEY *pkey);

two little functions, both taking a const EVP_PKEY *pkey, both returning an int. short and iconic, we love to see it πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

πŸ¦‹ EVP_PKEY_get_field_type()

so this one returns the field type NID of pkey, if pkey's key type supports it. and the types currently supported by the built-in OpenSSL providers are:

  • NID_X9_62_prime_field β€” for prime curves πŸ“
  • NID_X9_62_characteristic_two_field β€” for binary curves 🧚

both of those values are defined in the <openssl/obj_mac.h> header file, so that's where you go if you need to look them up, iykyk πŸ“š

🌈 EVP_PKEY_get_ec_point_conv_form()

and this one returns the point conversion format of the pkey, again if pkey's key type supports it. that's it, that's the function, she's simple and she knows it πŸ’β€β™€οΈ


πŸ”₯ NOTES πŸ”₯

among the standard OpenSSL key types, this is only supported for EC and SM2 keys. periodt. that's the rule.

but wait β€” other providers may support this for additional key types, so don't come for me if you see it working somewhere unexpected πŸ‘€ main character energy from the third-party providers, honestly.


⭐ RETURN VALUES ⭐

  • EVP_PKEY_get_field_type() returns the field type NID, or 0 on error πŸ’€
  • EVP_PKEY_get_ec_point_conv_form() returns the point conversion format number (see EC_GROUP_copy(3)), or 0 on error πŸ’€

so yeah, 0 means something went wrong in both cases. keep an eye out for it 🫢


πŸŽ€ SEE ALSO πŸŽ€

  • EC_GROUP_copy(3) β€” go read it, bestie, the point conversion format lore lives there

πŸ‘‘ HISTORY πŸ‘‘

these functions were added in OpenSSL 3.0. so if you're on something older... sorry babe, not me, not my problem πŸ™ˆ


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


and that's the whole page, bestie 🌸 slay, you made it to the end. this little write-up is from OpenSSL 3.5.0, dated 2026-09-25 β€” mwah, go forth and inspect your keys πŸ’…βœ¨

πŸ“¦ where this page comes from