1CMS_ENVELOPEDDATA_CREATE(3ossl) OpenSSL CMS_ENVELOPEDDATA_CREATE(3ossl)
2
3
4
6 CMS_EnvelopedData_create_ex, CMS_EnvelopedData_create,
7 CMS_AuthEnvelopedData_create, CMS_AuthEnvelopedData_create_ex - Create
8 CMS envelope
9
11 #include <openssl/cms.h>
12
13 CMS_ContentInfo *
14 CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
15 const char *propq);
16 CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
17
18 CMS_ContentInfo *
19 CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
20 const char *propq);
21 CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
22
24 CMS_EnvelopedData_create_ex() creates a CMS_ContentInfo structure with
25 a type NID_pkcs7_enveloped. cipher is the symmetric cipher to use. The
26 library context libctx and the property query propq are used when
27 retrieving algorithms from providers.
28
29 CMS_AuthEnvelopedData_create_ex() creates a CMS_ContentInfo structure
30 with a type NID_id_smime_ct_authEnvelopedData. cipher is the symmetric
31 AEAD cipher to use. Currently only AES variants with GCM mode are
32 supported. The library context libctx and the property query propq are
33 used when retrieving algorithms from providers.
34
35 The algorithm passed in the cipher parameter must support ASN1 encoding
36 of its parameters.
37
38 The recipients can be added later using CMS_add1_recipient_cert(3) or
39 CMS_add0_recipient_key(3).
40
41 The CMS_ContentInfo structure needs to be finalized using CMS_final(3)
42 and then freed using CMS_ContentInfo_free(3).
43
44 CMS_EnvelopedData_create() and CMS_AuthEnvelopedData_create are
45 similar to CMS_EnvelopedData_create_ex() and
46 CMS_AuthEnvelopedData_create_ex() but use default values of NULL for
47 the library context libctx and the property query propq.
48
50 Although CMS_EnvelopedData_create() and CMS_AuthEnvelopedData_create()
51 allocate a new CMS_ContentInfo structure, they are not usually used in
52 applications. The wrappers CMS_encrypt(3) and CMS_decrypt(3) are often
53 used instead.
54
56 If the allocation fails, CMS_EnvelopedData_create() and
57 CMS_AuthEnvelopedData_create() return NULL and set an error code that
58 can be obtained by ERR_get_error(3). Otherwise they return a pointer to
59 the newly allocated structure.
60
62 ERR_get_error(3), CMS_encrypt(3), CMS_decrypt(3), CMS_final(3)
63
65 The CMS_EnvelopedData_create_ex() method was added in OpenSSL 3.0.
66
68 Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
69
70 Licensed under the Apache License 2.0 (the "License"). You may not use
71 this file except in compliance with the License. You can obtain a copy
72 in the file LICENSE in the source distribution or at
73 <https://www.openssl.org/source/license.html>.
74
75
76
773.0.5 2022-11-01 CMS_ENVELOPEDDATA_CREATE(3ossl)