You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

50 lines
1.9 KiB

  1. /* Copyright (c) 2017, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #ifndef OPENSSL_HEADER_PKCS7_INTERNAL_H
  15. #define OPENSSL_HEADER_PKCS7_INTERNAL_H
  16. #include <openssl/base.h>
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. // pkcs7_parse_header reads the non-certificate/non-CRL prefix of a PKCS#7
  21. // SignedData blob from |cbs| and sets |*out| to point to the rest of the
  22. // input. If the input is in BER format, then |*der_bytes| will be set to a
  23. // pointer that needs to be freed by the caller once they have finished
  24. // processing |*out| (which will be pointing into |*der_bytes|).
  25. //
  26. // It returns one on success or zero on error. On error, |*der_bytes| is
  27. // NULL.
  28. int pkcs7_parse_header(uint8_t **der_bytes, CBS *out, CBS *cbs);
  29. // pkcs7_bundle writes a PKCS#7, SignedData structure to |out| and then calls
  30. // |cb| with a CBB to which certificate or CRL data can be written, and the
  31. // opaque context pointer, |arg|. The callback can return zero to indicate an
  32. // error.
  33. //
  34. // pkcs7_bundle returns one on success or zero on error.
  35. int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg),
  36. const void *arg);
  37. #if defined(__cplusplus)
  38. } // extern C
  39. #endif
  40. #endif // OPENSSL_HEADER_PKCS7_INTERNAL_H