EVP_PKEY_ASN1_GET_COUNT(3SSL)
π EVP_PKEY_ASN1_GET_COUNT(3SSL) β the OpenSSL manual page, bestie edition β¨
okay so this is the OpenSSL manual page for enumerating public key ASN.1 methods, and honestly? it's giving backstage-pass energy ποΈ β you're literally getting the guest list of every public key method that's loaded up. let's get into it π«Ά
πΈ NAME πΈ
EVP_PKEY_asn1_find, EVP_PKEY_asn1_find_str, EVP_PKEY_asn1_get_count, EVP_PKEY_asn1_get0, EVP_PKEY_asn1_get0_info β these five besties collectively enumerate public key ASN.1 methods π
β¨ SYNOPSIS β¨
#include <openssl/evp.h>
int EVP_PKEY_asn1_get_count(void);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,
const char *str, int len);
int EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,
int *ppkey_flags, const char **pinfo,
const char **ppem_str,
const EVP_PKEY_ASN1_METHOD *ameth);
π¦ DESCRIPTION π¦
π« the headcount era
EVP_PKEY_asn1_count() returns a count of the number of public key ASN.1 methods available β and yes, that includes the standard methods plus any methods your application went and added itself. main character behavior honestly π
π« pick one by index
EVP_PKEY_asn1_get0() returns the public key ASN.1 method idx. and the rules are the rules: the value of idx must be between zero and EVP_PKEY_asn1_get_count() - 1. no vibes-based indexing, bestie π«
π« find by NID
EVP_PKEY_asn1_find() looks up the EVP_PKEY_ASN1_METHOD with NID type. if pe isn't NULL, then it will look up an engine implementing a EVP_PKEY_ASN1_METHOD for the NID type and return that instead, and also set *pe to point at the engine that implements it. so like, it does a little extra credit lookup for you π§
π« find by PEM string
EVP_PKEY_asn1_find_str() looks up the EVP_PKEY_ASN1_METHOD with PEM type string str. just like EVP_PKEY_asn1_find(), if pe isn't NULL, then it will look up an engine implementing a EVP_PKEY_ASN1_METHOD for the NID type and return that instead, and also set *pe to point at the engine that implements it. same deal, different search key π
π« spill the info
EVP_PKEY_asn1_get0_info() returns the public key ID, base public key ID (both NIDs), any flags, the method description and PEM type string associated with the public key ASN.1 method *ameth. it's basically the whole info dump, no gatekeeping π
β οΈ the thread-safety tea β οΈ
EVP_PKEY_asn1_count(), EVP_PKEY_asn1_get0(), EVP_PKEY_asn1_find() and EVP_PKEY_asn1_find_str() are not thread safe, but as long as all EVP_PKEY_ASN1_METHOD objects are added before the application gets threaded, using them is safe. see EVP_PKEY_asn1_add0(3).
no cap, read that caveat twice π get all your objects added first, then go multithreaded β that's the whole vibe check.
π₯ RETURN VALUES π₯
EVP_PKEY_asn1_count()β returns the number of available public key methods. a whole number, that's it, slay πEVP_PKEY_asn1_get0()β returns a public key method, orNULLifidxis out of range. out of range = you get nothing, bestie πEVP_PKEY_asn1_get0_info()β returns0on failure,1on success.
π SEE ALSO π
π COPYRIGHT π
Copyright 2017 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 page, bestie π this whole thing is from OpenSSL 3.5.7, dated 2026-06-09, and it's the EVP_PKEY_ASN1_GET_COUNT(3SSL) page β go forth and enumerate, periodt πβ¨
π¦ where this page comes from
- debian trixie: libssl-doc 3.5.7-1~deb13u2 Β· Apache-2.0
- debian trixie: libssl-doc 3.5.7-1~deb13u3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms