X509at_add1_attr_by_txt

Create an attribute by name and append a copy to a STACK_OF(X509_ATTRIBUTE).

Synopsis

Declared in <openssl/x509.h>

stack_st_X509_ATTRIBUTE*
X509at_add1_attr_by_txt(
    stack_st_X509_ATTRIBUTE** x,
    char const* attrname,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

The (possibly newly allocated) attribute stack, or NULL on error.

Parameters

NameDescription
xAddress of the attribute stack pointer; allocated if NULL.
attrnameAttribute name (SN/LN) used to resolve the OID.
typeASN.1 type of the attribute data.
bytesAttribute value bytes.
lenLength of bytes.