1PKCS12_ADD1_ATTR_BY_NID(3ossl)      OpenSSL     PKCS12_ADD1_ATTR_BY_NID(3ossl)
2
3
4

NAME

6       PKCS12_add1_attr_by_NID, PKCS12_add1_attr_by_txt - Add an attribute to
7       a PKCS#12 safeBag structure
8

SYNOPSIS

10        #include <openssl/pkcs12.h>
11
12        int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
13                                    const unsigned char *bytes, int len);
14        int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
15                                    const unsigned char *bytes, int len);
16

DESCRIPTION

18       These functions add a PKCS#12 Attribute to the Attribute Set of the
19       bag.
20
21       PKCS12_add1_attr_by_NID() adds an attribute of type nid with a value of
22       ASN1 type type constructed using len bytes from bytes.
23
24       PKCS12_add1_attr_by_txt() adds an attribute of type attrname with a
25       value of ASN1 type type constructed using len bytes from bytes.
26

NOTES

28       These functions do not check whether an existing attribute of the same
29       type is present. There can be multiple attributes with the same type
30       assigned to a safeBag.
31
32       Both functions were added in OpenSSL 3.0.
33

RETURN VALUES

35       A return value of 1 indicates success, 0 indicates failure.
36

SEE ALSO

38       PKCS12_create(3)
39
41       Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
42
43       Licensed under the Apache License 2.0 (the "License").  You may not use
44       this file except in compliance with the License.  You can obtain a copy
45       in the file LICENSE in the source distribution or at
46       <https://www.openssl.org/source/license.html>.
47
48
49
503.0.5                             2022-07-05    PKCS12_ADD1_ATTR_BY_NID(3ossl)
Impressum