X509_ACERT_ADD1_ATTR(3ossl)
π X509_ACERT_ADD1_ATTR β the acert attribute glow-up page
ok so first things first, this is from the 3ossl manual, bestie β OpenSSL's very own docs, section 3. It's the page all about slapping attributes onto an X509_ACERT and yeeting them back off again. Group chat, 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 β literally the whole X509_ACERT attribute friend group π
πΈ 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);
like, there's a version of adding an attribute for every mood β¨
π¦ DESCRIPTION π¦
X509_ACERT_add1_attr() takes a constructed X509_ATTRIBUTE called attr and adds it into the existing X509_ACERT structure x. like handing your bestie a fully assembled gift instead of the raw supplies π
X509_ACERT_add1_attr_by_NID() and X509_ACERT_add1_attr_by_OBJ() add an attribute of type nid or obj β no cap, either one β with a value of ASN1 type type that's constructed using len bytes from bytes. you bring the type and the bytes, it does the construction, iconic behavior fr π
X509_ACERT_add1_attr_by_txt() does the same little construction number β attribute of type attrname, value of ASN1 type type, built from len bytes out of bytes. it's giving "same energy, different label" π
X509_ACERT_delete_attr() will delete the locth attribute from x and return a pointer to it β or NULL if there are fewer than loc attributes contained in x. So if x is running light on attributes, you get NULL, and that's just how it is π
π₯ 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.
heads up bestie: X509_ACERT_add1_attr_by_txt() is not in that list of return values β the original page says exactly what it says and nothing more, so keep that vibe check in mind π
X509_ACERT_delete_attr() returns an X509_ATTRIBUTE pointer on success or NULL on failure.
β SEE ALSO β
X509_ACERT_get_attr_count(3)β the go-to for counting what's actually in there π
π 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 added in OpenSSL 3.4. so they're new-new, not vintage π
π§ 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>.
ok that's the page!! mwah π«Ά this lil rewrite is living at version 3.5.0, dated 2026-09-25, in the X509_ACERT_ADD1_ATTR(3ossl) section β slay, go forth and attribute responsibly πβ¨
π¦ 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