xref: /freebsd-src/crypto/openssl/doc/man3/PKCS12_SAFEBAG_get0_attrs.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre ProncheryPKCS12_SAFEBAG_get0_attrs, PKCS12_get_attr_gen
6*b077aed3SPierre Pronchery- Retrieve attributes from a PKCS#12 safeBag
7*b077aed3SPierre Pronchery
8*b077aed3SPierre Pronchery=head1 SYNOPSIS
9*b077aed3SPierre Pronchery
10*b077aed3SPierre Pronchery #include <openssl/pkcs12.h>
11*b077aed3SPierre Pronchery
12*b077aed3SPierre Pronchery const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
13*b077aed3SPierre Pronchery
14*b077aed3SPierre Pronchery ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
15*b077aed3SPierre Pronchery                                int attr_nid);
16*b077aed3SPierre Pronchery
17*b077aed3SPierre Pronchery=head1 DESCRIPTION
18*b077aed3SPierre Pronchery
19*b077aed3SPierre ProncheryPKCS12_SAFEBAG_get0_attrs() retrieves the stack of B<X509_ATTRIBUTE>s from a
20*b077aed3SPierre ProncheryPKCS#12 safeBag. I<bag> is the B<PKCS12_SAFEBAG> to retrieve the attributes from.
21*b077aed3SPierre Pronchery
22*b077aed3SPierre ProncheryPKCS12_get_attr_gen() retrieves an attribute by NID from a stack of
23*b077aed3SPierre ProncheryB<X509_ATTRIBUTE>s. I<attr_nid> is the NID of the attribute to retrieve.
24*b077aed3SPierre Pronchery
25*b077aed3SPierre Pronchery=head1 RETURN VALUES
26*b077aed3SPierre Pronchery
27*b077aed3SPierre ProncheryPKCS12_SAFEBAG_get0_attrs() returns the stack of B<X509_ATTRIBUTE>s from a
28*b077aed3SPierre ProncheryPKCS#12 safeBag, which could be empty.
29*b077aed3SPierre Pronchery
30*b077aed3SPierre ProncheryPKCS12_get_attr_gen() returns an B<ASN1_TYPE> object containing the attribute,
31*b077aed3SPierre Proncheryor NULL if the attribute was either not present or an error occurred.
32*b077aed3SPierre Pronchery
33*b077aed3SPierre ProncheryPKCS12_get_attr_gen() does not allocate a new attribute. The returned attribute
34*b077aed3SPierre Proncheryis still owned by the B<PKCS12_SAFEBAG> in which it resides.
35*b077aed3SPierre Pronchery
36*b077aed3SPierre Pronchery=head1 SEE ALSO
37*b077aed3SPierre Pronchery
38*b077aed3SPierre ProncheryL<PKCS12_get_friendlyname(3)>,
39*b077aed3SPierre ProncheryL<PKCS12_add_friendlyname_asc(3)>
40*b077aed3SPierre Pronchery
41*b077aed3SPierre Pronchery=head1 COPYRIGHT
42*b077aed3SPierre Pronchery
43*b077aed3SPierre ProncheryCopyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
44*b077aed3SPierre Pronchery
45*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
46*b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
47*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
48*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
49*b077aed3SPierre Pronchery
50*b077aed3SPierre Pronchery=cut
51