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