xref: /freebsd/crypto/openssl/doc/man3/CMS_data_create.pod (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre Pronchery=pod
2*b077aed3SPierre Pronchery
3*b077aed3SPierre Pronchery=head1 NAME
4*b077aed3SPierre Pronchery
5*b077aed3SPierre ProncheryCMS_data_create_ex, CMS_data_create
6*b077aed3SPierre Pronchery- Create CMS Data object
7*b077aed3SPierre Pronchery
8*b077aed3SPierre Pronchery=head1 SYNOPSIS
9*b077aed3SPierre Pronchery
10*b077aed3SPierre Pronchery #include <openssl/cms.h>
11*b077aed3SPierre Pronchery
12*b077aed3SPierre Pronchery CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
13*b077aed3SPierre Pronchery                                     OSSL_LIB_CTX *libctx, const char *propq);
14*b077aed3SPierre Pronchery CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
15*b077aed3SPierre Pronchery
16*b077aed3SPierre Pronchery=head1 DESCRIPTION
17*b077aed3SPierre Pronchery
18*b077aed3SPierre ProncheryCMS_data_create_ex() creates a B<CMS_ContentInfo> structure
19*b077aed3SPierre Proncherywith a type B<NID_pkcs7_data>. The data is supplied via the I<in> BIO.
20*b077aed3SPierre ProncheryThe library context I<libctx> and the property query I<propq> are used when
21*b077aed3SPierre Proncheryretrieving algorithms from providers. The I<flags> field supports the
22*b077aed3SPierre ProncheryB<CMS_STREAM> flag. Internally CMS_final() is called unless B<CMS_STREAM> is
23*b077aed3SPierre Proncheryspecified.
24*b077aed3SPierre Pronchery
25*b077aed3SPierre ProncheryThe B<CMS_ContentInfo> structure can be freed using L<CMS_ContentInfo_free(3)>.
26*b077aed3SPierre Pronchery
27*b077aed3SPierre ProncheryCMS_data_create() is similar to CMS_data_create_ex()
28*b077aed3SPierre Proncherybut uses default values of NULL for the library context I<libctx> and the
29*b077aed3SPierre Proncheryproperty query I<propq>.
30*b077aed3SPierre Pronchery
31*b077aed3SPierre Pronchery=head1 RETURN VALUES
32*b077aed3SPierre Pronchery
33*b077aed3SPierre ProncheryIf the allocation fails, CMS_data_create_ex() and CMS_data_create()
34*b077aed3SPierre Proncheryreturn NULL and set an error code that can be obtained by L<ERR_get_error(3)>.
35*b077aed3SPierre ProncheryOtherwise they return a pointer to the newly allocated structure.
36*b077aed3SPierre Pronchery
37*b077aed3SPierre Pronchery=head1 SEE ALSO
38*b077aed3SPierre Pronchery
39*b077aed3SPierre ProncheryL<ERR_get_error(3)>, L<CMS_final(3)>
40*b077aed3SPierre Pronchery
41*b077aed3SPierre Pronchery=head1 HISTORY
42*b077aed3SPierre Pronchery
43*b077aed3SPierre ProncheryThe CMS_data_create_ex() method was added in OpenSSL 3.0.
44*b077aed3SPierre Pronchery
45*b077aed3SPierre Pronchery=head1 COPYRIGHT
46*b077aed3SPierre Pronchery
47*b077aed3SPierre ProncheryCopyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
48*b077aed3SPierre Pronchery
49*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
50*b077aed3SPierre Proncherythis file except in compliance with the License.  You can obtain a copy
51*b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at
52*b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>.
53*b077aed3SPierre Pronchery
54*b077aed3SPierre Pronchery=cut
55