X509_ACERT_GET_ATTR(3ossl)
πΈ NAME πΈ
okay so bestie, welcome to the X509_ACERT_GET_ATTR(3ossl) manual page β this one is all about retrieving attributes from an X509_ACERT structure. The main-character functions are:
X509_ACERT_get_attrX509_ACERT_get_attr_by_NIDX509_ACERT_get_attr_by_OBJX509_ACERT_get_attr_count
β¨ SYNOPSIS β¨
#include <openssl/x509_acert.h>
X509_ATTRIBUTE *X509_ACERT_get_attr(const X509_ACERT *x, int loc);
int X509_ACERT_get_attr_by_NID(const X509_ACERT *x, int nid, int lastpos);
int X509_ACERT_get_attr_by_OBJ(const X509_ACERT *x, const ASN1_OBJECT *obj,
int lastpos);
int X509_ACERT_get_attr_count(const X509_ACERT *x);
π¦ DESCRIPTION π¦
So here's the tea π: X509_ACERT_get0_attr() retrieves the locth X509_ATTRIBUTE from an X509_ACERT x. Yes, the page says X509_ACERT_get0_attr() here while the synopsis spells it X509_ACERT_get_attr β that's literally what the page says, iykyk π.
X509_ACERT_get_attr_count() returns the total number of attributes in the X509_ACERT.
X509_ACERT_get_attr_by_NID() and X509_ACERT_get_attr_by_OBJ() retrieve the next attribute location matching nid or obj after lastpos. lastpos should initially be set to -1. If there are no more entries, -1 is returned. If nid is invalid (doesn't correspond to a valid OID), then -2 is returned.
bestie, keep those return codes straight:-1is "no more entries", and-2is "that NID is invalid". no cap π
π RETURN VALUES π
X509_ACERT_get0_attr()returns anX509_ATTRIBUTEfrom an attribute certificate, orNULLif the specified attribute is not found.X509_ACERT_get_attr_by_NID()andX509_ACERT_get_attr_by_OBJ()return the location of the next attribute requested, or-1if not found.X509_ACERT_get_attr_by_NID()can also return-2if the supplied NID is invalid.X509_ACERT_get_attr_count()returns the number of attributes in the given attribute certificate.
π HISTORY π
X509_ACERT_get0_attr(), X509_ACERT_get_attr_by_NID(), X509_ACERT_get_attr_by_OBJ() and X509_ACERT_get_attr_count() were added in OpenSSL 3.4. slay β¨
π COPYRIGHT π
Copyright 2023-2024 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 bye bestie π«Ά this page came from OpenSSL 3.5.6, dated 2026-04-07, and it belongs to the X509_ACERT_GET_ATTR(3ossl) manual πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms