From eb389a75c0e893a3a9951ddc804459713dbf5d3d Mon Sep 17 00:00:00 2001 From: Jon Spillett Date: Mon, 2 Sep 2019 14:51:05 +1000 Subject: [PATCH] Add missing docs for some PKCS12 functions Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/9752) --- doc/man3/PKCS12_SAFEBAG_get0_attrs.pod | 50 +++++++++++++++++++++++ doc/man3/PKCS12_add_CSPName_asc.pod | 36 ++++++++++++++++ doc/man3/PKCS12_add_friendlyname_asc.pod | 52 ++++++++++++++++++++++++ doc/man3/PKCS12_add_localkeyid.pod | 38 +++++++++++++++++ doc/man3/PKCS12_get_friendlyname.pod | 39 ++++++++++++++++++ 5 files changed, 215 insertions(+) create mode 100644 doc/man3/PKCS12_SAFEBAG_get0_attrs.pod create mode 100644 doc/man3/PKCS12_add_CSPName_asc.pod create mode 100644 doc/man3/PKCS12_add_friendlyname_asc.pod create mode 100644 doc/man3/PKCS12_add_localkeyid.pod create mode 100644 doc/man3/PKCS12_get_friendlyname.pod diff --git a/doc/man3/PKCS12_SAFEBAG_get0_attrs.pod b/doc/man3/PKCS12_SAFEBAG_get0_attrs.pod new file mode 100644 index 0000000000..9fd3b78699 --- /dev/null +++ b/doc/man3/PKCS12_SAFEBAG_get0_attrs.pod @@ -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 + + 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 Bs from a +PKCS#12 safeBag. I is the B to retrieve the attributes from. + +PKCS12_get_attr_gen() retrieves an attribute by NID from a stack of +Bs. I is the NID of the attribute to retrieve. + +=head1 RETURN VALUES + +PKCS12_SAFEBAG_get0_attrs() returns the stack of Bs from a +PKCS#12 safeBag, which could be empty. + +PKCS12_get_attr_gen() returns an B 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 in which it resides. + +=head1 SEE ALSO + +L, +L, +L + +=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. + +=cut diff --git a/doc/man3/PKCS12_add_CSPName_asc.pod b/doc/man3/PKCS12_add_CSPName_asc.pod new file mode 100644 index 0000000000..87d9e71302 --- /dev/null +++ b/doc/man3/PKCS12_add_CSPName_asc.pod @@ -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 + + 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 is the B to add the attribute to. + +=head1 RETURN VALUES + +Returns 1 for success or 0 for failure. + +=head1 SEE ALSO + +L + +=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. + +=cut diff --git a/doc/man3/PKCS12_add_friendlyname_asc.pod b/doc/man3/PKCS12_add_friendlyname_asc.pod new file mode 100644 index 0000000000..3920b5daa0 --- /dev/null +++ b/doc/man3/PKCS12_add_friendlyname_asc.pod @@ -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 + + 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 is the B to add the attribute to. + +=head1 RETURN VALUES + +Returns 1 for success or 0 for failure. + +=head1 SEE ALSO + +L + +=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. + +=cut diff --git a/doc/man3/PKCS12_add_localkeyid.pod b/doc/man3/PKCS12_add_localkeyid.pod new file mode 100644 index 0000000000..6d9ff9883e --- /dev/null +++ b/doc/man3/PKCS12_add_localkeyid.pod @@ -0,0 +1,38 @@ +=pod + +=head1 NAME + +PKCS12_add_localkeyid - Add the localKeyId attribute to a PKCS#12 safeBag + +=head1 SYNOPSIS + + #include + + 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 is the B to add the attribute to. + +=head1 RETURN VALUES + +Returns 1 for success or 0 for failure. + +=head1 SEE ALSO + +L + +=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. + +=cut diff --git a/doc/man3/PKCS12_get_friendlyname.pod b/doc/man3/PKCS12_get_friendlyname.pod new file mode 100644 index 0000000000..e96f7a255a --- /dev/null +++ b/doc/man3/PKCS12_get_friendlyname.pod @@ -0,0 +1,39 @@ +=pod + +=head1 NAME + +PKCS12_get_friendlyname - Retrieve the friendlyname attribute from a PKCS#12 safeBag + +=head1 SYNOPSIS + + #include + + 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 is the B 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 + +=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. + +=cut -- 2.34.1