CMS_digest_create.pod 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. =pod
  2. =head1 NAME
  3. CMS_digest_create_ex, CMS_digest_create
  4. - Create CMS DigestedData object
  5. =head1 SYNOPSIS
  6. #include <openssl/cms.h>
  7. CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
  8. unsigned int flags, OSSL_LIB_CTX *ctx,
  9. const char *propq);
  10. CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
  11. unsigned int flags);
  12. =head1 DESCRIPTION
  13. CMS_digest_create_ex() creates a B<CMS_ContentInfo> structure
  14. with a type B<NID_pkcs7_digest>. The data supplied via the I<in> BIO is digested
  15. using I<md>. The library context I<libctx> and the property query I<propq> are
  16. used when retrieving algorithms from providers.
  17. The I<flags> field supports the B<CMS_DETACHED> and B<CMS_STREAM> flags,
  18. Internally CMS_final() is called unless B<CMS_STREAM> is specified.
  19. The B<CMS_ContentInfo> structure can be freed using L<CMS_ContentInfo_free(3)>.
  20. CMS_digest_create() is similar to CMS_digest_create_ex()
  21. but uses default values of NULL for the library context I<libctx> and the
  22. property query I<propq>.
  23. =head1 RETURN VALUES
  24. If the allocation fails, CMS_digest_create_ex() and CMS_digest_create()
  25. return NULL and set an error code that can be obtained by L<ERR_get_error(3)>.
  26. Otherwise they return a pointer to the newly allocated structure.
  27. =head1 SEE ALSO
  28. L<ERR_get_error(3)>, L<CMS_final(3)>>
  29. =head1 HISTORY
  30. The CMS_digest_create_ex() method was added in OpenSSL 3.0.
  31. =head1 COPYRIGHT
  32. Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
  33. Licensed under the Apache License 2.0 (the "License"). You may not use
  34. this file except in compliance with the License. You can obtain a copy
  35. in the file LICENSE in the source distribution or at
  36. L<https://www.openssl.org/source/license.html>.
  37. =cut