PKCS12_add1_attr_by_txt

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

Synopsis

Declared in <openssl/pkcs12.h>

int
PKCS12_add1_attr_by_txt(
    PKCS12_SAFEBAG* bag,
    char const* attrname,
    int type,
    unsigned char const* bytes,
    int len);

Return Value

1 on success, 0 on failure.

Parameters

NameDescription
bagSafeBag to modify.
attrnameShort name or OID of the attribute type.
typeASN.1 type of the attribute value.
bytesAttribute value octets.
lenLength of bytes.