1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5*b077aed3SPierre ProncheryCMS_ReceiptRequest_create0_ex, CMS_ReceiptRequest_create0, 6*b077aed3SPierre ProncheryCMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, CMS_ReceiptRequest_get0_values 7*b077aed3SPierre Pronchery- CMS signed receipt request functions 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim=head1 SYNOPSIS 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim #include <openssl/cms.h> 12e71b7053SJung-uk Kim 13*b077aed3SPierre Pronchery CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex( 14*b077aed3SPierre Pronchery unsigned char *id, int idlen, int allorfirst, 15*b077aed3SPierre Pronchery STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo, 16*b077aed3SPierre Pronchery OSSL_LIB_CTX *libctx); 17*b077aed3SPierre Pronchery CMS_ReceiptRequest *CMS_ReceiptRequest_create0( 18*b077aed3SPierre Pronchery unsigned char *id, int idlen, int allorfirst, 19*b077aed3SPierre Pronchery STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo); 20e71b7053SJung-uk Kim int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); 21e71b7053SJung-uk Kim int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); 22e71b7053SJung-uk Kim void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid, 23e71b7053SJung-uk Kim int *pallorfirst, 24e71b7053SJung-uk Kim STACK_OF(GENERAL_NAMES) **plist, 25e71b7053SJung-uk Kim STACK_OF(GENERAL_NAMES) **prto); 26e71b7053SJung-uk Kim 27e71b7053SJung-uk Kim=head1 DESCRIPTION 28e71b7053SJung-uk Kim 29*b077aed3SPierre ProncheryCMS_ReceiptRequest_create0_ex() creates a signed receipt request 30*b077aed3SPierre Proncherystructure. The B<signedContentIdentifier> field is set using I<id> and I<idlen>, 31*b077aed3SPierre Proncheryor it is set to 32 bytes of pseudo random data if I<id> is NULL. 32*b077aed3SPierre ProncheryIf I<receiptList> is NULL the allOrFirstTier option in I<receiptsFrom> is used 33*b077aed3SPierre Proncheryand set to the value of the I<allorfirst> parameter. If I<receiptList> is not 34*b077aed3SPierre ProncheryNULL the I<receiptList> option in I<receiptsFrom> is used. The I<receiptsTo> 35*b077aed3SPierre Proncheryparameter specifies the I<receiptsTo> field value. The library context I<libctx> 36*b077aed3SPierre Proncheryis used to find the public random generator. 37*b077aed3SPierre Pronchery 38*b077aed3SPierre ProncheryCMS_ReceiptRequest_create0() is similar to 39*b077aed3SPierre ProncheryCMS_ReceiptRequest_create0_ex() but uses default values of NULL for the 40*b077aed3SPierre Proncherylibrary context I<libctx>. 41e71b7053SJung-uk Kim 42e71b7053SJung-uk KimThe CMS_add1_ReceiptRequest() function adds a signed receipt request B<rr> 43e71b7053SJung-uk Kimto SignerInfo structure B<si>. 44e71b7053SJung-uk Kim 45e71b7053SJung-uk Kimint CMS_get1_ReceiptRequest() looks for a signed receipt request in B<si>, if 46e71b7053SJung-uk Kimany is found it is decoded and written to B<prr>. 47e71b7053SJung-uk Kim 48e71b7053SJung-uk KimCMS_ReceiptRequest_get0_values() retrieves the values of a receipt request. 49e71b7053SJung-uk KimThe signedContentIdentifier is copied to B<pcid>. If the B<allOrFirstTier> 50e71b7053SJung-uk Kimoption of B<receiptsFrom> is used its value is copied to B<pallorfirst> 51e71b7053SJung-uk Kimotherwise the B<receiptList> field is copied to B<plist>. The B<receiptsTo> 52e71b7053SJung-uk Kimparameter is copied to B<prto>. 53e71b7053SJung-uk Kim 54e71b7053SJung-uk Kim=head1 NOTES 55e71b7053SJung-uk Kim 56e71b7053SJung-uk KimFor more details of the meaning of the fields see RFC2634. 57e71b7053SJung-uk Kim 58e71b7053SJung-uk KimThe contents of a signed receipt should only be considered meaningful if the 59e71b7053SJung-uk Kimcorresponding CMS_ContentInfo structure can be successfully verified using 60e71b7053SJung-uk KimCMS_verify(). 61e71b7053SJung-uk Kim 62e71b7053SJung-uk Kim=head1 RETURN VALUES 63e71b7053SJung-uk Kim 64*b077aed3SPierre ProncheryCMS_ReceiptRequest_create0_ex() and CMS_ReceiptRequest_create0() return 65*b077aed3SPierre Proncherya signed receipt request structure or NULL if an error occurred. 66e71b7053SJung-uk Kim 67e71b7053SJung-uk KimCMS_add1_ReceiptRequest() returns 1 for success or 0 if an error occurred. 68e71b7053SJung-uk Kim 69e71b7053SJung-uk KimCMS_get1_ReceiptRequest() returns 1 is a signed receipt request is found and 70e71b7053SJung-uk Kimdecoded. It returns 0 if a signed receipt request is not present and -1 if 71e71b7053SJung-uk Kimit is present but malformed. 72e71b7053SJung-uk Kim 73e71b7053SJung-uk Kim=head1 SEE ALSO 74e71b7053SJung-uk Kim 75e71b7053SJung-uk KimL<ERR_get_error(3)>, L<CMS_sign(3)>, 76e71b7053SJung-uk KimL<CMS_sign_receipt(3)>, L<CMS_verify(3)> 77e71b7053SJung-uk KimL<CMS_verify_receipt(3)> 78e71b7053SJung-uk Kim 79*b077aed3SPierre Pronchery=head1 HISTORY 80*b077aed3SPierre Pronchery 81*b077aed3SPierre ProncheryThe function CMS_ReceiptRequest_create0_ex() was added in OpenSSL 3.0. 82*b077aed3SPierre Pronchery 83e71b7053SJung-uk Kim=head1 COPYRIGHT 84e71b7053SJung-uk Kim 85*b077aed3SPierre ProncheryCopyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved. 86e71b7053SJung-uk Kim 87*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 88e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 89e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 90e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 91e71b7053SJung-uk Kim 92e71b7053SJung-uk Kim=cut 93