1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos PKCS12_pack_p7encdata, PKCS12_pack_p7encdata_ex - Pack a set of PKCS#12 safeBags 6 1.1 christos into a PKCS#7 encrypted data object 7 1.1 christos 8 1.1 christos =head1 SYNOPSIS 9 1.1 christos 10 1.1 christos #include <openssl/pkcs12.h> 11 1.1 christos 12 1.1 christos PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, 13 1.1 christos unsigned char *salt, int saltlen, int iter, 14 1.1 christos STACK_OF(PKCS12_SAFEBAG) *bags); 15 1.1 christos PKCS7 *PKCS12_pack_p7encdata_ex(int pbe_nid, const char *pass, int passlen, 16 1.1 christos unsigned char *salt, int saltlen, int iter, 17 1.1 christos STACK_OF(PKCS12_SAFEBAG) *bags, 18 1.1 christos OSSL_LIB_CTX *ctx, const char *propq); 19 1.1 christos 20 1.1 christos =head1 DESCRIPTION 21 1.1 christos 22 1.1 christos PKCS12_pack_p7encdata() generates a PKCS#7 ContentInfo object of encrypted-data 23 1.1 christos type from the set of safeBags I<bags>. The algorithm ID in I<pbe_nid> can be 24 1.1 christos a PKCS#12 or PKCS#5 password based encryption algorithm, or a cipher algorithm. 25 1.1 christos If a cipher algorithm is passed, the PKCS#5 PBES2 algorithm will be used with 26 1.1 christos this cipher as a parameter. 27 1.1 christos The password I<pass> of length I<passlen>, salt I<salt> of length I<saltlen> 28 1.1 christos and iteration count I<iter> are inputs into the encryption operation. 29 1.1 christos 30 1.1 christos PKCS12_pack_p7encdata_ex() operates similar to the above but allows for a 31 1.1 christos library context I<ctx> and property query I<propq> to be used to select the 32 1.1 christos algorithm implementation. 33 1.1 christos 34 1.1 christos =head1 RETURN VALUES 35 1.1 christos 36 1.1 christos A B<PKCS7> object if successful, or NULL if an error occurred. 37 1.1 christos 38 1.1 christos =head1 CONFORMING TO 39 1.1 christos 40 1.1 christos IETF RFC 2315 (L<https://tools.ietf.org/html/rfc2315>) 41 1.1 christos 42 1.1 christos =head1 SEE ALSO 43 1.1 christos 44 1.1 christos L<PKCS12_pbe_crypt_ex(3)> 45 1.1 christos 46 1.1 christos =head1 HISTORY 47 1.1 christos 48 1.1 christos PKCS12_pack_p7encdata_ex() was added in OpenSSL 3.0. 49 1.1 christos 50 1.1 christos =head1 COPYRIGHT 51 1.1 christos 52 1.1 christos Copyright 2021 The OpenSSL Project Authors. All Rights Reserved. 53 1.1 christos 54 1.1 christos Licensed under the Apache License 2.0 (the "License"). You may not use 55 1.1 christos this file except in compliance with the License. You can obtain a copy 56 1.1 christos in the file LICENSE in the source distribution or at 57 1.1 christos L<https://www.openssl.org/source/license.html>. 58 1.1 christos 59 1.1 christos =cut 60