xref: /freebsd-src/crypto/openssl/doc/man3/PKCS12_add1_attr_by_NID.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre ProncheryPKCS12_add1_attr_by_NID, PKCS12_add1_attr_by_txt - Add an attribute to a PKCS#12
6*b077aed3SPierre ProncherysafeBag structure
7*b077aed3SPierre Pronchery
8*b077aed3SPierre Pronchery=head1 SYNOPSIS
9*b077aed3SPierre Pronchery
10*b077aed3SPierre Pronchery #include <openssl/pkcs12.h>
11*b077aed3SPierre Pronchery
12*b077aed3SPierre Pronchery int PKCS12_add1_attr_by_NID(PKCS12_SAFEBAG *bag, int nid, int type,
13*b077aed3SPierre Pronchery                             const unsigned char *bytes, int len);
14*b077aed3SPierre Pronchery int PKCS12_add1_attr_by_txt(PKCS12_SAFEBAG *bag, const char *attrname, int type,
15*b077aed3SPierre Pronchery                             const unsigned char *bytes, int len);
16*b077aed3SPierre Pronchery
17*b077aed3SPierre Pronchery=head1 DESCRIPTION
18*b077aed3SPierre Pronchery
19*b077aed3SPierre ProncheryThese functions add a PKCS#12 Attribute to the Attribute Set of the B<bag>.
20*b077aed3SPierre Pronchery
21*b077aed3SPierre ProncheryPKCS12_add1_attr_by_NID() adds an attribute of type B<nid> with a value of ASN1
22*b077aed3SPierre Proncherytype B<type> constructed using B<len> bytes from B<bytes>.
23*b077aed3SPierre Pronchery
24*b077aed3SPierre ProncheryPKCS12_add1_attr_by_txt() adds an attribute of type B<attrname> with a value of
25*b077aed3SPierre ProncheryASN1 type B<type> constructed using B<len> bytes from B<bytes>.
26*b077aed3SPierre Pronchery
27*b077aed3SPierre Pronchery=head1 NOTES
28*b077aed3SPierre Pronchery
29*b077aed3SPierre ProncheryThese functions do not check whether an existing attribute of the same type is
30*b077aed3SPierre Proncherypresent. There can be multiple attributes with the same type assigned to a
31*b077aed3SPierre ProncherysafeBag.
32*b077aed3SPierre Pronchery
33*b077aed3SPierre ProncheryBoth functions were added in OpenSSL 3.0.
34*b077aed3SPierre Pronchery
35*b077aed3SPierre Pronchery=head1 RETURN VALUES
36*b077aed3SPierre Pronchery
37*b077aed3SPierre ProncheryA return value of 1 indicates success, 0 indicates failure.
38*b077aed3SPierre Pronchery
39*b077aed3SPierre Pronchery=head1 SEE ALSO
40*b077aed3SPierre Pronchery
41*b077aed3SPierre ProncheryL<PKCS12_create(3)>
42*b077aed3SPierre Pronchery
43*b077aed3SPierre Pronchery=head1 COPYRIGHT
44*b077aed3SPierre Pronchery
45*b077aed3SPierre ProncheryCopyright 2020 The OpenSSL Project Authors. All Rights Reserved.
46*b077aed3SPierre Pronchery
47*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
48*b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
49*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
50*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
51*b077aed3SPierre Pronchery
52*b077aed3SPierre Pronchery=cut
53