cms.h.in 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. /*
  2. * {- join("\n * ", @autowarntext) -}
  3. *
  4. * Copyright 2008-2022 The OpenSSL Project Authors. All Rights Reserved.
  5. *
  6. * Licensed under the Apache License 2.0 (the "License"). You may not use
  7. * this file except in compliance with the License. You can obtain a copy
  8. * in the file LICENSE in the source distribution or at
  9. * https://www.openssl.org/source/license.html
  10. */
  11. {-
  12. use OpenSSL::stackhash qw(generate_stack_macros);
  13. -}
  14. #ifndef OPENSSL_CMS_H
  15. # define OPENSSL_CMS_H
  16. # pragma once
  17. # include <openssl/macros.h>
  18. # ifndef OPENSSL_NO_DEPRECATED_3_0
  19. # define HEADER_CMS_H
  20. # endif
  21. # include <openssl/opensslconf.h>
  22. # ifndef OPENSSL_NO_CMS
  23. # include <openssl/x509.h>
  24. # include <openssl/x509v3.h>
  25. # include <openssl/cmserr.h>
  26. # ifdef __cplusplus
  27. extern "C" {
  28. # endif
  29. typedef struct CMS_EnvelopedData_st CMS_EnvelopedData;
  30. typedef struct CMS_ContentInfo_st CMS_ContentInfo;
  31. typedef struct CMS_SignerInfo_st CMS_SignerInfo;
  32. typedef struct CMS_SignedData_st CMS_SignedData;
  33. typedef struct CMS_CertificateChoices CMS_CertificateChoices;
  34. typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
  35. typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
  36. typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
  37. typedef struct CMS_Receipt_st CMS_Receipt;
  38. typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
  39. typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
  40. {-
  41. generate_stack_macros("CMS_SignerInfo")
  42. .generate_stack_macros("CMS_RecipientEncryptedKey")
  43. .generate_stack_macros("CMS_RecipientInfo")
  44. .generate_stack_macros("CMS_RevocationInfoChoice");
  45. -}
  46. DECLARE_ASN1_ITEM(CMS_EnvelopedData)
  47. DECLARE_ASN1_ALLOC_FUNCTIONS(CMS_SignedData)
  48. DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
  49. DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
  50. DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
  51. CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
  52. # define CMS_SIGNERINFO_ISSUER_SERIAL 0
  53. # define CMS_SIGNERINFO_KEYIDENTIFIER 1
  54. # define CMS_RECIPINFO_NONE -1
  55. # define CMS_RECIPINFO_TRANS 0
  56. # define CMS_RECIPINFO_AGREE 1
  57. # define CMS_RECIPINFO_KEK 2
  58. # define CMS_RECIPINFO_PASS 3
  59. # define CMS_RECIPINFO_OTHER 4
  60. /* S/MIME related flags */
  61. # define CMS_TEXT 0x1
  62. # define CMS_NOCERTS 0x2
  63. # define CMS_NO_CONTENT_VERIFY 0x4
  64. # define CMS_NO_ATTR_VERIFY 0x8
  65. # define CMS_NOSIGS \
  66. (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
  67. # define CMS_NOINTERN 0x10
  68. # define CMS_NO_SIGNER_CERT_VERIFY 0x20
  69. # define CMS_NOVERIFY 0x20
  70. # define CMS_DETACHED 0x40
  71. # define CMS_BINARY 0x80
  72. # define CMS_NOATTR 0x100
  73. # define CMS_NOSMIMECAP 0x200
  74. # define CMS_NOOLDMIMETYPE 0x400
  75. # define CMS_CRLFEOL 0x800
  76. # define CMS_STREAM 0x1000
  77. # define CMS_NOCRL 0x2000
  78. # define CMS_PARTIAL 0x4000
  79. # define CMS_REUSE_DIGEST 0x8000
  80. # define CMS_USE_KEYID 0x10000
  81. # define CMS_DEBUG_DECRYPT 0x20000
  82. # define CMS_KEY_PARAM 0x40000
  83. # define CMS_ASCIICRLF 0x80000
  84. # define CMS_CADES 0x100000
  85. # define CMS_USE_ORIGINATOR_KEYID 0x200000
  86. const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
  87. BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
  88. int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
  89. ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
  90. int CMS_is_detached(CMS_ContentInfo *cms);
  91. int CMS_set_detached(CMS_ContentInfo *cms, int detached);
  92. # ifdef OPENSSL_PEM_H
  93. DECLARE_PEM_rw(CMS, CMS_ContentInfo)
  94. # endif
  95. int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
  96. CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
  97. int i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
  98. BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
  99. int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
  100. int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
  101. int flags);
  102. CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
  103. CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci);
  104. int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
  105. int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
  106. unsigned int flags);
  107. int CMS_final_digest(CMS_ContentInfo *cms,
  108. const unsigned char *md, unsigned int mdlen, BIO *dcont,
  109. unsigned int flags);
  110. CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
  111. STACK_OF(X509) *certs, BIO *data,
  112. unsigned int flags);
  113. CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
  114. STACK_OF(X509) *certs, BIO *data,
  115. unsigned int flags, OSSL_LIB_CTX *libctx,
  116. const char *propq);
  117. CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
  118. X509 *signcert, EVP_PKEY *pkey,
  119. STACK_OF(X509) *certs, unsigned int flags);
  120. int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
  121. CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
  122. CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
  123. OSSL_LIB_CTX *libctx, const char *propq);
  124. int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
  125. unsigned int flags);
  126. CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
  127. unsigned int flags);
  128. CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
  129. unsigned int flags, OSSL_LIB_CTX *libctx,
  130. const char *propq);
  131. int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
  132. const unsigned char *key, size_t keylen,
  133. BIO *dcont, BIO *out, unsigned int flags);
  134. CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
  135. const unsigned char *key,
  136. size_t keylen, unsigned int flags);
  137. CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
  138. const unsigned char *key,
  139. size_t keylen, unsigned int flags,
  140. OSSL_LIB_CTX *libctx,
  141. const char *propq);
  142. int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
  143. const unsigned char *key, size_t keylen);
  144. int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
  145. X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
  146. int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
  147. STACK_OF(X509) *certs,
  148. X509_STORE *store, unsigned int flags);
  149. STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
  150. CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
  151. const EVP_CIPHER *cipher, unsigned int flags);
  152. CMS_ContentInfo *CMS_encrypt_ex(STACK_OF(X509) *certs, BIO *in,
  153. const EVP_CIPHER *cipher, unsigned int flags,
  154. OSSL_LIB_CTX *libctx, const char *propq);
  155. int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
  156. BIO *dcont, BIO *out, unsigned int flags);
  157. int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
  158. int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
  159. X509 *cert, X509 *peer);
  160. int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
  161. unsigned char *key, size_t keylen,
  162. const unsigned char *id, size_t idlen);
  163. int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
  164. unsigned char *pass, ossl_ssize_t passlen);
  165. STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
  166. int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
  167. EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
  168. CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
  169. CMS_ContentInfo *
  170. CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
  171. const char *propq);
  172. CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
  173. CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
  174. OSSL_LIB_CTX *libctx,
  175. const char *propq);
  176. BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
  177. EVP_PKEY *pkey, X509 *cert,
  178. ASN1_OCTET_STRING *secret, unsigned int flags,
  179. OSSL_LIB_CTX *libctx, const char *propq);
  180. CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
  181. X509 *recip, unsigned int flags);
  182. CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
  183. EVP_PKEY *originatorPrivKey, X509 * originator, unsigned int flags);
  184. int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
  185. int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
  186. int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
  187. EVP_PKEY **pk, X509 **recip,
  188. X509_ALGOR **palg);
  189. int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
  190. ASN1_OCTET_STRING **keyid,
  191. X509_NAME **issuer,
  192. ASN1_INTEGER **sno);
  193. CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
  194. unsigned char *key, size_t keylen,
  195. unsigned char *id, size_t idlen,
  196. ASN1_GENERALIZEDTIME *date,
  197. ASN1_OBJECT *otherTypeId,
  198. ASN1_TYPE *otherType);
  199. int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
  200. X509_ALGOR **palg,
  201. ASN1_OCTET_STRING **pid,
  202. ASN1_GENERALIZEDTIME **pdate,
  203. ASN1_OBJECT **potherid,
  204. ASN1_TYPE **pothertype);
  205. int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
  206. unsigned char *key, size_t keylen);
  207. int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
  208. const unsigned char *id, size_t idlen);
  209. int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
  210. unsigned char *pass,
  211. ossl_ssize_t passlen);
  212. CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
  213. int iter, int wrap_nid,
  214. int pbe_nid,
  215. unsigned char *pass,
  216. ossl_ssize_t passlen,
  217. const EVP_CIPHER *kekciph);
  218. int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
  219. int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
  220. int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
  221. unsigned int flags);
  222. CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
  223. int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
  224. const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
  225. CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
  226. int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
  227. int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
  228. STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
  229. CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
  230. int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  231. int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
  232. STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
  233. int CMS_SignedData_init(CMS_ContentInfo *cms);
  234. CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
  235. X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
  236. unsigned int flags);
  237. EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
  238. EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
  239. STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
  240. void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
  241. int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
  242. ASN1_OCTET_STRING **keyid,
  243. X509_NAME **issuer, ASN1_INTEGER **sno);
  244. int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
  245. int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
  246. unsigned int flags);
  247. void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
  248. X509 **signer, X509_ALGOR **pdig,
  249. X509_ALGOR **psig);
  250. ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
  251. int CMS_SignerInfo_sign(CMS_SignerInfo *si);
  252. int CMS_SignerInfo_verify(CMS_SignerInfo *si);
  253. int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
  254. BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
  255. STACK_OF(X509) *scerts, X509_STORE *store,
  256. STACK_OF(X509) *extra, STACK_OF(X509_CRL) *crls,
  257. unsigned int flags,
  258. OSSL_LIB_CTX *libctx, const char *propq);
  259. int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
  260. int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
  261. int algnid, int keysize);
  262. int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
  263. int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
  264. int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
  265. int lastpos);
  266. int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj,
  267. int lastpos);
  268. X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
  269. X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
  270. int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
  271. int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
  272. const ASN1_OBJECT *obj, int type,
  273. const void *bytes, int len);
  274. int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
  275. int nid, int type,
  276. const void *bytes, int len);
  277. int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
  278. const char *attrname, int type,
  279. const void *bytes, int len);
  280. void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
  281. const ASN1_OBJECT *oid,
  282. int lastpos, int type);
  283. int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
  284. int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
  285. int lastpos);
  286. int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si,
  287. const ASN1_OBJECT *obj, int lastpos);
  288. X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
  289. X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
  290. int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
  291. int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
  292. const ASN1_OBJECT *obj, int type,
  293. const void *bytes, int len);
  294. int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
  295. int nid, int type,
  296. const void *bytes, int len);
  297. int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
  298. const char *attrname, int type,
  299. const void *bytes, int len);
  300. void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
  301. int lastpos, int type);
  302. int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
  303. CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
  304. unsigned char *id, int idlen, int allorfirst,
  305. STACK_OF(GENERAL_NAMES) *receiptList,
  306. STACK_OF(GENERAL_NAMES) *receiptsTo);
  307. CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
  308. unsigned char *id, int idlen, int allorfirst,
  309. STACK_OF(GENERAL_NAMES) *receiptList,
  310. STACK_OF(GENERAL_NAMES) *receiptsTo,
  311. OSSL_LIB_CTX *libctx);
  312. int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
  313. void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
  314. ASN1_STRING **pcid,
  315. int *pallorfirst,
  316. STACK_OF(GENERAL_NAMES) **plist,
  317. STACK_OF(GENERAL_NAMES) **prto);
  318. int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
  319. X509_ALGOR **palg,
  320. ASN1_OCTET_STRING **pukm);
  321. STACK_OF(CMS_RecipientEncryptedKey)
  322. *CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
  323. int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
  324. X509_ALGOR **pubalg,
  325. ASN1_BIT_STRING **pubkey,
  326. ASN1_OCTET_STRING **keyid,
  327. X509_NAME **issuer,
  328. ASN1_INTEGER **sno);
  329. int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
  330. int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
  331. ASN1_OCTET_STRING **keyid,
  332. ASN1_GENERALIZEDTIME **tm,
  333. CMS_OtherKeyAttribute **other,
  334. X509_NAME **issuer, ASN1_INTEGER **sno);
  335. int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
  336. X509 *cert);
  337. int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
  338. int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer);
  339. EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
  340. int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
  341. CMS_RecipientInfo *ri,
  342. CMS_RecipientEncryptedKey *rek);
  343. int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
  344. ASN1_OCTET_STRING *ukm, int keylen);
  345. /* Backward compatibility for spelling errors. */
  346. # define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
  347. # define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
  348. CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE
  349. # ifdef __cplusplus
  350. }
  351. # endif
  352. # endif
  353. #endif