CMS_add0_cert.pod 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. =pod
  2. =head1 NAME
  3. CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls, - CMS certificate and CRL utility functions
  4. =head1 SYNOPSIS
  5. #include <openssl/cms.h>
  6. int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
  7. int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
  8. STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
  9. int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  10. int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  11. STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
  12. =head1 DESCRIPTION
  13. CMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
  14. must be of type signed data or enveloped data.
  15. CMS_get1_certs() returns all certificates in B<cms>.
  16. CMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
  17. returns any CRLs in B<cms>.
  18. =head1 NOTES
  19. The CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
  20. data or an error will be returned.
  21. For signed data certificates and CRLs are added to the B<certificates> and
  22. B<crls> fields of SignedData structure. For enveloped data they are added to
  23. B<OriginatorInfo>.
  24. As the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
  25. must not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
  26. must be freed up.
  27. The same certificate or CRL must not be added to the same cms structure more
  28. than once.
  29. =head1 RETURN VALUES
  30. CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
  31. 1 for success and 0 for failure.
  32. CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
  33. or NULL if there are none or an error occurs. The only error which will occur
  34. in practice is if the B<cms> type is invalid.
  35. =head1 SEE ALSO
  36. L<ERR_get_error(3)|ERR_get_error(3)>,
  37. L<CMS_sign(3)|CMS_sign(3)>,
  38. L<CMS_encrypt(3)|CMS_encrypt(3)>
  39. =head1 HISTORY
  40. CMS_add0_cert(), CMS_add1_cert(), CMS_get1_certs(), CMS_add0_crl()
  41. and CMS_get1_crls() were all first added to OpenSSL 0.9.8
  42. =cut