1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos CMS_SignerInfo_set1_signer_cert, 6 1.1 christos CMS_get0_SignerInfos, CMS_SignerInfo_get0_signer_id, 7 1.1 christos CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp 8 1.1 christos - CMS signedData signer functions 9 1.1 christos 10 1.1 christos =head1 SYNOPSIS 11 1.1 christos 12 1.1 christos #include <openssl/cms.h> 13 1.1 christos 14 1.1 christos STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); 15 1.1 christos 16 1.1 christos int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, 17 1.1 christos X509_NAME **issuer, ASN1_INTEGER **sno); 18 1.1 christos ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); 19 1.1 christos int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); 20 1.1 christos void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); 21 1.1 christos 22 1.1 christos =head1 DESCRIPTION 23 1.1 christos 24 1.1 christos The function CMS_get0_SignerInfos() returns all the CMS_SignerInfo structures 25 1.1 christos associated with a CMS signedData structure. 26 1.1 christos 27 1.1 christos CMS_SignerInfo_get0_signer_id() retrieves the certificate signer identifier 28 1.1 christos associated with a specific CMS_SignerInfo structure B<si>. Either the 29 1.1 christos keyidentifier will be set in B<keyid> or B<both> issuer name and serial number 30 1.1 christos in B<issuer> and B<sno>. 31 1.1 christos 32 1.1 christos CMS_SignerInfo_get0_signature() retrieves the signature associated with 33 1.1 christos B<si> in a pointer to an ASN1_OCTET_STRING structure. This pointer returned 34 1.1 christos corresponds to the internal signature value if B<si> so it may be read or 35 1.1 christos modified. 36 1.1 christos 37 1.1 christos CMS_SignerInfo_cert_cmp() compares the certificate B<cert> against the signer 38 1.1 christos identifier B<si>. It returns zero if the comparison is successful and non zero 39 1.1 christos if not. 40 1.1 christos 41 1.1 christos CMS_SignerInfo_set1_signer_cert() sets the signers certificate of B<si> to 42 1.1 christos B<signer>. 43 1.1 christos 44 1.1 christos =head1 NOTES 45 1.1 christos 46 1.1 christos The main purpose of these functions is to enable an application to lookup 47 1.1 christos signers certificates using any appropriate technique when the simpler method 48 1.1 christos of CMS_verify() is not appropriate. 49 1.1 christos 50 1.1 christos In typical usage and application will retrieve all CMS_SignerInfo structures 51 1.1 christos using CMS_get0_SignerInfo() and retrieve the identifier information using 52 1.1 christos CMS. It will then obtain the signer certificate by some unspecified means 53 1.1 christos (or return and error if it cannot be found) and set it using 54 1.1 christos CMS_SignerInfo_set1_signer_cert(). 55 1.1 christos 56 1.1 christos Once all signer certificates have been set CMS_verify() can be used. 57 1.1 christos 58 1.1 christos Although CMS_get0_SignerInfos() can return NULL if an error occurs B<or> if 59 1.1 christos there are no signers this is not a problem in practice because the only 60 1.1 christos error which can occur is if the B<cms> structure is not of type signedData 61 1.1 christos due to application error. 62 1.1 christos 63 1.1 christos =head1 RETURN VALUES 64 1.1 christos 65 1.1 christos CMS_get0_SignerInfos() returns all CMS_SignerInfo structures, or NULL there 66 1.1 christos are no signers or an error occurs. 67 1.1 christos 68 1.1 christos CMS_SignerInfo_get0_signer_id() returns 1 for success and 0 for failure. 69 1.1 christos 70 1.1 christos CMS_SignerInfo_cert_cmp() returns 0 for a successful comparison and non 71 1.1 christos zero otherwise. 72 1.1 christos 73 1.1 christos CMS_SignerInfo_set1_signer_cert() does not return a value. 74 1.1 christos 75 1.1 christos Any error can be obtained from L<ERR_get_error(3)> 76 1.1 christos 77 1.1 christos =head1 SEE ALSO 78 1.1 christos 79 1.1 christos L<ERR_get_error(3)>, L<CMS_verify(3)> 80 1.1 christos 81 1.1 christos =head1 COPYRIGHT 82 1.1 christos 83 1.1 christos Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. 84 1.1 christos 85 1.1.1.2 christos Licensed under the Apache License 2.0 (the "License"). You may not use 86 1.1 christos this file except in compliance with the License. You can obtain a copy 87 1.1 christos in the file LICENSE in the source distribution or at 88 1.1 christos L<https://www.openssl.org/source/license.html>. 89 1.1 christos 90 1.1 christos =cut 91