CMS_get0_SignerInfos.pod 3.1 KB

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