pkcs7.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. /*
  2. * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_PKCS7_H
  10. # define HEADER_PKCS7_H
  11. # include <openssl/asn1.h>
  12. # include <openssl/bio.h>
  13. # include <openssl/e_os2.h>
  14. # include <openssl/symhacks.h>
  15. # include <openssl/ossl_typ.h>
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /*-
  20. Encryption_ID DES-CBC
  21. Digest_ID MD5
  22. Digest_Encryption_ID rsaEncryption
  23. Key_Encryption_ID rsaEncryption
  24. */
  25. typedef struct pkcs7_issuer_and_serial_st {
  26. X509_NAME *issuer;
  27. ASN1_INTEGER *serial;
  28. } PKCS7_ISSUER_AND_SERIAL;
  29. typedef struct pkcs7_signer_info_st {
  30. ASN1_INTEGER *version; /* version 1 */
  31. PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
  32. X509_ALGOR *digest_alg;
  33. STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */
  34. X509_ALGOR *digest_enc_alg;
  35. ASN1_OCTET_STRING *enc_digest;
  36. STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */
  37. /* The private key to sign with */
  38. EVP_PKEY *pkey;
  39. } PKCS7_SIGNER_INFO;
  40. DEFINE_STACK_OF(PKCS7_SIGNER_INFO)
  41. typedef struct pkcs7_recip_info_st {
  42. ASN1_INTEGER *version; /* version 0 */
  43. PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;
  44. X509_ALGOR *key_enc_algor;
  45. ASN1_OCTET_STRING *enc_key;
  46. X509 *cert; /* get the pub-key from this */
  47. } PKCS7_RECIP_INFO;
  48. DEFINE_STACK_OF(PKCS7_RECIP_INFO)
  49. typedef struct pkcs7_signed_st {
  50. ASN1_INTEGER *version; /* version 1 */
  51. STACK_OF(X509_ALGOR) *md_algs; /* md used */
  52. STACK_OF(X509) *cert; /* [ 0 ] */
  53. STACK_OF(X509_CRL) *crl; /* [ 1 ] */
  54. STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
  55. struct pkcs7_st *contents;
  56. } PKCS7_SIGNED;
  57. /*
  58. * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about
  59. * merging the two
  60. */
  61. typedef struct pkcs7_enc_content_st {
  62. ASN1_OBJECT *content_type;
  63. X509_ALGOR *algorithm;
  64. ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
  65. const EVP_CIPHER *cipher;
  66. } PKCS7_ENC_CONTENT;
  67. typedef struct pkcs7_enveloped_st {
  68. ASN1_INTEGER *version; /* version 0 */
  69. STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
  70. PKCS7_ENC_CONTENT *enc_data;
  71. } PKCS7_ENVELOPE;
  72. typedef struct pkcs7_signedandenveloped_st {
  73. ASN1_INTEGER *version; /* version 1 */
  74. STACK_OF(X509_ALGOR) *md_algs; /* md used */
  75. STACK_OF(X509) *cert; /* [ 0 ] */
  76. STACK_OF(X509_CRL) *crl; /* [ 1 ] */
  77. STACK_OF(PKCS7_SIGNER_INFO) *signer_info;
  78. PKCS7_ENC_CONTENT *enc_data;
  79. STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;
  80. } PKCS7_SIGN_ENVELOPE;
  81. typedef struct pkcs7_digest_st {
  82. ASN1_INTEGER *version; /* version 0 */
  83. X509_ALGOR *md; /* md used */
  84. struct pkcs7_st *contents;
  85. ASN1_OCTET_STRING *digest;
  86. } PKCS7_DIGEST;
  87. typedef struct pkcs7_encrypted_st {
  88. ASN1_INTEGER *version; /* version 0 */
  89. PKCS7_ENC_CONTENT *enc_data;
  90. } PKCS7_ENCRYPT;
  91. typedef struct pkcs7_st {
  92. /*
  93. * The following is non NULL if it contains ASN1 encoding of this
  94. * structure
  95. */
  96. unsigned char *asn1;
  97. long length;
  98. # define PKCS7_S_HEADER 0
  99. # define PKCS7_S_BODY 1
  100. # define PKCS7_S_TAIL 2
  101. int state; /* used during processing */
  102. int detached;
  103. ASN1_OBJECT *type;
  104. /* content as defined by the type */
  105. /*
  106. * all encryption/message digests are applied to the 'contents', leaving
  107. * out the 'type' field.
  108. */
  109. union {
  110. char *ptr;
  111. /* NID_pkcs7_data */
  112. ASN1_OCTET_STRING *data;
  113. /* NID_pkcs7_signed */
  114. PKCS7_SIGNED *sign;
  115. /* NID_pkcs7_enveloped */
  116. PKCS7_ENVELOPE *enveloped;
  117. /* NID_pkcs7_signedAndEnveloped */
  118. PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
  119. /* NID_pkcs7_digest */
  120. PKCS7_DIGEST *digest;
  121. /* NID_pkcs7_encrypted */
  122. PKCS7_ENCRYPT *encrypted;
  123. /* Anything else */
  124. ASN1_TYPE *other;
  125. } d;
  126. } PKCS7;
  127. DEFINE_STACK_OF(PKCS7)
  128. # define PKCS7_OP_SET_DETACHED_SIGNATURE 1
  129. # define PKCS7_OP_GET_DETACHED_SIGNATURE 2
  130. # define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
  131. # define PKCS7_get_attributes(si) ((si)->unauth_attr)
  132. # define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
  133. # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
  134. # define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
  135. # define PKCS7_type_is_signedAndEnveloped(a) \
  136. (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
  137. # define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
  138. # define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
  139. # define PKCS7_set_detached(p,v) \
  140. PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
  141. # define PKCS7_get_detached(p) \
  142. PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
  143. # define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
  144. /* S/MIME related flags */
  145. # define PKCS7_TEXT 0x1
  146. # define PKCS7_NOCERTS 0x2
  147. # define PKCS7_NOSIGS 0x4
  148. # define PKCS7_NOCHAIN 0x8
  149. # define PKCS7_NOINTERN 0x10
  150. # define PKCS7_NOVERIFY 0x20
  151. # define PKCS7_DETACHED 0x40
  152. # define PKCS7_BINARY 0x80
  153. # define PKCS7_NOATTR 0x100
  154. # define PKCS7_NOSMIMECAP 0x200
  155. # define PKCS7_NOOLDMIMETYPE 0x400
  156. # define PKCS7_CRLFEOL 0x800
  157. # define PKCS7_STREAM 0x1000
  158. # define PKCS7_NOCRL 0x2000
  159. # define PKCS7_PARTIAL 0x4000
  160. # define PKCS7_REUSE_DIGEST 0x8000
  161. # define PKCS7_NO_DUAL_CONTENT 0x10000
  162. /* Flags: for compatibility with older code */
  163. # define SMIME_TEXT PKCS7_TEXT
  164. # define SMIME_NOCERTS PKCS7_NOCERTS
  165. # define SMIME_NOSIGS PKCS7_NOSIGS
  166. # define SMIME_NOCHAIN PKCS7_NOCHAIN
  167. # define SMIME_NOINTERN PKCS7_NOINTERN
  168. # define SMIME_NOVERIFY PKCS7_NOVERIFY
  169. # define SMIME_DETACHED PKCS7_DETACHED
  170. # define SMIME_BINARY PKCS7_BINARY
  171. # define SMIME_NOATTR PKCS7_NOATTR
  172. /* CRLF ASCII canonicalisation */
  173. # define SMIME_ASCIICRLF 0x80000
  174. DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
  175. int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,
  176. const EVP_MD *type, unsigned char *md,
  177. unsigned int *len);
  178. # ifndef OPENSSL_NO_STDIO
  179. PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);
  180. int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);
  181. # endif
  182. PKCS7 *PKCS7_dup(PKCS7 *p7);
  183. PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);
  184. int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);
  185. int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
  186. int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);
  187. DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
  188. DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
  189. DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
  190. DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
  191. DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
  192. DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
  193. DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
  194. DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
  195. DECLARE_ASN1_FUNCTIONS(PKCS7)
  196. DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
  197. DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
  198. DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
  199. DECLARE_ASN1_PRINT_FUNCTION(PKCS7)
  200. long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
  201. int PKCS7_set_type(PKCS7 *p7, int type);
  202. int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
  203. int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
  204. int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
  205. const EVP_MD *dgst);
  206. int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);
  207. int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
  208. int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
  209. int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
  210. int PKCS7_content_new(PKCS7 *p7, int nid);
  211. int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
  212. BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);
  213. int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
  214. X509 *x509);
  215. BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
  216. int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
  217. BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
  218. PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
  219. EVP_PKEY *pkey, const EVP_MD *dgst);
  220. X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
  221. int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
  222. STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
  223. PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
  224. void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,
  225. X509_ALGOR **pdig, X509_ALGOR **psig);
  226. void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);
  227. int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
  228. int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
  229. int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
  230. int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);
  231. PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
  232. ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
  233. int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,
  234. void *data);
  235. int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
  236. void *value);
  237. ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
  238. ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
  239. int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
  240. STACK_OF(X509_ATTRIBUTE) *sk);
  241. int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,
  242. STACK_OF(X509_ATTRIBUTE) *sk);
  243. PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
  244. BIO *data, int flags);
  245. PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,
  246. X509 *signcert, EVP_PKEY *pkey,
  247. const EVP_MD *md, int flags);
  248. int PKCS7_final(PKCS7 *p7, BIO *data, int flags);
  249. int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
  250. BIO *indata, BIO *out, int flags);
  251. STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,
  252. int flags);
  253. PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
  254. int flags);
  255. int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,
  256. int flags);
  257. int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
  258. STACK_OF(X509_ALGOR) *cap);
  259. STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
  260. int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
  261. int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);
  262. int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);
  263. int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,
  264. const unsigned char *md, int mdlen);
  265. int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
  266. PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
  267. BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);
  268. /* BEGIN ERROR CODES */
  269. /*
  270. * The following lines are auto generated by the script mkerr.pl. Any changes
  271. * made after this point may be overwritten when the script is next run.
  272. */
  273. int ERR_load_PKCS7_strings(void);
  274. /* Error codes for the PKCS7 functions. */
  275. /* Function codes. */
  276. # define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136
  277. # define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135
  278. # define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118
  279. # define PKCS7_F_PKCS7_ADD_CERTIFICATE 100
  280. # define PKCS7_F_PKCS7_ADD_CRL 101
  281. # define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102
  282. # define PKCS7_F_PKCS7_ADD_SIGNATURE 131
  283. # define PKCS7_F_PKCS7_ADD_SIGNER 103
  284. # define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125
  285. # define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138
  286. # define PKCS7_F_PKCS7_CTRL 104
  287. # define PKCS7_F_PKCS7_DATADECODE 112
  288. # define PKCS7_F_PKCS7_DATAFINAL 128
  289. # define PKCS7_F_PKCS7_DATAINIT 105
  290. # define PKCS7_F_PKCS7_DATAVERIFY 107
  291. # define PKCS7_F_PKCS7_DECRYPT 114
  292. # define PKCS7_F_PKCS7_DECRYPT_RINFO 133
  293. # define PKCS7_F_PKCS7_ENCODE_RINFO 132
  294. # define PKCS7_F_PKCS7_ENCRYPT 115
  295. # define PKCS7_F_PKCS7_FINAL 134
  296. # define PKCS7_F_PKCS7_FIND_DIGEST 127
  297. # define PKCS7_F_PKCS7_GET0_SIGNERS 124
  298. # define PKCS7_F_PKCS7_RECIP_INFO_SET 130
  299. # define PKCS7_F_PKCS7_SET_CIPHER 108
  300. # define PKCS7_F_PKCS7_SET_CONTENT 109
  301. # define PKCS7_F_PKCS7_SET_DIGEST 126
  302. # define PKCS7_F_PKCS7_SET_TYPE 110
  303. # define PKCS7_F_PKCS7_SIGN 116
  304. # define PKCS7_F_PKCS7_SIGNATUREVERIFY 113
  305. # define PKCS7_F_PKCS7_SIGNER_INFO_SET 129
  306. # define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139
  307. # define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137
  308. # define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119
  309. # define PKCS7_F_PKCS7_VERIFY 117
  310. /* Reason codes. */
  311. # define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117
  312. # define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144
  313. # define PKCS7_R_CIPHER_NOT_INITIALIZED 116
  314. # define PKCS7_R_CONTENT_AND_DATA_PRESENT 118
  315. # define PKCS7_R_CTRL_ERROR 152
  316. # define PKCS7_R_DECRYPT_ERROR 119
  317. # define PKCS7_R_DIGEST_FAILURE 101
  318. # define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149
  319. # define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150
  320. # define PKCS7_R_ERROR_ADDING_RECIPIENT 120
  321. # define PKCS7_R_ERROR_SETTING_CIPHER 121
  322. # define PKCS7_R_INVALID_NULL_POINTER 143
  323. # define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155
  324. # define PKCS7_R_NO_CONTENT 122
  325. # define PKCS7_R_NO_DEFAULT_DIGEST 151
  326. # define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154
  327. # define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115
  328. # define PKCS7_R_NO_SIGNATURES_ON_DATA 123
  329. # define PKCS7_R_NO_SIGNERS 142
  330. # define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104
  331. # define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124
  332. # define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153
  333. # define PKCS7_R_PKCS7_DATASIGN 145
  334. # define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127
  335. # define PKCS7_R_SIGNATURE_FAILURE 105
  336. # define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128
  337. # define PKCS7_R_SIGNING_CTRL_FAILURE 147
  338. # define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148
  339. # define PKCS7_R_SMIME_TEXT_ERROR 129
  340. # define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106
  341. # define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107
  342. # define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108
  343. # define PKCS7_R_UNKNOWN_DIGEST_TYPE 109
  344. # define PKCS7_R_UNKNOWN_OPERATION 110
  345. # define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111
  346. # define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112
  347. # define PKCS7_R_WRONG_CONTENT_TYPE 113
  348. # define PKCS7_R_WRONG_PKCS7_TYPE 114
  349. # ifdef __cplusplus
  350. }
  351. # endif
  352. #endif