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