EVP_PKEY_GET_FIELD_TYPE(3ossl)
β¨ 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, or0on error πEVP_PKEY_get_ec_point_conv_form()returns the point conversion format number (seeEC_GROUP_copy(3)), or0on 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 π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms