112651Skvn/* crypto/cms/cms.h */
212651Skvn/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
312651Skvn * project.
412651Skvn */
512651Skvn/* ====================================================================
612651Skvn * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
712651Skvn *
812651Skvn * Redistribution and use in source and binary forms, with or without
912651Skvn * modification, are permitted provided that the following conditions
1012651Skvn * are met:
1112651Skvn *
1212651Skvn * 1. Redistributions of source code must retain the above copyright
1312651Skvn *    notice, this list of conditions and the following disclaimer.
1412651Skvn *
1512651Skvn * 2. Redistributions in binary form must reproduce the above copyright
1612651Skvn *    notice, this list of conditions and the following disclaimer in
1712651Skvn *    the documentation and/or other materials provided with the
1812651Skvn *    distribution.
1912651Skvn *
2012651Skvn * 3. All advertising materials mentioning features or use of this
2112651Skvn *    software must display the following acknowledgment:
2212651Skvn *    "This product includes software developed by the OpenSSL Project
2312651Skvn *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
2412651Skvn *
2512651Skvn * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
2612651Skvn *    endorse or promote products derived from this software without
2712651Skvn *    prior written permission. For written permission, please contact
2812651Skvn *    licensing@OpenSSL.org.
2912651Skvn *
3012651Skvn * 5. Products derived from this software may not be called "OpenSSL"
3112651Skvn *    nor may "OpenSSL" appear in their names without prior written
3212651Skvn *    permission of the OpenSSL Project.
3312651Skvn *
3412651Skvn * 6. Redistributions of any form whatsoever must retain the following
3512651Skvn *    acknowledgment:
3612651Skvn *    "This product includes software developed by the OpenSSL Project
3712651Skvn *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
3812651Skvn *
3912651Skvn * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
4012651Skvn * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4112651Skvn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
4212651Skvn * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
4312651Skvn * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
4412651Skvn * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
4512651Skvn * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
4612651Skvn * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4712651Skvn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
4812651Skvn * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
4912651Skvn * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
5012651Skvn * OF THE POSSIBILITY OF SUCH DAMAGE.
5112651Skvn * ====================================================================
5212651Skvn */
5312651Skvn
5412651Skvn
5512651Skvn#ifndef HEADER_CMS_H
5612651Skvn#define HEADER_CMS_H
5712651Skvn
5812651Skvn#include <openssl/x509.h>
5912651Skvn
6012651Skvn#ifdef OPENSSL_NO_CMS
6112651Skvn#error CMS is disabled.
6212651Skvn#endif
6312651Skvn
6412651Skvn#ifdef __cplusplus
6512651Skvnextern "C" {
6612651Skvn#endif
6712651Skvn
6812651Skvn
6912651Skvntypedef struct CMS_ContentInfo_st CMS_ContentInfo;
7012651Skvntypedef struct CMS_SignerInfo_st CMS_SignerInfo;
7112651Skvntypedef struct CMS_CertificateChoices CMS_CertificateChoices;
7212651Skvntypedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
7312651Skvntypedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
7412651Skvntypedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
7512651Skvntypedef struct CMS_Receipt_st CMS_Receipt;
7612651Skvn
7712651SkvnDECLARE_STACK_OF(CMS_SignerInfo)
7812651SkvnDECLARE_STACK_OF(GENERAL_NAMES)
7912651SkvnDECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
8012651SkvnDECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
8112651SkvnDECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
8212651Skvn
8312651Skvn#define CMS_SIGNERINFO_ISSUER_SERIAL	0
8412651Skvn#define CMS_SIGNERINFO_KEYIDENTIFIER	1
8512651Skvn
8612651Skvn#define CMS_RECIPINFO_TRANS		0
8712651Skvn#define CMS_RECIPINFO_AGREE		1
8812651Skvn#define CMS_RECIPINFO_KEK		2
8912651Skvn#define CMS_RECIPINFO_PASS		3
9012651Skvn#define CMS_RECIPINFO_OTHER		4
9112651Skvn
9212651Skvn/* S/MIME related flags */
9312651Skvn
9412651Skvn#define CMS_TEXT			0x1
9512651Skvn#define CMS_NOCERTS			0x2
9612651Skvn#define CMS_NO_CONTENT_VERIFY		0x4
9712651Skvn#define CMS_NO_ATTR_VERIFY		0x8
9812651Skvn#define CMS_NOSIGS			\
9912651Skvn			(CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)
10012651Skvn#define CMS_NOINTERN			0x10
10112651Skvn#define CMS_NO_SIGNER_CERT_VERIFY	0x20
10212651Skvn#define CMS_NOVERIFY			0x20
10312651Skvn#define CMS_DETACHED			0x40
10412651Skvn#define CMS_BINARY			0x80
10512651Skvn#define CMS_NOATTR			0x100
10612651Skvn#define	CMS_NOSMIMECAP			0x200
10712651Skvn#define CMS_NOOLDMIMETYPE		0x400
10812651Skvn#define CMS_CRLFEOL			0x800
10912651Skvn#define CMS_STREAM			0x1000
11012651Skvn#define CMS_NOCRL			0x2000
11112651Skvn#define CMS_PARTIAL			0x4000
11212651Skvn#define CMS_REUSE_DIGEST		0x8000
11312651Skvn#define CMS_USE_KEYID			0x10000
11412651Skvn
11512651Skvnconst ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
11612651Skvn
11712651SkvnBIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
11812651Skvnint CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
11912651Skvn
12012651SkvnASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
12112651Skvnint CMS_is_detached(CMS_ContentInfo *cms);
12212651Skvnint CMS_set_detached(CMS_ContentInfo *cms, int detached);
12312651Skvn
12412651Skvn#ifdef HEADER_PEM_H
12512651SkvnDECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
12612651Skvn#endif
12712651Skvn
12812651Skvnint CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
12912651SkvnCMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
13012651Skvnint i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);
13112651Skvn
13212651SkvnBIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
13312651Skvnint i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
13412651Skvnint PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
135CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
136int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
137
138int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags);
139
140CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
141						BIO *data, unsigned int flags);
142
143CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
144					X509 *signcert, EVP_PKEY *pkey,
145					STACK_OF(X509) *certs,
146					unsigned int flags);
147
148int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
149CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
150
151int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
152							unsigned int flags);
153CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
154							unsigned int flags);
155
156int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
157				const unsigned char *key, size_t keylen,
158				BIO *dcont, BIO *out, unsigned int flags);
159
160CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
161					const unsigned char *key, size_t keylen,
162					unsigned int flags);
163
164int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
165				const unsigned char *key, size_t keylen);
166
167int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
168		 X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
169
170int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
171			STACK_OF(X509) *certs,
172			X509_STORE *store, unsigned int flags);
173
174STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
175
176CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
177				const EVP_CIPHER *cipher, unsigned int flags);
178
179int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
180				BIO *dcont, BIO *out,
181				unsigned int flags);
182
183int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
184int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
185				unsigned char *key, size_t keylen,
186				unsigned char *id, size_t idlen);
187
188STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
189int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
190CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
191CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
192					X509 *recip, unsigned int flags);
193int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
194int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
195int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
196					EVP_PKEY **pk, X509 **recip,
197					X509_ALGOR **palg);
198int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,
199					ASN1_OCTET_STRING **keyid,
200					X509_NAME **issuer, ASN1_INTEGER **sno);
201
202CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
203					unsigned char *key, size_t keylen,
204					unsigned char *id, size_t idlen,
205					ASN1_GENERALIZEDTIME *date,
206					ASN1_OBJECT *otherTypeId,
207					ASN1_TYPE *otherType);
208
209int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,
210					X509_ALGOR **palg,
211					ASN1_OCTET_STRING **pid,
212					ASN1_GENERALIZEDTIME **pdate,
213					ASN1_OBJECT **potherid,
214					ASN1_TYPE **pothertype);
215
216int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,
217				unsigned char *key, size_t keylen);
218
219int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,
220					const unsigned char *id, size_t idlen);
221
222int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
223
224int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
225							unsigned int flags);
226CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);
227
228int CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);
229const ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);
230
231CMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);
232int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
233int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
234STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);
235
236CMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);
237int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
238int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
239STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);
240
241int CMS_SignedData_init(CMS_ContentInfo *cms);
242CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
243			X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
244			unsigned int flags);
245STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
246
247void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
248int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
249					ASN1_OCTET_STRING **keyid,
250					X509_NAME **issuer, ASN1_INTEGER **sno);
251int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
252int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
253					unsigned int flags);
254void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer,
255					X509_ALGOR **pdig, X509_ALGOR **psig);
256int CMS_SignerInfo_sign(CMS_SignerInfo *si);
257int CMS_SignerInfo_verify(CMS_SignerInfo *si);
258int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
259
260int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
261int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
262				int algnid, int keysize);
263int CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);
264
265int CMS_signed_get_attr_count(const CMS_SignerInfo *si);
266int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
267			  int lastpos);
268int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
269			  int lastpos);
270X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);
271X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);
272int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
273int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,
274			const ASN1_OBJECT *obj, int type,
275			const void *bytes, int len);
276int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
277			int nid, int type,
278			const void *bytes, int len);
279int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
280			const char *attrname, int type,
281			const void *bytes, int len);
282void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
283					int lastpos, int type);
284
285int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
286int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,
287			  int lastpos);
288int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,
289			  int lastpos);
290X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);
291X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);
292int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);
293int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,
294			const ASN1_OBJECT *obj, int type,
295			const void *bytes, int len);
296int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
297			int nid, int type,
298			const void *bytes, int len);
299int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
300			const char *attrname, int type,
301			const void *bytes, int len);
302void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
303					int lastpos, int type);
304
305#ifdef HEADER_X509V3_H
306
307int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
308CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
309				int allorfirst,
310				STACK_OF(GENERAL_NAMES) *receiptList,
311				STACK_OF(GENERAL_NAMES) *receiptsTo);
312int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
313void 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
319#endif
320
321/* BEGIN ERROR CODES */
322/* The following lines are auto generated by the script mkerr.pl. Any changes
323 * made after this point may be overwritten when the script is next run.
324 */
325void ERR_load_CMS_strings(void);
326
327/* Error codes for the CMS functions. */
328
329/* Function codes. */
330#define CMS_F_CHECK_CONTENT				 99
331#define CMS_F_CMS_ADD0_CERT				 164
332#define CMS_F_CMS_ADD0_RECIPIENT_KEY			 100
333#define CMS_F_CMS_ADD1_RECEIPTREQUEST			 158
334#define CMS_F_CMS_ADD1_RECIPIENT_CERT			 101
335#define CMS_F_CMS_ADD1_SIGNER				 102
336#define CMS_F_CMS_ADD1_SIGNINGTIME			 103
337#define CMS_F_CMS_COMPRESS				 104
338#define CMS_F_CMS_COMPRESSEDDATA_CREATE			 105
339#define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO		 106
340#define CMS_F_CMS_COPY_CONTENT				 107
341#define CMS_F_CMS_COPY_MESSAGEDIGEST			 108
342#define CMS_F_CMS_DATA					 109
343#define CMS_F_CMS_DATAFINAL				 110
344#define CMS_F_CMS_DATAINIT				 111
345#define CMS_F_CMS_DECRYPT				 112
346#define CMS_F_CMS_DECRYPT_SET1_KEY			 113
347#define CMS_F_CMS_DECRYPT_SET1_PKEY			 114
348#define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX		 115
349#define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO		 116
350#define CMS_F_CMS_DIGESTEDDATA_DO_FINAL			 117
351#define CMS_F_CMS_DIGEST_VERIFY				 118
352#define CMS_F_CMS_ENCODE_RECEIPT			 161
353#define CMS_F_CMS_ENCRYPT				 119
354#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO		 120
355#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT			 121
356#define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT			 122
357#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY		 123
358#define CMS_F_CMS_ENVELOPEDDATA_CREATE			 124
359#define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO		 125
360#define CMS_F_CMS_ENVELOPED_DATA_INIT			 126
361#define CMS_F_CMS_FINAL					 127
362#define CMS_F_CMS_GET0_CERTIFICATE_CHOICES		 128
363#define CMS_F_CMS_GET0_CONTENT				 129
364#define CMS_F_CMS_GET0_ECONTENT_TYPE			 130
365#define CMS_F_CMS_GET0_ENVELOPED			 131
366#define CMS_F_CMS_GET0_REVOCATION_CHOICES		 132
367#define CMS_F_CMS_GET0_SIGNED				 133
368#define CMS_F_CMS_MSGSIGDIGEST_ADD1			 162
369#define CMS_F_CMS_RECEIPTREQUEST_CREATE0		 159
370#define CMS_F_CMS_RECEIPT_VERIFY			 160
371#define CMS_F_CMS_RECIPIENTINFO_DECRYPT			 134
372#define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT		 135
373#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT		 136
374#define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID		 137
375#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP		 138
376#define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP		 139
377#define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT		 140
378#define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT		 141
379#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS		 142
380#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID	 143
381#define CMS_F_CMS_RECIPIENTINFO_SET0_KEY		 144
382#define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY		 145
383#define CMS_F_CMS_SET1_SIGNERIDENTIFIER			 146
384#define CMS_F_CMS_SET_DETACHED				 147
385#define CMS_F_CMS_SIGN					 148
386#define CMS_F_CMS_SIGNED_DATA_INIT			 149
387#define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN		 150
388#define CMS_F_CMS_SIGNERINFO_SIGN			 151
389#define CMS_F_CMS_SIGNERINFO_VERIFY			 152
390#define CMS_F_CMS_SIGNERINFO_VERIFY_CERT		 153
391#define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT		 154
392#define CMS_F_CMS_SIGN_RECEIPT				 163
393#define CMS_F_CMS_STREAM				 155
394#define CMS_F_CMS_UNCOMPRESS				 156
395#define CMS_F_CMS_VERIFY				 157
396
397/* Reason codes. */
398#define CMS_R_ADD_SIGNER_ERROR				 99
399#define CMS_R_CERTIFICATE_ALREADY_PRESENT		 175
400#define CMS_R_CERTIFICATE_HAS_NO_KEYID			 160
401#define CMS_R_CERTIFICATE_VERIFY_ERROR			 100
402#define CMS_R_CIPHER_INITIALISATION_ERROR		 101
403#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR	 102
404#define CMS_R_CMS_DATAFINAL_ERROR			 103
405#define CMS_R_CMS_LIB					 104
406#define CMS_R_CONTENTIDENTIFIER_MISMATCH		 170
407#define CMS_R_CONTENT_NOT_FOUND				 105
408#define CMS_R_CONTENT_TYPE_MISMATCH			 171
409#define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA		 106
410#define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA		 107
411#define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA		 108
412#define CMS_R_CONTENT_VERIFY_ERROR			 109
413#define CMS_R_CTRL_ERROR				 110
414#define CMS_R_CTRL_FAILURE				 111
415#define CMS_R_DECRYPT_ERROR				 112
416#define CMS_R_DIGEST_ERROR				 161
417#define CMS_R_ERROR_GETTING_PUBLIC_KEY			 113
418#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE	 114
419#define CMS_R_ERROR_SETTING_KEY				 115
420#define CMS_R_ERROR_SETTING_RECIPIENTINFO		 116
421#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH		 117
422#define CMS_R_INVALID_KEY_LENGTH			 118
423#define CMS_R_MD_BIO_INIT_ERROR				 119
424#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH	 120
425#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH		 121
426#define CMS_R_MSGSIGDIGEST_ERROR			 172
427#define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE		 162
428#define CMS_R_MSGSIGDIGEST_WRONG_LENGTH			 163
429#define CMS_R_NEED_ONE_SIGNER				 164
430#define CMS_R_NOT_A_SIGNED_RECEIPT			 165
431#define CMS_R_NOT_ENCRYPTED_DATA			 122
432#define CMS_R_NOT_KEK					 123
433#define CMS_R_NOT_KEY_TRANSPORT				 124
434#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE		 125
435#define CMS_R_NO_CIPHER					 126
436#define CMS_R_NO_CONTENT				 127
437#define CMS_R_NO_CONTENT_TYPE				 173
438#define CMS_R_NO_DEFAULT_DIGEST				 128
439#define CMS_R_NO_DIGEST_SET				 129
440#define CMS_R_NO_KEY					 130
441#define CMS_R_NO_KEY_OR_CERT				 174
442#define CMS_R_NO_MATCHING_DIGEST			 131
443#define CMS_R_NO_MATCHING_RECIPIENT			 132
444#define CMS_R_NO_MATCHING_SIGNATURE			 166
445#define CMS_R_NO_MSGSIGDIGEST				 167
446#define CMS_R_NO_PRIVATE_KEY				 133
447#define CMS_R_NO_PUBLIC_KEY				 134
448#define CMS_R_NO_RECEIPT_REQUEST			 168
449#define CMS_R_NO_SIGNERS				 135
450#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE	 136
451#define CMS_R_RECEIPT_DECODE_ERROR			 169
452#define CMS_R_RECIPIENT_ERROR				 137
453#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND		 138
454#define CMS_R_SIGNFINAL_ERROR				 139
455#define CMS_R_SMIME_TEXT_ERROR				 140
456#define CMS_R_STORE_INIT_ERROR				 141
457#define CMS_R_TYPE_NOT_COMPRESSED_DATA			 142
458#define CMS_R_TYPE_NOT_DATA				 143
459#define CMS_R_TYPE_NOT_DIGESTED_DATA			 144
460#define CMS_R_TYPE_NOT_ENCRYPTED_DATA			 145
461#define CMS_R_TYPE_NOT_ENVELOPED_DATA			 146
462#define CMS_R_UNABLE_TO_FINALIZE_CONTEXT		 147
463#define CMS_R_UNKNOWN_CIPHER				 148
464#define CMS_R_UNKNOWN_DIGEST_ALGORIHM			 149
465#define CMS_R_UNKNOWN_ID				 150
466#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM		 151
467#define CMS_R_UNSUPPORTED_CONTENT_TYPE			 152
468#define CMS_R_UNSUPPORTED_KEK_ALGORITHM			 153
469#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE		 154
470#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE		 155
471#define CMS_R_UNSUPPORTED_TYPE				 156
472#define CMS_R_UNWRAP_ERROR				 157
473#define CMS_R_VERIFICATION_FAILURE			 158
474#define CMS_R_WRAP_ERROR				 159
475
476#ifdef  __cplusplus
477}
478#endif
479#endif
480