PKCS8_pkey_add1_attr_by_OBJ

Append an attribute identified by obj to a PKCS#8 private key info.

Synopsis

Declared in <openssl/x509.h>

int
PKCS8_pkey_add1_attr_by_OBJ(
    PKCS8_PRIV_KEY_INFO* p8,
    ASN1_OBJECT const* obj,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
p8PKCS#8 structure receiving the attribute.
objAttribute type OID.
typeASN.1 string/value type for bytes (V_ASN1_*).
bytesAttribute value bytes.
lenLength of bytes, or -1 if bytes is NUL-terminated where applicable.