CMS_get0_SignerInfos.pod 2.9 KB

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