pkcs7.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* pkcs7.h
  2. *
  3. * Copyright (C) 2006-2020 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. /* pkcs7.h for openSSL */
  22. #ifndef WOLFSSL_PKCS7_H_
  23. #define WOLFSSL_PKCS7_H_
  24. #include <wolfssl/openssl/ssl.h>
  25. #include <wolfssl/wolfcrypt/pkcs7.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #if defined(OPENSSL_ALL) && defined(HAVE_PKCS7)
  30. #define PKCS7_NOINTERN 0x0010
  31. #define PKCS7_NOVERIFY 0x0020
  32. typedef struct WOLFSSL_PKCS7
  33. {
  34. PKCS7 pkcs7;
  35. unsigned char* data;
  36. int len;
  37. } WOLFSSL_PKCS7;
  38. WOLFSSL_API PKCS7* wolfSSL_PKCS7_new(void);
  39. WOLFSSL_API PKCS7_SIGNED* wolfSSL_PKCS7_SIGNED_new(void);
  40. WOLFSSL_API void wolfSSL_PKCS7_free(PKCS7* p7);
  41. WOLFSSL_API void wolfSSL_PKCS7_SIGNED_free(PKCS7_SIGNED* p7);
  42. WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7(PKCS7** p7, const unsigned char** in,
  43. int len);
  44. WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7);
  45. WOLFSSL_API int wolfSSL_PKCS7_verify(PKCS7* p7, WOLFSSL_STACK* certs,
  46. WOLFSSL_X509_STORE* store, WOLFSSL_BIO* in, WOLFSSL_BIO* out, int flags);
  47. WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_get0_signers(PKCS7* p7,
  48. WOLFSSL_STACK* certs, int flags);
  49. WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
  50. #define PKCS7_new wolfSSL_PKCS7_new
  51. #define PKCS7_SIGNED_new wolfSSL_PKCS7_SIGNED_new
  52. #define PKCS7_free wolfSSL_PKCS7_free
  53. #define PKCS7_SIGNED_free wolfSSL_PKCS7_SIGNED_free
  54. #define d2i_PKCS7 wolfSSL_d2i_PKCS7
  55. #define d2i_PKCS7_bio wolfSSL_d2i_PKCS7_bio
  56. #define PKCS7_verify wolfSSL_PKCS7_verify
  57. #define PKCS7_get0_signers wolfSSL_PKCS7_get0_signers
  58. #define PEM_write_bio_PKCS7 wolfSSL_PEM_write_bio_PKCS7
  59. #endif /* OPENSSL_ALL && HAVE_PKCS7 */
  60. #ifdef __cplusplus
  61. } /* extern "C" */
  62. #endif
  63. #endif /* WOLFSSL_PKCS7_H_ */