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