EVP_PKEY_GET_FIELD_TYPE(3ossl)

πŸ’– EVP_PKEY_GET_FIELD_TYPE πŸ’–

okay bestie, welcome to the OpenSSL manual for EVP_PKEY_GET_FIELD_TYPE(3ossl) β€” yes that's the whole squad name up there, and honestly? iconic of them to give two functions one page. sit down, grab a boba, we're learning crypto key internals 🧚✨


✨ NAME ✨

EVP_PKEY_get_field_type, EVP_PKEY_get_ec_point_conv_form β€” get the field type or the point conversion form of a key πŸ’…


🌸 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);

like, two lil functions, both taking a const EVP_PKEY *pkey, both returning an int. no cap, that's the whole vibe 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so EVP_PKEY_get_field_type() returns the field type NID of the pkey, if pkey's key type supports it. the types the built-in OpenSSL providers currently support are either:

  • NID_X9_62_prime_field β€” for prime curves πŸ”₯
  • NID_X9_62_characteristic_two_field β€” for binary curves 🌈

and those values are defined in the <openssl/obj_mac.h> header file, iykyk.

meanwhile EVP_PKEY_get_ec_point_conv_form() returns the point conversion format of the pkey, again if pkey's key type supports it. that's it. that's the function. main character energy fr πŸ’–


πŸ’€ NOTES πŸ’€

among the standard OpenSSL key types, this is only supported for EC and SM2 keys. like, those two. that's the list.

but β€” plot twist β€” other providers may support this for additional key types, so don't come for me if your third-party provider is doing its own thing πŸ™ˆ


πŸ‘‘ 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 (peep EC_GROUP_copy(3) for that one), or 0 on error 😭
bestie, 0 means error in both cases. don't be out here treating 0 as a real value. it is not. πŸ’…

πŸŽ€ SEE ALSO πŸŽ€


⭐ HISTORY ⭐

these functions were added in OpenSSL 3.0 ✨ so if you're on something ancient, that's a you problem, bestie.


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


okay that's the whole page, you ate that πŸ“ go forth and get your field types. and just so you know where this all came from: this was the OpenSSL 3.5.9 manual page, dated 2026-09-29. slay, bye πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from