Add missing docs for some PKCS12 functions

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9752)
This commit is contained in:
Jon Spillett 2019-09-02 14:51:05 +10:00 committed by Tomas Mraz
parent 40fa9d9ef7
commit eb389a75c0
5 changed files with 215 additions and 0 deletions

View File

@ -0,0 +1,50 @@
=pod
=head1 NAME
PKCS12_SAFEBAG_get0_attrs, PKCS12_get_attr_gen - Retrieve attributes from a PKCS#12 safeBag
=head1 SYNOPSIS
#include <openssl/pkcs12.h>
const STACK_OF(X509_ATTRIBUTE) *PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
ASN1_TYPE *PKCS12_get_attr_gen(const STACK_OF(X509_ATTRIBUTE) *attrs,
int attr_nid)
=head1 DESCRIPTION
PKCS12_SAFEBAG_get0_attrs() retrieves the stack of B<X509_ATTRIBUTE>s from a
PKCS#12 safeBag. I<bag> is the B<PKCS12_SAFEBAG> to retrieve the attributes from.
PKCS12_get_attr_gen() retrieves an attribute by NID from a stack of
B<X509_ATTRIBUTE>s. I<attr_nid> is the NID of the attribute to retrieve.
=head1 RETURN VALUES
PKCS12_SAFEBAG_get0_attrs() returns the stack of B<X509_ATTRIBUTE>s from a
PKCS#12 safeBag, which could be empty.
PKCS12_get_attr_gen() returns an B<ASN1_TYPE> object containing the attribute,
or NULL if the attribute was either not present or an error occurred.
PKCS12_get_attr_gen() does not allocate a new attribute. The returned attribute
is still owned by the B<PKCS12_SAFEBAG> in which it resides.
=head1 SEE ALSO
L<PKCS12_get_friendlyname(3)>,
L<PKCS12_get_localkeyid(3)>,
L<PKCS12_add_friendlyname_asc(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut

View File

@ -0,0 +1,36 @@
=pod
=head1 NAME
PKCS12_add_CSPName_asc - Add a Microsoft CSP Name attribute to a PKCS#12 safeBag
=head1 SYNOPSIS
#include <openssl/pkcs12.h>
int PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name, int namelen);
=head1 DESCRIPTION
PKCS12_add_CSPName_asc() adds an ASCII string representation of the Microsoft CSP Name attribute to a PKCS#12 safeBag.
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
=head1 RETURN VALUES
Returns 1 for success or 0 for failure.
=head1 SEE ALSO
L<PKCS12_add_friendlyname_asc(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut

View File

@ -0,0 +1,52 @@
=pod
=head1 NAME
PKCS12_add_friendlyname_asc, PKCS12_add_friendlyname_utf8,
PKCS12_add_friendlyname_uni - Functions to add the friendlyname attribute to a
PKCS#12 safeBag
=head1 SYNOPSIS
#include <openssl/pkcs12.h>
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
int namelen);
int PKCS12_add_friendlyname_utf8(PKCS12_SAFEBAG *bag, const char *name,
int namelen);
int PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,
const unsigned char *name, int namelen);
=head1 DESCRIPTION
PKCS12_add_friendlyname_asc() adds an ASCII string representation of the PKCS#9
friendlyName attribute to a PKCS#12 safeBag.
PKCS12_add_friendlyname_utf8() adds a UTF-8 string representation of the PKCS#9
friendlyName attribute to a PKCS#12 safeBag.
PKCS12_add_friendlyname_uni() adds a Unicode string representation of the PKCS#9
friendlyName attribute to a PKCS#12 safeBag.
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
=head1 RETURN VALUES
Returns 1 for success or 0 for failure.
=head1 SEE ALSO
L<PKCS12_get_friendlyname(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut

View File

@ -0,0 +1,38 @@
=pod
=head1 NAME
PKCS12_add_localkeyid - Add the localKeyId attribute to a PKCS#12 safeBag
=head1 SYNOPSIS
#include <openssl/pkcs12.h>
int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const char *name,
int namelen);
=head1 DESCRIPTION
PKCS12_add_localkeyid() adds an octet string representation of the PKCS#9
localKeyId attribute to a PKCS#12 safeBag.
I<bag> is the B<PKCS12_SAFEBAG> to add the attribute to.
=head1 RETURN VALUES
Returns 1 for success or 0 for failure.
=head1 SEE ALSO
L<PKCS12_add_friendlyname_asc(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut

View File

@ -0,0 +1,39 @@
=pod
=head1 NAME
PKCS12_get_friendlyname - Retrieve the friendlyname attribute from a PKCS#12 safeBag
=head1 SYNOPSIS
#include <openssl/pkcs12.h>
char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);
=head1 DESCRIPTION
PKCS12_get_friendlyname() retrieves a UTF-8 string representation of the PKCS#9
friendlyName attribute for a PKCS#12 safeBag item.
I<bag> is the B<PKCS12_SAFEBAG> to retrieve the attribute from.
=head1 RETURN VALUES
A UTF-8 string, or NULL if the attribute was either not present or an error occurred.
The returned string is allocated by OpenSSL and should be freed by the user.
=head1 SEE ALSO
L<PKCS12_add_friendlyname_asc(3)>
=head1 COPYRIGHT
Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut