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