CMS_get0_SignerInfos.pod 3.1 KB

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