1CMS_add1_recipient_cert(3) OpenSSL CMS_add1_recipient_cert(3)
2
3
4
6 CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure
7
9 #include <openssl/cms.h>
10
11 CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags);
12
13 CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, size_t keylen, unsigned char *id, size_t idlen, ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType);
14
16 CMS_add1_recipient_cert() adds recipient recip to CMS_ContentInfo
17 enveloped data structure cms as a KeyTransRecipientInfo structure.
18
19 CMS_add0_recipient_key() adds symmetric key key of length keylen using
20 wrapping algorithm nid, identifier id of length idlen and optional
21 values date, otherTypeId and otherType to CMS_ContentInfo enveloped
22 data structure cms as a KEKRecipientInfo structure.
23
24 The CMS_ContentInfo structure should be obtained from an initial call
25 to CMS_encrypt() with the flag CMS_PARTIAL set.
26
28 The main purpose of this function is to provide finer control over a
29 CMS enveloped data structure where the simpler CMS_encrypt() function
30 defaults are not appropriate. For example if one or more
31 KEKRecipientInfo structures need to be added. New attributes can also
32 be added using the returned CMS_RecipientInfo structure and the CMS
33 attribute utility functions.
34
35 OpenSSL will by default identify recipient certificates using issuer
36 name and serial number. If CMS_USE_KEYID is set it will use the subject
37 key identifier value instead. An error occurs if all recipient
38 certificates do not have a subject key identifier extension.
39
40 Currently only AES based key wrapping algorithms are supported for nid,
41 specifically: NID_id_aes128_wrap, NID_id_aes192_wrap and
42 NID_id_aes256_wrap. If nid is set to NID_undef then an AES wrap
43 algorithm will be used consistent with keylen.
44
46 CMS_add1_recipient_cert() and CMS_add0_recipient_key() return an
47 internal pointer to the CMS_RecipientInfo structure just added or NULL
48 if an error occurs.
49
51 ERR_get_error(3), CMS_decrypt(3), CMS_final(3),
52
54 CMS_add1_recipient_cert() and CMS_add0_recipient_key() were added to
55 OpenSSL 0.9.8
56
57
58
591.0.2o 2019-09-10 CMS_add1_recipient_cert(3)