2008-04-08 22:27:10 +00:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2016-05-20 12:11:46 +00:00
|
|
|
CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS enveloped data structure
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
|
|
|
#include <openssl/cms.h>
|
|
|
|
|
2017-01-20 18:58:49 +00:00
|
|
|
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
|
|
|
X509 *recip, unsigned int flags);
|
2008-04-08 22:27:10 +00:00
|
|
|
|
2017-01-20 18:58:49 +00:00
|
|
|
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);
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2008-04-10 23:28:25 +00:00
|
|
|
CMS_add1_recipient_cert() adds recipient B<recip> to CMS_ContentInfo enveloped
|
|
|
|
data structure B<cms> as a KeyTransRecipientInfo structure.
|
2008-04-08 22:27:10 +00:00
|
|
|
|
|
|
|
CMS_add0_recipient_key() adds symmetric key B<key> of length B<keylen> using
|
2008-04-10 23:28:25 +00:00
|
|
|
wrapping algorithm B<nid>, identifier B<id> of length B<idlen> and optional
|
2008-04-10 10:46:11 +00:00
|
|
|
values B<date>, B<otherTypeId> and B<otherType> to CMS_ContentInfo enveloped
|
2008-04-08 22:27:10 +00:00
|
|
|
data structure B<cms> as a KEKRecipientInfo structure.
|
|
|
|
|
|
|
|
The CMS_ContentInfo structure should be obtained from an initial call to
|
|
|
|
CMS_encrypt() with the flag B<CMS_PARTIAL> set.
|
|
|
|
|
|
|
|
=head1 NOTES
|
|
|
|
|
|
|
|
The main purpose of this function is to provide finer control over a CMS
|
|
|
|
enveloped data structure where the simpler CMS_encrypt() function defaults are
|
|
|
|
not appropriate. For example if one or more KEKRecipientInfo structures
|
|
|
|
need to be added. New attributes can also be added using the returned
|
|
|
|
CMS_RecipientInfo structure and the CMS attribute utility functions.
|
|
|
|
|
|
|
|
OpenSSL will by default identify recipient certificates using issuer name
|
|
|
|
and serial number. If B<CMS_USE_KEYID> is set it will use the subject key
|
|
|
|
identifier value instead. An error occurs if all recipient certificates do not
|
|
|
|
have a subject key identifier extension.
|
|
|
|
|
|
|
|
Currently only AES based key wrapping algorithms are supported for B<nid>,
|
|
|
|
specifically: NID_id_aes128_wrap, NID_id_aes192_wrap and NID_id_aes256_wrap.
|
|
|
|
If B<nid> is set to B<NID_undef> then an AES wrap algorithm will be used
|
|
|
|
consistent with B<keylen>.
|
|
|
|
|
|
|
|
=head1 RETURN VALUES
|
|
|
|
|
|
|
|
CMS_add1_recipient_cert() and CMS_add0_recipient_key() return an internal
|
|
|
|
pointer to the CMS_RecipientInfo structure just added or NULL if an error
|
|
|
|
occurs.
|
|
|
|
|
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2015-08-17 19:21:33 +00:00
|
|
|
L<ERR_get_error(3)>, L<CMS_decrypt(3)>,
|
|
|
|
L<CMS_final(3)>,
|
2008-04-08 22:27:10 +00:00
|
|
|
|
2016-05-18 15:44:05 +00:00
|
|
|
=head1 COPYRIGHT
|
|
|
|
|
|
|
|
Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
|
2018-12-06 13:04:44 +00:00
|
|
|
Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 15:44:05 +00:00
|
|
|
this file except in compliance with the License. You can obtain a copy
|
|
|
|
in the file LICENSE in the source distribution or at
|
|
|
|
L<https://www.openssl.org/source/license.html>.
|
|
|
|
|
|
|
|
=cut
|