Blame doc/man3/CMS_add1_recipient_cert.pod

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