X509_ACERT_ADD1_ATTR(3ossl)
π X509_ACERT_ADD1_ATTR π
okay bestie, so this is the X509_ACERT_ADD1_ATTR(3ossl) page from the OpenSSL manual, and it's all about wrangling attributes on an X509_ACERT. yes that's the Attribute Certificate thing. we're adding attributes, we're deleting attributes, we're being the main character of certificate metadata. let's GO π
β¨ NAME β¨
X509_ACERT_add1_attr, X509_ACERT_add1_attr_by_NID, X509_ACERT_add1_attr_by_OBJ, X509_ACERT_add1_attr_by_txt, X509_ACERT_delete_attr β the X509_ACERT attribute functions π¦
πΈ SYNOPSIS πΈ
#include <openssl/x509_acert.h>
int X509_ACERT_add1_attr(X509_ACERT *x, X509_ATTRIBUTE *attr);
int X509_ACERT_add1_attr_by_NID(X509_ACERT *x, int nid, int type,
const void *bytes, int len);
int X509_ACERT_add1_attr_by_OBJ(X509_ACERT *x, const ASN1_OBJECT *obj,
int type, const void *bytes, int len);
int X509_ACERT_add1_attr_by_txt(X509_ACERT *x, const char *attrname, int type,
const unsigned char *bytes, int len);
X509_ATTRIBUTE *X509_ACERT_delete_attr(X509_ACERT *x, int loc);
π DESCRIPTION π
so like, five little besties, all here to help you handle attributes on your ACERT. here's the tea, one by one π
X509_ACERT_add1_attr()β takes an already-constructedX509_ATTRIBUTEcalled attr and adds it to the existingX509_ACERTstructure x. that's it. drop it in, you're done πX509_ACERT_add1_attr_by_NID()andX509_ACERT_add1_attr_by_OBJ()β these two add an attribute of type nid or obj respectively, with a value of ASN1 type type, and that value gets constructed using len bytes taken from bytes. ngl, it's giving "I don't have a whole attribute object but I do have opinions" energy β¨X509_ACERT_add1_attr_by_txt()β same vibe but the type is given as attrname, a string, and the value is ASN1 type type built from len bytes out of bytes. note bestie: this one takes aconst unsigned char *while the NID and OBJ ones take aconst void *. yes it's a whole thing, don't come for me, just copy the signature πX509_ACERT_delete_attr()β deletes the loc-th attribute from x and hands you back a pointer to it. but if x has fewer than loc attributes in it? you getNULL. so rude but so valid π
β RETURN VALUES β
X509_ACERT_add1_attr(), X509_ACERT_add1_attr_by_NID(), and X509_ACERT_add1_attr_by_OBJ() return 1 for success and 0 for failure. slay or flop, no in-between π«Ά
X509_ACERT_delete_attr() returns an X509_ATTRIBUTE pointer on success, or NULL on failure. that's the whole contract. periodt π
π SEE ALSO π
X509_ACERT_get_attr_count(3) β go check how many attributes you actually have, bestie π§
π HISTORY π
X509_ACERT_add1_attr(), X509_ACERT_add1_attr_by_NID(), X509_ACERT_add1_attr_by_OBJ(), X509_ACERT_add1_attr_by_txt() and X509_ACERT_delete_attr() were all added in OpenSSL 3.4. iconic, honestly π
π 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>.
fr fr, read the license, it's not optional and it's not that long π
and that's the whole page, bestie!! this was OpenSSL 3.5.9, dated 2026-09-29, and the page itself is X509_ACERT_ADD1_ATTR(3ossl) β go forth and attribute responsibly β¨ππ¦
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms