CMS_add0_cert.pod 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls
  4. - CMS certificate and CRL utility functions
  5. =head1 SYNOPSIS
  6. #include <openssl/cms.h>
  7. int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
  8. int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
  9. STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
  10. int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  11. int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  12. STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
  13. =head1 DESCRIPTION
  14. CMS_add0_cert() and CMS_add1_cert() add certificate B<cert> to B<cms>.
  15. must be of type signed data or enveloped data.
  16. CMS_get1_certs() returns all certificates in B<cms>.
  17. CMS_add0_crl() and CMS_add1_crl() add CRL B<crl> to B<cms>. CMS_get1_crls()
  18. returns any CRLs in B<cms>.
  19. =head1 NOTES
  20. The CMS_ContentInfo structure B<cms> must be of type signed data or enveloped
  21. data or an error will be returned.
  22. For signed data certificates and CRLs are added to the B<certificates> and
  23. B<crls> fields of SignedData structure. For enveloped data they are added to
  24. B<OriginatorInfo>.
  25. As the B<0> implies CMS_add0_cert() adds B<cert> internally to B<cms> and it
  26. must not be freed up after the call as opposed to CMS_add1_cert() where B<cert>
  27. must be freed up.
  28. The same certificate or CRL must not be added to the same cms structure more
  29. than once.
  30. =head1 RETURN VALUES
  31. CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
  32. 1 for success and 0 for failure.
  33. CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
  34. or NULL if there are none or an error occurs. The only error which will occur
  35. in practice is if the B<cms> type is invalid.
  36. =head1 SEE ALSO
  37. L<ERR_get_error(3)>,
  38. L<CMS_sign(3)>,
  39. L<CMS_encrypt(3)>
  40. =head1 COPYRIGHT
  41. Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.
  42. Licensed under the Apache License 2.0 (the "License"). You may not use
  43. this file except in compliance with the License. You can obtain a copy
  44. in the file LICENSE in the source distribution or at
  45. L<https://www.openssl.org/source/license.html>.
  46. =cut