X509_ACERT_ADD1_ATTR(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… 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 ⭐


πŸ‘‘ 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 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