Signed receipt request function documentation.
[openssl.git] / doc / crypto / CMS_add1_recipient_cert.pod
1 =pod
2
3 =head1 NAME
4
5  CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure
6
7 =head1 SYNOPSIS
8
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
15 =head1 DESCRIPTION
16
17 CMS_add1_recipient_cert() adds a recipient certificate B<recip> 
18 CMS_ContentInfo enveloped data structure B<cms> as a KeyTransRecipientInfo
19 structure.
20
21 CMS_add0_recipient_key() adds symmetric key B<key> of length B<keylen> using
22 wrapping algorithm B<nid>, identifier B<id> or length B<idlen> and optional
23 values B<date>, B<otherTypeId> abd B<otherType> to CMS_ContentInfo enveloped
24 data structure B<cms> as a KEKRecipientInfo structure.
25
26 The CMS_ContentInfo structure should be obtained from an initial call to
27 CMS_encrypt() with the flag B<CMS_PARTIAL> set.
28
29 =head1 NOTES
30
31 The main purpose of this function is to provide finer control over a CMS
32 enveloped data structure where the simpler CMS_encrypt() function defaults are
33 not appropriate. For example if one or more KEKRecipientInfo structures
34 need to be added. New attributes can also be added using the returned
35 CMS_RecipientInfo structure and the CMS attribute utility functions.
36
37 OpenSSL will by default identify recipient certificates using issuer name
38 and serial number. If B<CMS_USE_KEYID> is set it will use the subject key
39 identifier value instead. An error occurs if all recipient certificates do not
40 have a subject key identifier extension.
41
42 Currently only AES based key wrapping algorithms are supported for B<nid>,
43 specifically: NID_id_aes128_wrap, NID_id_aes192_wrap and NID_id_aes256_wrap.
44 If B<nid> is set to B<NID_undef> then an AES wrap algorithm will be used
45 consistent with B<keylen>.
46
47 =head1 RETURN VALUES
48
49 CMS_add1_recipient_cert() and CMS_add0_recipient_key() return an internal
50 pointer to the CMS_RecipientInfo structure just added or NULL if an error
51 occurs.
52
53 =head1 SEE ALSO
54
55 L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_decrypt(3)|CMS_decrypt(3)>,
56 L<CMS_final(3)|CMS_final(3)>,
57
58 =head1 HISTORY
59
60 CMS_add1_recipient_cert() and CMS_add0_recipient_key() were added to OpenSSL
61 0.9.8
62
63 =cut