PKCS12_add1_attr_by_NID

Add a PKCS#12 attribute to a safeBag by NID.

Synopsis

Declared in <openssl/pkcs12.h>

int
PKCS12_add1_attr_by_NID(
    PKCS12_SAFEBAG* bag,
    int nid,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

1 on success, 0 on failure.

Parameters

NameDescription
bagSafeBag to modify.
nidNID of the attribute type.
typeASN.1 type of the attribute value.
bytesAttribute value octets.
lenLength of bytes.