LTKCPP-- LLRP Toolkit C Plus Plus Library
|
00001 /* crypto/pkcs7/pkcs7.h */ 00002 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 00003 * All rights reserved. 00004 * 00005 * This package is an SSL implementation written 00006 * by Eric Young (eay@cryptsoft.com). 00007 * The implementation was written so as to conform with Netscapes SSL. 00008 * 00009 * This library is free for commercial and non-commercial use as long as 00010 * the following conditions are aheared to. The following conditions 00011 * apply to all code found in this distribution, be it the RC4, RSA, 00012 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 00013 * included with this distribution is covered by the same copyright terms 00014 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 00015 * 00016 * Copyright remains Eric Young's, and as such any Copyright notices in 00017 * the code are not to be removed. 00018 * If this package is used in a product, Eric Young should be given attribution 00019 * as the author of the parts of the library used. 00020 * This can be in the form of a textual message at program startup or 00021 * in documentation (online or textual) provided with the package. 00022 * 00023 * Redistribution and use in source and binary forms, with or without 00024 * modification, are permitted provided that the following conditions 00025 * are met: 00026 * 1. Redistributions of source code must retain the copyright 00027 * notice, this list of conditions and the following disclaimer. 00028 * 2. Redistributions in binary form must reproduce the above copyright 00029 * notice, this list of conditions and the following disclaimer in the 00030 * documentation and/or other materials provided with the distribution. 00031 * 3. All advertising materials mentioning features or use of this software 00032 * must display the following acknowledgement: 00033 * "This product includes cryptographic software written by 00034 * Eric Young (eay@cryptsoft.com)" 00035 * The word 'cryptographic' can be left out if the rouines from the library 00036 * being used are not cryptographic related :-). 00037 * 4. If you include any Windows specific code (or a derivative thereof) from 00038 * the apps directory (application code) you must include an acknowledgement: 00039 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 00040 * 00041 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 00042 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00043 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00044 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 00045 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00046 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00047 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00048 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00049 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00050 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00051 * SUCH DAMAGE. 00052 * 00053 * The licence and distribution terms for any publically available version or 00054 * derivative of this code cannot be changed. i.e. this code cannot simply be 00055 * copied and put under another distribution licence 00056 * [including the GNU Public Licence.] 00057 */ 00058 00059 #ifndef HEADER_PKCS7_H 00060 # define HEADER_PKCS7_H 00061 00062 # include <openssl/asn1.h> 00063 # include <openssl/bio.h> 00064 # include <openssl/e_os2.h> 00065 00066 # include <openssl/symhacks.h> 00067 # include <openssl/ossl_typ.h> 00068 00069 #ifdef __cplusplus 00070 extern "C" { 00071 #endif 00072 00073 # ifdef OPENSSL_SYS_WIN32 00074 /* Under Win32 thes are defined in wincrypt.h */ 00075 # undef PKCS7_ISSUER_AND_SERIAL 00076 # undef PKCS7_SIGNER_INFO 00077 # endif 00078 00079 /*- 00080 Encryption_ID DES-CBC 00081 Digest_ID MD5 00082 Digest_Encryption_ID rsaEncryption 00083 Key_Encryption_ID rsaEncryption 00084 */ 00085 00086 typedef struct pkcs7_issuer_and_serial_st { 00087 X509_NAME *issuer; 00088 ASN1_INTEGER *serial; 00089 } PKCS7_ISSUER_AND_SERIAL; 00090 00091 typedef struct pkcs7_signer_info_st { 00092 ASN1_INTEGER *version; /* version 1 */ 00093 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 00094 X509_ALGOR *digest_alg; 00095 STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */ 00096 X509_ALGOR *digest_enc_alg; 00097 ASN1_OCTET_STRING *enc_digest; 00098 STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */ 00099 /* The private key to sign with */ 00100 EVP_PKEY *pkey; 00101 } PKCS7_SIGNER_INFO; 00102 00103 DECLARE_STACK_OF(PKCS7_SIGNER_INFO) 00104 DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) 00105 00106 typedef struct pkcs7_recip_info_st { 00107 ASN1_INTEGER *version; /* version 0 */ 00108 PKCS7_ISSUER_AND_SERIAL *issuer_and_serial; 00109 X509_ALGOR *key_enc_algor; 00110 ASN1_OCTET_STRING *enc_key; 00111 X509 *cert; /* get the pub-key from this */ 00112 } PKCS7_RECIP_INFO; 00113 00114 DECLARE_STACK_OF(PKCS7_RECIP_INFO) 00115 DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) 00116 00117 typedef struct pkcs7_signed_st { 00118 ASN1_INTEGER *version; /* version 1 */ 00119 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 00120 STACK_OF(X509) *cert; /* [ 0 ] */ 00121 STACK_OF(X509_CRL) *crl; /* [ 1 ] */ 00122 STACK_OF(PKCS7_SIGNER_INFO) *signer_info; 00123 struct pkcs7_st *contents; 00124 } PKCS7_SIGNED; 00125 /* 00126 * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about 00127 * merging the two 00128 */ 00129 00130 typedef struct pkcs7_enc_content_st { 00131 ASN1_OBJECT *content_type; 00132 X509_ALGOR *algorithm; 00133 ASN1_OCTET_STRING *enc_data; /* [ 0 ] */ 00134 const EVP_CIPHER *cipher; 00135 } PKCS7_ENC_CONTENT; 00136 00137 typedef struct pkcs7_enveloped_st { 00138 ASN1_INTEGER *version; /* version 0 */ 00139 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 00140 PKCS7_ENC_CONTENT *enc_data; 00141 } PKCS7_ENVELOPE; 00142 00143 typedef struct pkcs7_signedandenveloped_st { 00144 ASN1_INTEGER *version; /* version 1 */ 00145 STACK_OF(X509_ALGOR) *md_algs; /* md used */ 00146 STACK_OF(X509) *cert; /* [ 0 ] */ 00147 STACK_OF(X509_CRL) *crl; /* [ 1 ] */ 00148 STACK_OF(PKCS7_SIGNER_INFO) *signer_info; 00149 PKCS7_ENC_CONTENT *enc_data; 00150 STACK_OF(PKCS7_RECIP_INFO) *recipientinfo; 00151 } PKCS7_SIGN_ENVELOPE; 00152 00153 typedef struct pkcs7_digest_st { 00154 ASN1_INTEGER *version; /* version 0 */ 00155 X509_ALGOR *md; /* md used */ 00156 struct pkcs7_st *contents; 00157 ASN1_OCTET_STRING *digest; 00158 } PKCS7_DIGEST; 00159 00160 typedef struct pkcs7_encrypted_st { 00161 ASN1_INTEGER *version; /* version 0 */ 00162 PKCS7_ENC_CONTENT *enc_data; 00163 } PKCS7_ENCRYPT; 00164 00165 typedef struct pkcs7_st { 00166 /* 00167 * The following is non NULL if it contains ASN1 encoding of this 00168 * structure 00169 */ 00170 unsigned char *asn1; 00171 long length; 00172 # define PKCS7_S_HEADER 0 00173 # define PKCS7_S_BODY 1 00174 # define PKCS7_S_TAIL 2 00175 int state; /* used during processing */ 00176 int detached; 00177 ASN1_OBJECT *type; 00178 /* content as defined by the type */ 00179 /* 00180 * all encryption/message digests are applied to the 'contents', leaving 00181 * out the 'type' field. 00182 */ 00183 union { 00184 char *ptr; 00185 /* NID_pkcs7_data */ 00186 ASN1_OCTET_STRING *data; 00187 /* NID_pkcs7_signed */ 00188 PKCS7_SIGNED *sign; 00189 /* NID_pkcs7_enveloped */ 00190 PKCS7_ENVELOPE *enveloped; 00191 /* NID_pkcs7_signedAndEnveloped */ 00192 PKCS7_SIGN_ENVELOPE *signed_and_enveloped; 00193 /* NID_pkcs7_digest */ 00194 PKCS7_DIGEST *digest; 00195 /* NID_pkcs7_encrypted */ 00196 PKCS7_ENCRYPT *encrypted; 00197 /* Anything else */ 00198 ASN1_TYPE *other; 00199 } d; 00200 } PKCS7; 00201 00202 DECLARE_STACK_OF(PKCS7) 00203 DECLARE_ASN1_SET_OF(PKCS7) 00204 DECLARE_PKCS12_STACK_OF(PKCS7) 00205 00206 # define PKCS7_OP_SET_DETACHED_SIGNATURE 1 00207 # define PKCS7_OP_GET_DETACHED_SIGNATURE 2 00208 00209 # define PKCS7_get_signed_attributes(si) ((si)->auth_attr) 00210 # define PKCS7_get_attributes(si) ((si)->unauth_attr) 00211 00212 # define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed) 00213 # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) 00214 # define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped) 00215 # define PKCS7_type_is_signedAndEnveloped(a) \ 00216 (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped) 00217 # define PKCS7_type_is_data(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_data) 00218 # define PKCS7_type_is_digest(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_digest) 00219 00220 # define PKCS7_set_detached(p,v) \ 00221 PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL) 00222 # define PKCS7_get_detached(p) \ 00223 PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL) 00224 00225 # define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7)) 00226 00227 /* S/MIME related flags */ 00228 00229 # define PKCS7_TEXT 0x1 00230 # define PKCS7_NOCERTS 0x2 00231 # define PKCS7_NOSIGS 0x4 00232 # define PKCS7_NOCHAIN 0x8 00233 # define PKCS7_NOINTERN 0x10 00234 # define PKCS7_NOVERIFY 0x20 00235 # define PKCS7_DETACHED 0x40 00236 # define PKCS7_BINARY 0x80 00237 # define PKCS7_NOATTR 0x100 00238 # define PKCS7_NOSMIMECAP 0x200 00239 # define PKCS7_NOOLDMIMETYPE 0x400 00240 # define PKCS7_CRLFEOL 0x800 00241 # define PKCS7_STREAM 0x1000 00242 # define PKCS7_NOCRL 0x2000 00243 # define PKCS7_PARTIAL 0x4000 00244 # define PKCS7_REUSE_DIGEST 0x8000 00245 00246 /* Flags: for compatibility with older code */ 00247 00248 # define SMIME_TEXT PKCS7_TEXT 00249 # define SMIME_NOCERTS PKCS7_NOCERTS 00250 # define SMIME_NOSIGS PKCS7_NOSIGS 00251 # define SMIME_NOCHAIN PKCS7_NOCHAIN 00252 # define SMIME_NOINTERN PKCS7_NOINTERN 00253 # define SMIME_NOVERIFY PKCS7_NOVERIFY 00254 # define SMIME_DETACHED PKCS7_DETACHED 00255 # define SMIME_BINARY PKCS7_BINARY 00256 # define SMIME_NOATTR PKCS7_NOATTR 00257 00258 DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL) 00259 00260 int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data, 00261 const EVP_MD *type, unsigned char *md, 00262 unsigned int *len); 00263 # ifndef OPENSSL_NO_FP_API 00264 PKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7); 00265 int i2d_PKCS7_fp(FILE *fp, PKCS7 *p7); 00266 # endif 00267 PKCS7 *PKCS7_dup(PKCS7 *p7); 00268 PKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7); 00269 int i2d_PKCS7_bio(BIO *bp, PKCS7 *p7); 00270 int i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 00271 int PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags); 00272 00273 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO) 00274 DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO) 00275 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED) 00276 DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT) 00277 DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE) 00278 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE) 00279 DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST) 00280 DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT) 00281 DECLARE_ASN1_FUNCTIONS(PKCS7) 00282 00283 DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN) 00284 DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY) 00285 00286 DECLARE_ASN1_NDEF_FUNCTION(PKCS7) 00287 DECLARE_ASN1_PRINT_FUNCTION(PKCS7) 00288 00289 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg); 00290 00291 int PKCS7_set_type(PKCS7 *p7, int type); 00292 int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other); 00293 int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data); 00294 int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, 00295 const EVP_MD *dgst); 00296 int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si); 00297 int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i); 00298 int PKCS7_add_certificate(PKCS7 *p7, X509 *x509); 00299 int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509); 00300 int PKCS7_content_new(PKCS7 *p7, int nid); 00301 int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx, 00302 BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); 00303 int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, 00304 X509 *x509); 00305 00306 BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio); 00307 int PKCS7_dataFinal(PKCS7 *p7, BIO *bio); 00308 BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert); 00309 00310 PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509, 00311 EVP_PKEY *pkey, const EVP_MD *dgst); 00312 X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si); 00313 int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md); 00314 STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7); 00315 00316 PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509); 00317 void PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk, 00318 X509_ALGOR **pdig, X509_ALGOR **psig); 00319 void PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc); 00320 int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri); 00321 int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509); 00322 int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher); 00323 int PKCS7_stream(unsigned char ***boundary, PKCS7 *p7); 00324 00325 PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx); 00326 ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk); 00327 int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type, 00328 void *data); 00329 int PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype, 00330 void *value); 00331 ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid); 00332 ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid); 00333 int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si, 00334 STACK_OF(X509_ATTRIBUTE) *sk); 00335 int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si, 00336 STACK_OF(X509_ATTRIBUTE) *sk); 00337 00338 PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, 00339 BIO *data, int flags); 00340 00341 PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, 00342 X509 *signcert, EVP_PKEY *pkey, 00343 const EVP_MD *md, int flags); 00344 00345 int PKCS7_final(PKCS7 *p7, BIO *data, int flags); 00346 int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, 00347 BIO *indata, BIO *out, int flags); 00348 STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, 00349 int flags); 00350 PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, 00351 int flags); 00352 int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, 00353 int flags); 00354 00355 int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si, 00356 STACK_OF(X509_ALGOR) *cap); 00357 STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si); 00358 int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg); 00359 00360 int PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid); 00361 int PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t); 00362 int PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si, 00363 const unsigned char *md, int mdlen); 00364 00365 int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags); 00366 PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont); 00367 00368 BIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7); 00369 00370 /* BEGIN ERROR CODES */ 00371 /* 00372 * The following lines are auto generated by the script mkerr.pl. Any changes 00373 * made after this point may be overwritten when the script is next run. 00374 */ 00375 void ERR_load_PKCS7_strings(void); 00376 00377 /* Error codes for the PKCS7 functions. */ 00378 00379 /* Function codes. */ 00380 # define PKCS7_F_B64_READ_PKCS7 120 00381 # define PKCS7_F_B64_WRITE_PKCS7 121 00382 # define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136 00383 # define PKCS7_F_I2D_PKCS7_BIO_STREAM 140 00384 # define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135 00385 # define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 00386 # define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 00387 # define PKCS7_F_PKCS7_ADD_CRL 101 00388 # define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 00389 # define PKCS7_F_PKCS7_ADD_SIGNATURE 131 00390 # define PKCS7_F_PKCS7_ADD_SIGNER 103 00391 # define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 00392 # define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138 00393 # define PKCS7_F_PKCS7_CTRL 104 00394 # define PKCS7_F_PKCS7_DATADECODE 112 00395 # define PKCS7_F_PKCS7_DATAFINAL 128 00396 # define PKCS7_F_PKCS7_DATAINIT 105 00397 # define PKCS7_F_PKCS7_DATASIGN 106 00398 # define PKCS7_F_PKCS7_DATAVERIFY 107 00399 # define PKCS7_F_PKCS7_DECRYPT 114 00400 # define PKCS7_F_PKCS7_DECRYPT_RINFO 133 00401 # define PKCS7_F_PKCS7_ENCODE_RINFO 132 00402 # define PKCS7_F_PKCS7_ENCRYPT 115 00403 # define PKCS7_F_PKCS7_FINAL 134 00404 # define PKCS7_F_PKCS7_FIND_DIGEST 127 00405 # define PKCS7_F_PKCS7_GET0_SIGNERS 124 00406 # define PKCS7_F_PKCS7_RECIP_INFO_SET 130 00407 # define PKCS7_F_PKCS7_SET_CIPHER 108 00408 # define PKCS7_F_PKCS7_SET_CONTENT 109 00409 # define PKCS7_F_PKCS7_SET_DIGEST 126 00410 # define PKCS7_F_PKCS7_SET_TYPE 110 00411 # define PKCS7_F_PKCS7_SIGN 116 00412 # define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 00413 # define PKCS7_F_PKCS7_SIGNER_INFO_SET 129 00414 # define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139 00415 # define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137 00416 # define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 00417 # define PKCS7_F_PKCS7_VERIFY 117 00418 # define PKCS7_F_SMIME_READ_PKCS7 122 00419 # define PKCS7_F_SMIME_TEXT 123 00420 00421 /* Reason codes. */ 00422 # define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 00423 # define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 00424 # define PKCS7_R_CIPHER_NOT_INITIALIZED 116 00425 # define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 00426 # define PKCS7_R_CTRL_ERROR 152 00427 # define PKCS7_R_DECODE_ERROR 130 00428 # define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH 100 00429 # define PKCS7_R_DECRYPT_ERROR 119 00430 # define PKCS7_R_DIGEST_FAILURE 101 00431 # define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149 00432 # define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150 00433 # define PKCS7_R_ERROR_ADDING_RECIPIENT 120 00434 # define PKCS7_R_ERROR_SETTING_CIPHER 121 00435 # define PKCS7_R_INVALID_MIME_TYPE 131 00436 # define PKCS7_R_INVALID_NULL_POINTER 143 00437 # define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 00438 # define PKCS7_R_MIME_NO_CONTENT_TYPE 132 00439 # define PKCS7_R_MIME_PARSE_ERROR 133 00440 # define PKCS7_R_MIME_SIG_PARSE_ERROR 134 00441 # define PKCS7_R_MISSING_CERIPEND_INFO 103 00442 # define PKCS7_R_NO_CONTENT 122 00443 # define PKCS7_R_NO_CONTENT_TYPE 135 00444 # define PKCS7_R_NO_DEFAULT_DIGEST 151 00445 # define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154 00446 # define PKCS7_R_NO_MULTIPART_BODY_FAILURE 136 00447 # define PKCS7_R_NO_MULTIPART_BOUNDARY 137 00448 # define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 00449 # define PKCS7_R_NO_RECIPIENT_MATCHES_KEY 146 00450 # define PKCS7_R_NO_SIGNATURES_ON_DATA 123 00451 # define PKCS7_R_NO_SIGNERS 142 00452 # define PKCS7_R_NO_SIG_CONTENT_TYPE 138 00453 # define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 00454 # define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 00455 # define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153 00456 # define PKCS7_R_PKCS7_DATAFINAL 126 00457 # define PKCS7_R_PKCS7_DATAFINAL_ERROR 125 00458 # define PKCS7_R_PKCS7_DATASIGN 145 00459 # define PKCS7_R_PKCS7_PARSE_ERROR 139 00460 # define PKCS7_R_PKCS7_SIG_PARSE_ERROR 140 00461 # define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 00462 # define PKCS7_R_SIGNATURE_FAILURE 105 00463 # define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 00464 # define PKCS7_R_SIGNING_CTRL_FAILURE 147 00465 # define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148 00466 # define PKCS7_R_SIG_INVALID_MIME_TYPE 141 00467 # define PKCS7_R_SMIME_TEXT_ERROR 129 00468 # define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 00469 # define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 00470 # define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 00471 # define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 00472 # define PKCS7_R_UNKNOWN_OPERATION 110 00473 # define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 00474 # define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 00475 # define PKCS7_R_WRONG_CONTENT_TYPE 113 00476 # define PKCS7_R_WRONG_PKCS7_TYPE 114 00477 00478 #ifdef __cplusplus 00479 } 00480 #endif 00481 #endif