EVP_PKEY_add1_attr_by_NID

Append an attribute identified by NID to an EVP_PKEY's attribute set.

Synopsis

Declared in <openssl/x509.h>

int
EVP_PKEY_add1_attr_by_NID(
    EVP_PKEY* key,
    int nid,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
keyKey whose attributes are extended.
nidAttribute type NID.
typeASN.1 string/type code for bytes (for example V_ASN1_UTF8STRING).
bytesAttribute value bytes interpreted according to type.
lenLength of bytes in bytes.