X509_ACERT_ADD_ATTR_NCONF(3SSL)
β¨ X509_ACERT_ADD_ATTR_NCONF(3SSL) β¨
okay bestie so this is <openssl/x509_acert.h> territory, and the function is X509_ACERT_add_attr_nconf β it's the one that lets you pour a whole config section's worth of attributes into your attribute certificate π
πΈ SYNOPSIS πΈ
#include <openssl/x509_acert.h>
int X509_ACERT_add_attr_nconf(CONF *conf, const char *section,
X509_ACERT *acert);
π DESCRIPTION π
So like, X509_ACERT_add_attr_nconf() takes your existing X509_ACERT structure, the one you already made, and it's gonna add one or more X509_ATTRIBUTEs to it. Obsessed. β¨
Where do those attributes come from tho? Not from you typing them out one by one, no ma'am β they get read straight out of a section of the conf object you hand over. Very lazy-girl-coded of them honestly. π
That given section of the config needs to look all like this, one attribute per line, no cap:
attribute_name = value
Now here's the tea: the format of value fully depends on what attribute_name you're working with. It can be either:
- a plain string value π
- an
ASN1_TYPEobject π¦
Wanna encode one of those ASN1_TYPE objects? Lowkey easy. Just slap the prefix "ASN1:" on the front, then follow it with the object description β and it uses the exact same syntax as ASN1_generate_nconf(3), so if you know that one you already know this one. periodt.
Like, for example, bestie:
id-aca-group = ASN1:SEQUENCE:ietfattr
[ietfattr]
values = SEQUENCE:groups
[groups]
1.string = UTF8:mygroup1
See? Sections inside sections, living their nested main character lives. π
π RETURN VALUES π
X509_ACERT_add_attr_nconf()returns1when it slays (success) π- and
0when it does not (failure) π
π SEE ALSO π
ASN1_generate_nconf(3) β go read that one too fr fr.
π¦ HISTORY π¦
The function X509_ACERT_add_attr_nconf() was added in OpenSSL 3.4. So if your OpenSSL is older than that, it's giving "who is she" π
π 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 that's the whole page bestie, mwah π stay licensed, stay compliant, don't skip the ASN1: prefix β¨
X509_ACERT_ADD_ATTR_NCONF(3SSL) β OpenSSL 4.0.3 β 2026-09-29 π«Ά
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms