EVP_PKEY_GET_FIELD_TYPE(3SSL)
β¨ EVP_PKEY_GET_FIELD_TYPE β bestie edition β¨
okay so this is the OpenSSL manual page for EVP_PKEY_get_field_type and EVP_PKEY_get_ec_point_conv_form, and fr fr it's a short one but it's a good one. Section 3SSL, we're in the library, we're being useful, periodt. π
These two functions are giving "just tell me one tiny piece of info about this key" energy β no drama, no mutation, just vibes and a return value. Let's get into it. π¦
π NAME π
EVP_PKEY_get_field_type, EVP_PKEY_get_ec_point_conv_form β get field type or point conversion form of a key
Yeah bestie, that's literally the whole job description. One of them tells you what field type a key lives in, the other tells you the point conversion form. Little facts about a key. Chef's kiss. π
πΈ SYNOPSIS πΈ
Include the header, obviously:
#include <openssl/evp.h>
And here are your two icons:
int EVP_PKEY_get_field_type(const EVP_PKEY *pkey);
int EVP_PKEY_get_ec_point_conv_form(const EVP_PKEY *pkey);
Both take a const EVP_PKEY *pkey and both hand you back an int. No cap. β¨
π¦ DESCRIPTION π¦
EVP_PKEY_get_field_type()
So this one returns the field type NID of the pkey β but ONLY if pkey's key type supports it. Like, it's not gonna make something up for a key type that has nothing to say about fields. π
What are the types currently supported by the built-in OpenSSL providers, you ask? Iconic question:
NID_X9_62_prime_fieldβ for prime curves πNID_X9_62_characteristic_two_fieldβ for binary curves π§
And btw those values are defined in the <openssl/obj_mac.h> header file, so if you're out here wondering where they come from β there. Go look. π
EVP_PKEY_get_ec_point_conv_form()
And this one returns the point conversion format of the pkey, again only if pkey's key type supports it. That's it, that's the function. Short and slay. π
β NOTES β
Okay this part matters, so listen up:
Among the standard OpenSSL key types, this is only</>) supported for EC and SM2 keys. Only those two, bestie. Don't go calling it on random keys and expecting magic.
BUT β and this is the plot twist β other providers may support this for additional key types. So the built-in story isn't the whole story. iykyk. π₯
π RETURN VALUES π
EVP_PKEY_get_field_type()β returns the field type NID, or0on error. That's the deal.EVP_PKEY_get_ec_point_conv_form()β returns the point conversion format number (seeEC_GROUP_copy(3)) or0on error.
Heads up:0is the "something went wrong" signal for both of these. Don't be out here treating a0like a real answer, because it is not. π
π₯ SEE ALSO π₯
That's the whole list. Go read it if you want the deets on the point conversion format numbers. π
π HISTORY π
These functions were added in OpenSSL 3.0. So they're not ancient relics, they're relatively fresh. β¨
π 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>.
Like, actually read the license, bestie, it's not decorative. π«Ά
and that's the whole page!! mwah π this one came from OpenSSL version 4.0.3, dated 2026-09-29, and yeah the manual name is EVP_PKEY_GET_FIELD_TYPE(3SSL) in case you needed to cite it. stay slaying, stay reading manpages, ily πβ¨
π¦ 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