EVP_PKEY_add1_attr_by_txt

Append an X509_ATTRIBUTE named by attrname to an EVP_PKEY attribute list.

Synopsis

Declared in <openssl/x509.h>

int
EVP_PKEY_add1_attr_by_txt(
    EVP_PKEY* key,
    char const* attrname,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

1 on success, or 0 on failure (including duplicate attributes).

Parameters

NameDescription
keyKey whose attribute stack is updated.
attrnameShort or long attribute name (see obj_mac.h SN_* / LN_*).
typeASN.1 value type for the attribute data (V_ASN1_*).
bytesAttribute value bytes.
lenLength of bytes, or -1 if bytes is a NUL-terminated string when applicable.