cms.h revision 193770
111820Sjulian/* crypto/cms/cms.h */ 211820Sjulian/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 311820Sjulian * project. 411820Sjulian */ 511820Sjulian/* ==================================================================== 611820Sjulian * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 711820Sjulian * 811820Sjulian * Redistribution and use in source and binary forms, with or without 911820Sjulian * modification, are permitted provided that the following conditions 1011820Sjulian * are met: 1111820Sjulian * 1211820Sjulian * 1. Redistributions of source code must retain the above copyright 1311820Sjulian * notice, this list of conditions and the following disclaimer. 1411820Sjulian * 1511820Sjulian * 2. Redistributions in binary form must reproduce the above copyright 1611820Sjulian * notice, this list of conditions and the following disclaimer in 1711820Sjulian * the documentation and/or other materials provided with the 1811820Sjulian * distribution. 1911820Sjulian * 2011820Sjulian * 3. All advertising materials mentioning features or use of this 2111820Sjulian * software must display the following acknowledgment: 2211820Sjulian * "This product includes software developed by the OpenSSL Project 2311820Sjulian * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" 2411820Sjulian * 2511820Sjulian * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 2611820Sjulian * endorse or promote products derived from this software without 2711820Sjulian * prior written permission. For written permission, please contact 2811820Sjulian * licensing@OpenSSL.org. 2911820Sjulian * 3011820Sjulian * 5. Products derived from this software may not be called "OpenSSL" 3111820Sjulian * nor may "OpenSSL" appear in their names without prior written 3211820Sjulian * permission of the OpenSSL Project. 3311820Sjulian * 3411820Sjulian * 6. Redistributions of any form whatsoever must retain the following 3511820Sjulian * acknowledgment: 3611820Sjulian * "This product includes software developed by the OpenSSL Project 3711820Sjulian * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" 3811820Sjulian * 3911820Sjulian * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 4011820Sjulian * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 4111820Sjulian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 4211820Sjulian * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 4311820Sjulian * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4411820Sjulian * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 4511820Sjulian * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 4611820Sjulian * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 4711820Sjulian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 4811820Sjulian * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 4911820Sjulian * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 5011820Sjulian * OF THE POSSIBILITY OF SUCH DAMAGE. 5111820Sjulian * ==================================================================== 5211820Sjulian */ 5311820Sjulian 5411820Sjulian 5511820Sjulian#ifndef HEADER_CMS_H 5611820Sjulian#define HEADER_CMS_H 5711820Sjulian 5811820Sjulian#include <openssl/x509.h> 5911820Sjulian 6011820Sjulian#ifdef OPENSSL_NO_CMS 6111820Sjulian#error CMS is disabled. 6211820Sjulian#endif 6311820Sjulian 6411820Sjulian#ifdef __cplusplus 6511820Sjulianextern "C" { 6611820Sjulian#endif 6711820Sjulian 6811820Sjulian 6911820Sjuliantypedef struct CMS_ContentInfo_st CMS_ContentInfo; 7011820Sjuliantypedef struct CMS_SignerInfo_st CMS_SignerInfo; 7111820Sjuliantypedef struct CMS_CertificateChoices CMS_CertificateChoices; 7211820Sjuliantypedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice; 7311820Sjuliantypedef struct CMS_RecipientInfo_st CMS_RecipientInfo; 7411820Sjuliantypedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest; 7511820Sjuliantypedef struct CMS_Receipt_st CMS_Receipt; 7611820Sjulian 7711820SjulianDECLARE_STACK_OF(CMS_SignerInfo) 7811820SjulianDECLARE_STACK_OF(GENERAL_NAMES) 7911820SjulianDECLARE_ASN1_FUNCTIONS_const(CMS_ContentInfo) 8011820SjulianDECLARE_ASN1_FUNCTIONS_const(CMS_ReceiptRequest) 8111820Sjulian 8211820Sjulian#define CMS_SIGNERINFO_ISSUER_SERIAL 0 8311820Sjulian#define CMS_SIGNERINFO_KEYIDENTIFIER 1 8411820Sjulian 8511820Sjulian#define CMS_RECIPINFO_TRANS 0 8611820Sjulian#define CMS_RECIPINFO_AGREE 1 8711820Sjulian#define CMS_RECIPINFO_KEK 2 8811820Sjulian#define CMS_RECIPINFO_PASS 3 8911820Sjulian#define CMS_RECIPINFO_OTHER 4 9011820Sjulian 9111820Sjulian/* S/MIME related flags */ 9211820Sjulian 9311820Sjulian#define CMS_TEXT 0x1 9411820Sjulian#define CMS_NOCERTS 0x2 9511820Sjulian#define CMS_NO_CONTENT_VERIFY 0x4 9611820Sjulian#define CMS_NO_ATTR_VERIFY 0x8 9711820Sjulian#define CMS_NOSIGS \ 9811820Sjulian (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY) 9911820Sjulian#define CMS_NOINTERN 0x10 10011820Sjulian#define CMS_NO_SIGNER_CERT_VERIFY 0x20 10111820Sjulian#define CMS_NOVERIFY 0x20 10211820Sjulian#define CMS_DETACHED 0x40 10311820Sjulian#define CMS_BINARY 0x80 10411820Sjulian#define CMS_NOATTR 0x100 10511820Sjulian#define CMS_NOSMIMECAP 0x200 10611820Sjulian#define CMS_NOOLDMIMETYPE 0x400 10711820Sjulian#define CMS_CRLFEOL 0x800 10811820Sjulian#define CMS_STREAM 0x1000 10911820Sjulian#define CMS_NOCRL 0x2000 11011820Sjulian#define CMS_PARTIAL 0x4000 11111820Sjulian#define CMS_REUSE_DIGEST 0x8000 11211820Sjulian#define CMS_USE_KEYID 0x10000 11311820Sjulian 11411820Sjulianconst ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms); 11511820Sjulian 11611820SjulianBIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont); 11711820Sjulianint CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio); 11811820Sjulian 11911820SjulianASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms); 12011820Sjulianint CMS_is_detached(CMS_ContentInfo *cms); 12111820Sjulianint CMS_set_detached(CMS_ContentInfo *cms, int detached); 12211820Sjulian 12311820Sjulian#ifdef HEADER_PEM_H 12411820SjulianDECLARE_PEM_rw_const(CMS, CMS_ContentInfo) 12511820Sjulian#endif 12611820Sjulian 12711820SjulianCMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms); 12811820Sjulianint i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms); 12911820Sjulian 13011820SjulianCMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont); 13111820Sjulianint SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags); 13211820Sjulian 13311820Sjulianint CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags); 13411820Sjulian 13511820SjulianCMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 13611820Sjulian BIO *data, unsigned int flags); 13711820Sjulian 13811820SjulianCMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, 13911820Sjulian X509 *signcert, EVP_PKEY *pkey, 14011820Sjulian STACK_OF(X509) *certs, 14111820Sjulian unsigned int flags); 14211820Sjulian 14311820Sjulianint CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags); 14411820SjulianCMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags); 14511820Sjulian 14611820Sjulianint CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, 14711820Sjulian unsigned int flags); 14811820SjulianCMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, 14911820Sjulian unsigned int flags); 15011820Sjulian 15111820Sjulianint CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, 15211820Sjulian const unsigned char *key, size_t keylen, 15311820Sjulian BIO *dcont, BIO *out, unsigned int flags); 15411820Sjulian 15511820SjulianCMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, 15611820Sjulian const unsigned char *key, size_t keylen, 15711820Sjulian unsigned int flags); 15811820Sjulian 15911820Sjulianint CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph, 16011820Sjulian const unsigned char *key, size_t keylen); 16111820Sjulian 16211820Sjulianint CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, 16311820Sjulian X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags); 16411820Sjulian 16511820Sjulianint CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, 16611820Sjulian STACK_OF(X509) *certs, 16711820Sjulian X509_STORE *store, unsigned int flags); 16811820Sjulian 16911820SjulianSTACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); 17011820Sjulian 17111820SjulianCMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, 17211820Sjulian const EVP_CIPHER *cipher, unsigned int flags); 17311820Sjulian 17411820Sjulianint CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, 17511820Sjulian BIO *dcont, BIO *out, 17611820Sjulian unsigned int flags); 17711820Sjulian 17811820Sjulianint CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert); 17911820Sjulianint CMS_decrypt_set1_key(CMS_ContentInfo *cms, 18011820Sjulian unsigned char *key, size_t keylen, 18111820Sjulian unsigned char *id, size_t idlen); 18211820Sjulian 18311820SjulianSTACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); 18411820Sjulianint CMS_RecipientInfo_type(CMS_RecipientInfo *ri); 18511820SjulianCMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher); 18611820SjulianCMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, 18711820Sjulian X509 *recip, unsigned int flags); 18811820Sjulianint CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); 18911820Sjulianint CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); 19011820Sjulianint CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, 19111820Sjulian EVP_PKEY **pk, X509 **recip, 19211820Sjulian X509_ALGOR **palg); 19311820Sjulianint CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, 19411820Sjulian ASN1_OCTET_STRING **keyid, 19511820Sjulian X509_NAME **issuer, ASN1_INTEGER **sno); 19611820Sjulian 19711820SjulianCMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, 19811820Sjulian unsigned char *key, size_t keylen, 19911820Sjulian unsigned char *id, size_t idlen, 20011820Sjulian ASN1_GENERALIZEDTIME *date, 20111820Sjulian ASN1_OBJECT *otherTypeId, 20211820Sjulian ASN1_TYPE *otherType); 20311820Sjulian 20411820Sjulianint CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, 20511820Sjulian X509_ALGOR **palg, 20611820Sjulian ASN1_OCTET_STRING **pid, 20711820Sjulian ASN1_GENERALIZEDTIME **pdate, 20811820Sjulian ASN1_OBJECT **potherid, 20911820Sjulian ASN1_TYPE **pothertype); 21011820Sjulian 21111820Sjulianint CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, 21211820Sjulian unsigned char *key, size_t keylen); 21311820Sjulian 21411820Sjulianint CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, 21511820Sjulian const unsigned char *id, size_t idlen); 21611820Sjulian 21711820Sjulianint CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); 21811820Sjulian 21911820Sjulianint CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, 22011820Sjulian unsigned int flags); 22111820SjulianCMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags); 22211820Sjulian 22311820Sjulianint CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid); 22411820Sjulianconst ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms); 22511820Sjulian 22611820SjulianCMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms); 22711820Sjulianint CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert); 22811820Sjulianint CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert); 22911820SjulianSTACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms); 23011820Sjulian 23111820SjulianCMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms); 23211820Sjulianint CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl); 23311820SjulianSTACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); 23411820Sjulian 23511820Sjulianint CMS_SignedData_init(CMS_ContentInfo *cms); 23611820SjulianCMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, 23711820Sjulian X509 *signer, EVP_PKEY *pk, const EVP_MD *md, 23811820Sjulian unsigned int flags); 23911820SjulianSTACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); 24011820Sjulian 24111820Sjulianvoid CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); 24211820Sjulianint CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, 24311820Sjulian ASN1_OCTET_STRING **keyid, 24411820Sjulian X509_NAME **issuer, ASN1_INTEGER **sno); 24511820Sjulianint CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); 24611820Sjulianint CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs, 24711820Sjulian unsigned int flags); 24811820Sjulianvoid CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer, 24911820Sjulian X509_ALGOR **pdig, X509_ALGOR **psig); 25011820Sjulianint CMS_SignerInfo_sign(CMS_SignerInfo *si); 25111820Sjulianint CMS_SignerInfo_verify(CMS_SignerInfo *si); 25211820Sjulianint CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain); 25311820Sjulian 25411820Sjulianint CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs); 25511820Sjulianint CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs, 25611820Sjulian int algnid, int keysize); 25711820Sjulianint CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap); 25811820Sjulian 25911820Sjulianint CMS_signed_get_attr_count(const CMS_SignerInfo *si); 26011820Sjulianint CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, 26111820Sjulian int lastpos); 26211820Sjulianint CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, 26311820Sjulian int lastpos); 26411820SjulianX509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc); 26511820SjulianX509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc); 26611820Sjulianint CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); 26711820Sjulianint CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, 26811820Sjulian const ASN1_OBJECT *obj, int type, 26911820Sjulian const void *bytes, int len); 27011820Sjulianint CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, 27111820Sjulian int nid, int type, 27211820Sjulian const void *bytes, int len); 27311820Sjulianint CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, 27411820Sjulian const char *attrname, int type, 27511820Sjulian const void *bytes, int len); 27611820Sjulianvoid *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, 27711820Sjulian int lastpos, int type); 27811820Sjulian 27911820Sjulianint CMS_unsigned_get_attr_count(const CMS_SignerInfo *si); 28011820Sjulianint CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, 28111820Sjulian int lastpos); 28211820Sjulianint CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj, 28311820Sjulian int lastpos); 28411820SjulianX509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc); 28511820SjulianX509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc); 28611820Sjulianint CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr); 28711820Sjulianint CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, 28811820Sjulian const ASN1_OBJECT *obj, int type, 28911820Sjulian const void *bytes, int len); 29011820Sjulianint CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, 29111820Sjulian int nid, int type, 29211820Sjulian const void *bytes, int len); 29311820Sjulianint CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, 29411820Sjulian const char *attrname, int type, 29511820Sjulian const void *bytes, int len); 29611820Sjulianvoid *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, 29711820Sjulian int lastpos, int type); 29811820Sjulian 29911820Sjulian#ifdef HEADER_X509V3_H 30011820Sjulian 30111820Sjulianint CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); 30211820SjulianCMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, 30311820Sjulian int allorfirst, 30411820Sjulian STACK_OF(GENERAL_NAMES) *receiptList, 30511820Sjulian STACK_OF(GENERAL_NAMES) *receiptsTo); 30611820Sjulianint CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); 30711820Sjulianvoid CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, 30811820Sjulian ASN1_STRING **pcid, 30911820Sjulian int *pallorfirst, 31011820Sjulian STACK_OF(GENERAL_NAMES) **plist, 31111820Sjulian STACK_OF(GENERAL_NAMES) **prto); 31211820Sjulian 31311820Sjulian#endif 31411820Sjulian 31511820Sjulian/* BEGIN ERROR CODES */ 31611820Sjulian/* The following lines are auto generated by the script mkerr.pl. Any changes 31711820Sjulian * made after this point may be overwritten when the script is next run. 31811820Sjulian */ 31911820Sjulianvoid ERR_load_CMS_strings(void); 32011820Sjulian 32111820Sjulian/* Error codes for the CMS functions. */ 32211820Sjulian 32311820Sjulian/* Function codes. */ 32411820Sjulian#define CMS_F_CHECK_CONTENT 99 32511820Sjulian#define CMS_F_CMS_ADD0_CERT 164 32611820Sjulian#define CMS_F_CMS_ADD0_RECIPIENT_KEY 100 32711820Sjulian#define CMS_F_CMS_ADD1_RECEIPTREQUEST 158 32811820Sjulian#define CMS_F_CMS_ADD1_RECIPIENT_CERT 101 32911820Sjulian#define CMS_F_CMS_ADD1_SIGNER 102 33011820Sjulian#define CMS_F_CMS_ADD1_SIGNINGTIME 103 33111820Sjulian#define CMS_F_CMS_COMPRESS 104 33211820Sjulian#define CMS_F_CMS_COMPRESSEDDATA_CREATE 105 33311820Sjulian#define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106 33411820Sjulian#define CMS_F_CMS_COPY_CONTENT 107 33511820Sjulian#define CMS_F_CMS_COPY_MESSAGEDIGEST 108 33611820Sjulian#define CMS_F_CMS_DATA 109 33711820Sjulian#define CMS_F_CMS_DATAFINAL 110 33811820Sjulian#define CMS_F_CMS_DATAINIT 111 33911820Sjulian#define CMS_F_CMS_DECRYPT 112 34011820Sjulian#define CMS_F_CMS_DECRYPT_SET1_KEY 113 34111820Sjulian#define CMS_F_CMS_DECRYPT_SET1_PKEY 114 34211820Sjulian#define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115 34311820Sjulian#define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116 34411820Sjulian#define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117 34511820Sjulian#define CMS_F_CMS_DIGEST_VERIFY 118 346#define CMS_F_CMS_ENCODE_RECEIPT 161 347#define CMS_F_CMS_ENCRYPT 119 348#define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120 349#define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121 350#define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122 351#define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123 352#define CMS_F_CMS_ENVELOPEDDATA_CREATE 124 353#define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125 354#define CMS_F_CMS_ENVELOPED_DATA_INIT 126 355#define CMS_F_CMS_FINAL 127 356#define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128 357#define CMS_F_CMS_GET0_CONTENT 129 358#define CMS_F_CMS_GET0_ECONTENT_TYPE 130 359#define CMS_F_CMS_GET0_ENVELOPED 131 360#define CMS_F_CMS_GET0_REVOCATION_CHOICES 132 361#define CMS_F_CMS_GET0_SIGNED 133 362#define CMS_F_CMS_MSGSIGDIGEST_ADD1 162 363#define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159 364#define CMS_F_CMS_RECEIPT_VERIFY 160 365#define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134 366#define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135 367#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136 368#define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137 369#define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138 370#define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139 371#define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140 372#define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141 373#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142 374#define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143 375#define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144 376#define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145 377#define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146 378#define CMS_F_CMS_SET_DETACHED 147 379#define CMS_F_CMS_SIGN 148 380#define CMS_F_CMS_SIGNED_DATA_INIT 149 381#define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150 382#define CMS_F_CMS_SIGNERINFO_SIGN 151 383#define CMS_F_CMS_SIGNERINFO_VERIFY 152 384#define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153 385#define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154 386#define CMS_F_CMS_SIGN_RECEIPT 163 387#define CMS_F_CMS_STREAM 155 388#define CMS_F_CMS_UNCOMPRESS 156 389#define CMS_F_CMS_VERIFY 157 390 391/* Reason codes. */ 392#define CMS_R_ADD_SIGNER_ERROR 99 393#define CMS_R_CERTIFICATE_ALREADY_PRESENT 175 394#define CMS_R_CERTIFICATE_HAS_NO_KEYID 160 395#define CMS_R_CERTIFICATE_VERIFY_ERROR 100 396#define CMS_R_CIPHER_INITIALISATION_ERROR 101 397#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102 398#define CMS_R_CMS_DATAFINAL_ERROR 103 399#define CMS_R_CMS_LIB 104 400#define CMS_R_CONTENTIDENTIFIER_MISMATCH 170 401#define CMS_R_CONTENT_NOT_FOUND 105 402#define CMS_R_CONTENT_TYPE_MISMATCH 171 403#define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA 106 404#define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA 107 405#define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA 108 406#define CMS_R_CONTENT_VERIFY_ERROR 109 407#define CMS_R_CTRL_ERROR 110 408#define CMS_R_CTRL_FAILURE 111 409#define CMS_R_DECRYPT_ERROR 112 410#define CMS_R_DIGEST_ERROR 161 411#define CMS_R_ERROR_GETTING_PUBLIC_KEY 113 412#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114 413#define CMS_R_ERROR_SETTING_KEY 115 414#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116 415#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117 416#define CMS_R_INVALID_KEY_LENGTH 118 417#define CMS_R_MD_BIO_INIT_ERROR 119 418#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120 419#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121 420#define CMS_R_MSGSIGDIGEST_ERROR 172 421#define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE 162 422#define CMS_R_MSGSIGDIGEST_WRONG_LENGTH 163 423#define CMS_R_NEED_ONE_SIGNER 164 424#define CMS_R_NOT_A_SIGNED_RECEIPT 165 425#define CMS_R_NOT_ENCRYPTED_DATA 122 426#define CMS_R_NOT_KEK 123 427#define CMS_R_NOT_KEY_TRANSPORT 124 428#define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125 429#define CMS_R_NO_CIPHER 126 430#define CMS_R_NO_CONTENT 127 431#define CMS_R_NO_CONTENT_TYPE 173 432#define CMS_R_NO_DEFAULT_DIGEST 128 433#define CMS_R_NO_DIGEST_SET 129 434#define CMS_R_NO_KEY 130 435#define CMS_R_NO_KEY_OR_CERT 174 436#define CMS_R_NO_MATCHING_DIGEST 131 437#define CMS_R_NO_MATCHING_RECIPIENT 132 438#define CMS_R_NO_MATCHING_SIGNATURE 166 439#define CMS_R_NO_MSGSIGDIGEST 167 440#define CMS_R_NO_PRIVATE_KEY 133 441#define CMS_R_NO_PUBLIC_KEY 134 442#define CMS_R_NO_RECEIPT_REQUEST 168 443#define CMS_R_NO_SIGNERS 135 444#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136 445#define CMS_R_RECEIPT_DECODE_ERROR 169 446#define CMS_R_RECIPIENT_ERROR 137 447#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138 448#define CMS_R_SIGNFINAL_ERROR 139 449#define CMS_R_SMIME_TEXT_ERROR 140 450#define CMS_R_STORE_INIT_ERROR 141 451#define CMS_R_TYPE_NOT_COMPRESSED_DATA 142 452#define CMS_R_TYPE_NOT_DATA 143 453#define CMS_R_TYPE_NOT_DIGESTED_DATA 144 454#define CMS_R_TYPE_NOT_ENCRYPTED_DATA 145 455#define CMS_R_TYPE_NOT_ENVELOPED_DATA 146 456#define CMS_R_UNABLE_TO_FINALIZE_CONTEXT 147 457#define CMS_R_UNKNOWN_CIPHER 148 458#define CMS_R_UNKNOWN_DIGEST_ALGORIHM 149 459#define CMS_R_UNKNOWN_ID 150 460#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151 461#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152 462#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153 463#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154 464#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE 155 465#define CMS_R_UNSUPPORTED_TYPE 156 466#define CMS_R_UNWRAP_ERROR 157 467#define CMS_R_VERIFICATION_FAILURE 158 468#define CMS_R_WRAP_ERROR 159 469 470#ifdef __cplusplus 471} 472#endif 473#endif 474