1e1051a39Sopenharmony_ci=pod 2e1051a39Sopenharmony_ci 3e1051a39Sopenharmony_ci=head1 NAME 4e1051a39Sopenharmony_ci 5e1051a39Sopenharmony_ciCMS_EnvelopedData_create_ex, CMS_EnvelopedData_create, 6e1051a39Sopenharmony_ciCMS_AuthEnvelopedData_create, CMS_AuthEnvelopedData_create_ex 7e1051a39Sopenharmony_ci- Create CMS envelope 8e1051a39Sopenharmony_ci 9e1051a39Sopenharmony_ci=head1 SYNOPSIS 10e1051a39Sopenharmony_ci 11e1051a39Sopenharmony_ci #include <openssl/cms.h> 12e1051a39Sopenharmony_ci 13e1051a39Sopenharmony_ci CMS_ContentInfo * 14e1051a39Sopenharmony_ci CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx, 15e1051a39Sopenharmony_ci const char *propq); 16e1051a39Sopenharmony_ci CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); 17e1051a39Sopenharmony_ci 18e1051a39Sopenharmony_ci CMS_ContentInfo * 19e1051a39Sopenharmony_ci CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx, 20e1051a39Sopenharmony_ci const char *propq); 21e1051a39Sopenharmony_ci CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher); 22e1051a39Sopenharmony_ci 23e1051a39Sopenharmony_ci=head1 DESCRIPTION 24e1051a39Sopenharmony_ci 25e1051a39Sopenharmony_ciCMS_EnvelopedData_create_ex() creates a B<CMS_ContentInfo> structure 26e1051a39Sopenharmony_ciwith a type B<NID_pkcs7_enveloped>. I<cipher> is the symmetric cipher to use. 27e1051a39Sopenharmony_ciThe library context I<libctx> and the property query I<propq> are used when 28e1051a39Sopenharmony_ciretrieving algorithms from providers. 29e1051a39Sopenharmony_ci 30e1051a39Sopenharmony_ciCMS_AuthEnvelopedData_create_ex() creates a B<CMS_ContentInfo> 31e1051a39Sopenharmony_cistructure with a type B<NID_id_smime_ct_authEnvelopedData>. B<cipher> is the 32e1051a39Sopenharmony_cisymmetric AEAD cipher to use. Currently only AES variants with GCM mode are 33e1051a39Sopenharmony_cisupported. The library context I<libctx> and the property query I<propq> are 34e1051a39Sopenharmony_ciused when retrieving algorithms from providers. 35e1051a39Sopenharmony_ci 36e1051a39Sopenharmony_ciThe algorithm passed in the I<cipher> parameter must support ASN1 encoding of 37e1051a39Sopenharmony_ciits parameters. 38e1051a39Sopenharmony_ci 39e1051a39Sopenharmony_ciThe recipients can be added later using L<CMS_add1_recipient_cert(3)> or 40e1051a39Sopenharmony_ciL<CMS_add0_recipient_key(3)>. 41e1051a39Sopenharmony_ci 42e1051a39Sopenharmony_ciThe B<CMS_ContentInfo> structure needs to be finalized using L<CMS_final(3)> 43e1051a39Sopenharmony_ciand then freed using L<CMS_ContentInfo_free(3)>. 44e1051a39Sopenharmony_ci 45e1051a39Sopenharmony_ciCMS_EnvelopedData_create() and CMS_AuthEnvelopedData_create are similar to 46e1051a39Sopenharmony_ciCMS_EnvelopedData_create_ex() and 47e1051a39Sopenharmony_ciCMS_AuthEnvelopedData_create_ex() but use default values of NULL for 48e1051a39Sopenharmony_cithe library context I<libctx> and the property query I<propq>. 49e1051a39Sopenharmony_ci 50e1051a39Sopenharmony_ci=head1 NOTES 51e1051a39Sopenharmony_ci 52e1051a39Sopenharmony_ciAlthough CMS_EnvelopedData_create() and CMS_AuthEnvelopedData_create() allocate 53e1051a39Sopenharmony_cia new B<CMS_ContentInfo> structure, they are not usually used in applications. 54e1051a39Sopenharmony_ciThe wrappers L<CMS_encrypt(3)> and L<CMS_decrypt(3)> are often used instead. 55e1051a39Sopenharmony_ci 56e1051a39Sopenharmony_ci=head1 RETURN VALUES 57e1051a39Sopenharmony_ci 58e1051a39Sopenharmony_ciIf the allocation fails, CMS_EnvelopedData_create() and 59e1051a39Sopenharmony_ciCMS_AuthEnvelopedData_create() return NULL and set an error code that can be 60e1051a39Sopenharmony_ciobtained by L<ERR_get_error(3)>. Otherwise they return a pointer to the newly 61e1051a39Sopenharmony_ciallocated structure. 62e1051a39Sopenharmony_ci 63e1051a39Sopenharmony_ci=head1 SEE ALSO 64e1051a39Sopenharmony_ci 65e1051a39Sopenharmony_ciL<ERR_get_error(3)>, L<CMS_encrypt(3)>, L<CMS_decrypt(3)>, L<CMS_final(3)> 66e1051a39Sopenharmony_ci 67e1051a39Sopenharmony_ci=head1 HISTORY 68e1051a39Sopenharmony_ci 69e1051a39Sopenharmony_ciThe CMS_EnvelopedData_create_ex() method was added in OpenSSL 3.0. 70e1051a39Sopenharmony_ci 71e1051a39Sopenharmony_ci=head1 COPYRIGHT 72e1051a39Sopenharmony_ci 73e1051a39Sopenharmony_ciCopyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 74e1051a39Sopenharmony_ci 75e1051a39Sopenharmony_ciLicensed under the Apache License 2.0 (the "License"). You may not use 76e1051a39Sopenharmony_cithis file except in compliance with the License. You can obtain a copy 77e1051a39Sopenharmony_ciin the file LICENSE in the source distribution or at 78e1051a39Sopenharmony_ciL<https://www.openssl.org/source/license.html>. 79e1051a39Sopenharmony_ci 80e1051a39Sopenharmony_ci=cut 81