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