pkcs7.h

Go to the documentation of this file.
00001 /* crypto/pkcs7/pkcs7.h */
00002 /* Copyright (C) 1995-1998 Eric Young ([email protected])
00003  * All rights reserved.
00004  *
00005  * This package is an SSL implementation written
00006  * by Eric Young ([email protected]).
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 ([email protected]).
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 ([email protected])"
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 ([email protected])"
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  © Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
00060  */
00061 
00062 #ifndef HEADER_PKCS7_H
00063 #define HEADER_PKCS7_H
00064 
00065 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00066 #define SYMBIAN
00067 #endif
00068 
00069 #ifdef SYMBIAN
00070 #include <e32def.h>
00071 #endif
00072 #include <openssl/asn1.h>
00073 #include <openssl/bio.h>
00074 #include <openssl/e_os2.h>
00075 
00076 #include <openssl/symhacks.h>
00077 #include <openssl/ossl_typ.h>
00078 
00079 #ifdef  __cplusplus
00080 extern "C" {
00081 #endif
00082 
00083 #ifdef OPENSSL_SYS_WIN32
00084 /* Under Win32 thes are defined in wincrypt.h */
00085 #undef PKCS7_ISSUER_AND_SERIAL
00086 #undef PKCS7_SIGNER_INFO
00087 #endif
00088 
00089 /*
00090 Encryption_ID           DES-CBC
00091 Digest_ID               MD5
00092 Digest_Encryption_ID    rsaEncryption
00093 Key_Encryption_ID       rsaEncryption
00094 */
00095 
00096 typedef struct pkcs7_issuer_and_serial_st
00097         {
00098         X509_NAME *issuer;
00099         ASN1_INTEGER *serial;
00100         } PKCS7_ISSUER_AND_SERIAL;
00101 
00102 typedef struct pkcs7_signer_info_st
00103         {
00104         ASN1_INTEGER                    *version;       /* version 1 */
00105         PKCS7_ISSUER_AND_SERIAL         *issuer_and_serial;
00106         X509_ALGOR                      *digest_alg;
00107         STACK_OF(X509_ATTRIBUTE)        *auth_attr;     /* [ 0 ] */
00108         X509_ALGOR                      *digest_enc_alg;
00109         ASN1_OCTET_STRING               *enc_digest;
00110         STACK_OF(X509_ATTRIBUTE)        *unauth_attr;   /* [ 1 ] */
00111 
00112         /* The private key to sign with */
00113         EVP_PKEY                        *pkey;
00114         } PKCS7_SIGNER_INFO;
00115 
00116 DECLARE_STACK_OF(PKCS7_SIGNER_INFO)
00117 DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)
00118 
00119 typedef struct pkcs7_recip_info_st
00120         {
00121         ASN1_INTEGER                    *version;       /* version 0 */
00122         PKCS7_ISSUER_AND_SERIAL         *issuer_and_serial;
00123         X509_ALGOR                      *key_enc_algor;
00124         ASN1_OCTET_STRING               *enc_key;
00125         X509                            *cert; /* get the pub-key from this */
00126         } PKCS7_RECIP_INFO;
00127 
00128 DECLARE_STACK_OF(PKCS7_RECIP_INFO)
00129 DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)
00130 
00131 typedef struct pkcs7_signed_st
00132         {
00133         ASN1_INTEGER                    *version;       /* version 1 */
00134         STACK_OF(X509_ALGOR)            *md_algs;       /* md used */
00135         STACK_OF(X509)                  *cert;          /* [ 0 ] */
00136         STACK_OF(X509_CRL)              *crl;           /* [ 1 ] */
00137         STACK_OF(PKCS7_SIGNER_INFO)     *signer_info;
00138 
00139         struct pkcs7_st                 *contents;
00140         } PKCS7_SIGNED;
00141 /* The above structure is very very similar to PKCS7_SIGN_ENVELOPE.
00142  * How about merging the two */
00143 
00144 typedef struct pkcs7_enc_content_st
00145         {
00146         ASN1_OBJECT                     *content_type;
00147         X509_ALGOR                      *algorithm;
00148         ASN1_OCTET_STRING               *enc_data;      /* [ 0 ] */
00149         const EVP_CIPHER                *cipher;
00150         } PKCS7_ENC_CONTENT;
00151 
00152 typedef struct pkcs7_enveloped_st
00153         {
00154         ASN1_INTEGER                    *version;       /* version 0 */
00155         STACK_OF(PKCS7_RECIP_INFO)      *recipientinfo;
00156         PKCS7_ENC_CONTENT               *enc_data;
00157         } PKCS7_ENVELOPE;
00158 
00159 typedef struct pkcs7_signedandenveloped_st
00160         {
00161         ASN1_INTEGER                    *version;       /* version 1 */
00162         STACK_OF(X509_ALGOR)            *md_algs;       /* md used */
00163         STACK_OF(X509)                  *cert;          /* [ 0 ] */
00164         STACK_OF(X509_CRL)              *crl;           /* [ 1 ] */
00165         STACK_OF(PKCS7_SIGNER_INFO)     *signer_info;
00166 
00167         PKCS7_ENC_CONTENT               *enc_data;
00168         STACK_OF(PKCS7_RECIP_INFO)      *recipientinfo;
00169         } PKCS7_SIGN_ENVELOPE;
00170 
00171 typedef struct pkcs7_digest_st
00172         {
00173         ASN1_INTEGER                    *version;       /* version 0 */
00174         X509_ALGOR                      *md;            /* md used */
00175         struct pkcs7_st                 *contents;
00176         ASN1_OCTET_STRING               *digest;
00177         } PKCS7_DIGEST;
00178 
00179 typedef struct pkcs7_encrypted_st
00180         {
00181         ASN1_INTEGER                    *version;       /* version 0 */
00182         PKCS7_ENC_CONTENT               *enc_data;
00183         } PKCS7_ENCRYPT;
00184 
00185 typedef struct pkcs7_st
00186         {
00187         /* The following is non NULL if it contains ASN1 encoding of
00188          * this structure */
00189         unsigned char *asn1;
00190         long length;
00191 
00192 #define PKCS7_S_HEADER  0
00193 #define PKCS7_S_BODY    1
00194 #define PKCS7_S_TAIL    2
00195         int state; /* used during processing */
00196 
00197         int detached;
00198 
00199         ASN1_OBJECT *type;
00200         /* content as defined by the type */
00201         /* all encryption/message digests are applied to the 'contents',
00202          * leaving out the 'type' field. */
00203         union   {
00204                 char *ptr;
00205 
00206                 /* NID_pkcs7_data */
00207                 ASN1_OCTET_STRING *data;
00208 
00209                 /* NID_pkcs7_signed */
00210                 PKCS7_SIGNED *sign;
00211 
00212                 /* NID_pkcs7_enveloped */
00213                 PKCS7_ENVELOPE *enveloped;
00214 
00215                 /* NID_pkcs7_signedAndEnveloped */
00216                 PKCS7_SIGN_ENVELOPE *signed_and_enveloped;
00217 
00218                 /* NID_pkcs7_digest */
00219                 PKCS7_DIGEST *digest;
00220 
00221                 /* NID_pkcs7_encrypted */
00222                 PKCS7_ENCRYPT *encrypted;
00223 
00224                 /* Anything else */
00225                 ASN1_TYPE *other;
00226                 } d;
00227         } PKCS7;
00228 
00229 DECLARE_STACK_OF(PKCS7)
00230 DECLARE_ASN1_SET_OF(PKCS7)
00231 DECLARE_PKCS12_STACK_OF(PKCS7)
00232 
00233 #define PKCS7_OP_SET_DETACHED_SIGNATURE 1
00234 #define PKCS7_OP_GET_DETACHED_SIGNATURE 2
00235 
00236 #define PKCS7_get_signed_attributes(si) ((si)->auth_attr)
00237 #define PKCS7_get_attributes(si)        ((si)->unauth_attr)
00238 
00239 #define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
00240 #define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
00241 #define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
00242 #define PKCS7_type_is_signedAndEnveloped(a) \
00243                 (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
00244 #define PKCS7_type_is_data(a)   (OBJ_obj2nid((a)->type) == NID_pkcs7_data)
00245 
00246 #define PKCS7_type_is_digest(a)   (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)
00247 
00248 #define PKCS7_set_detached(p,v) \
00249                 PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)
00250 #define PKCS7_get_detached(p) \
00251                 PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)
00252 
00253 #define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
00254 
00255 #ifdef SSLEAY_MACROS
00256 #ifndef PKCS7_ISSUER_AND_SERIAL_digest
00257 #define PKCS7_ISSUER_AND_SERIAL_digest(data,type,md,len) \
00258         ASN1_digest((int (*)())i2d_PKCS7_ISSUER_AND_SERIAL,type,\
00259                         (char *)data,md,len)
00260 #endif
00261 #endif
00262 
00263 /* S/MIME related flags */
00264 
00265 #define PKCS7_TEXT              0x1
00266 #define PKCS7_NOCERTS           0x2
00267 #define PKCS7_NOSIGS            0x4
00268 #define PKCS7_NOCHAIN           0x8
00269 #define PKCS7_NOINTERN          0x10
00270 #define PKCS7_NOVERIFY          0x20
00271 #define PKCS7_DETACHED          0x40
00272 #define PKCS7_BINARY            0x80
00273 #define PKCS7_NOATTR            0x100
00274 #define PKCS7_NOSMIMECAP        0x200
00275 #define PKCS7_NOOLDMIMETYPE     0x400
00276 #define PKCS7_CRLFEOL           0x800
00277 #define PKCS7_STREAM            0x1000
00278 #define PKCS7_NOCRL             0x2000
00279 
00280 /* Flags: for compatibility with older code */
00281 
00282 #define SMIME_TEXT      PKCS7_TEXT
00283 #define SMIME_NOCERTS   PKCS7_NOCERTS
00284 #define SMIME_NOSIGS    PKCS7_NOSIGS
00285 #define SMIME_NOCHAIN   PKCS7_NOCHAIN
00286 #define SMIME_NOINTERN  PKCS7_NOINTERN
00287 #define SMIME_NOVERIFY  PKCS7_NOVERIFY
00288 #define SMIME_DETACHED  PKCS7_DETACHED
00289 #define SMIME_BINARY    PKCS7_BINARY
00290 #define SMIME_NOATTR    PKCS7_NOATTR
00291 
00292 DECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)
00293 
00294 #ifndef SSLEAY_MACROS
00295 IMPORT_C int PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,const EVP_MD *type,
00296         unsigned char *md,unsigned int *len);
00297 #ifndef OPENSSL_NO_FP_API
00298 IMPORT_C PKCS7 *d2i_PKCS7_fp(FILE *fp,PKCS7 **p7);
00299 IMPORT_C int i2d_PKCS7_fp(FILE *fp,PKCS7 *p7);
00300 #endif
00301 IMPORT_C PKCS7 *PKCS7_dup(PKCS7 *p7);
00302 IMPORT_C PKCS7 *d2i_PKCS7_bio(BIO *bp,PKCS7 **p7);
00303 IMPORT_C int i2d_PKCS7_bio(BIO *bp,PKCS7 *p7);
00304 #endif
00305 
00306 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)
00307 DECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)
00308 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)
00309 DECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)
00310 DECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)
00311 DECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)
00312 DECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)
00313 DECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)
00314 DECLARE_ASN1_FUNCTIONS(PKCS7)
00315 
00316 DECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)
00317 DECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)
00318 
00319 DECLARE_ASN1_NDEF_FUNCTION(PKCS7)
00320 
00321 IMPORT_C long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);
00322 
00323 IMPORT_C int PKCS7_set_type(PKCS7 *p7, int type);
00324 IMPORT_C int PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);
00325 IMPORT_C int PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);
00326 IMPORT_C int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,
00327         const EVP_MD *dgst);
00328 IMPORT_C int PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);
00329 IMPORT_C int PKCS7_add_certificate(PKCS7 *p7, X509 *x509);
00330 IMPORT_C int PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);
00331 IMPORT_C int PKCS7_content_new(PKCS7 *p7, int nid);
00332 IMPORT_C int PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,
00333         BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si); 
00334 IMPORT_C int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,
00335                                                                 X509 *x509);
00336 
00337 IMPORT_C BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);
00338 IMPORT_C int PKCS7_dataFinal(PKCS7 *p7, BIO *bio);
00339 IMPORT_C BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);
00340 
00341 
00342 IMPORT_C PKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,
00343         EVP_PKEY *pkey, const EVP_MD *dgst);
00344 IMPORT_C X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);
00345 IMPORT_C int PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);
00346 IMPORT_C STACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);
00347 
00348 IMPORT_C PKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);
00349 IMPORT_C int PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);
00350 IMPORT_C int PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);
00351 IMPORT_C int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);
00352 
00353 IMPORT_C PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);
00354 IMPORT_C ASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);
00355 IMPORT_C int PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si,int nid,int type,
00356         void *data);
00357 IMPORT_C int PKCS7_add_attribute (PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,
00358         void *value);
00359 IMPORT_C ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);
00360 IMPORT_C ASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);
00361 IMPORT_C int PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,
00362                                 STACK_OF(X509_ATTRIBUTE) *sk);
00363 IMPORT_C int PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,STACK_OF(X509_ATTRIBUTE) *sk);
00364 
00365 
00366 IMPORT_C PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,
00367                                                         BIO *data, int flags);
00368 IMPORT_C int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,
00369                                         BIO *indata, BIO *out, int flags);
00370 IMPORT_C STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags);
00371 IMPORT_C PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,
00372                                                                 int flags);
00373 IMPORT_C int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags);
00374 
00375 IMPORT_C int PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,
00376                               STACK_OF(X509_ALGOR) *cap);
00377 IMPORT_C STACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);
00378 IMPORT_C int PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);
00379 
00380 IMPORT_C int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);
00381 IMPORT_C PKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);
00382 IMPORT_C int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
00383 IMPORT_C int SMIME_text(BIO *in, BIO *out);
00384 
00385 /* BEGIN ERROR CODES */
00386 /* The following lines are auto generated by the script mkerr.pl. Any changes
00387  * made after this point may be overwritten when the script is next run.
00388  */
00389 IMPORT_C void ERR_load_PKCS7_strings(void);
00390 
00391 /* Error codes for the PKCS7 functions. */
00392 
00393 /* Function codes. */
00394 #define PKCS7_F_B64_READ_PKCS7                           120
00395 #define PKCS7_F_B64_WRITE_PKCS7                          121
00396 #define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP                118
00397 #define PKCS7_F_PKCS7_ADD_CERTIFICATE                    100
00398 #define PKCS7_F_PKCS7_ADD_CRL                            101
00399 #define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO                 102
00400 #define PKCS7_F_PKCS7_ADD_SIGNER                         103
00401 #define PKCS7_F_PKCS7_BIO_ADD_DIGEST                     125
00402 #define PKCS7_F_PKCS7_CTRL                               104
00403 #define PKCS7_F_PKCS7_DATADECODE                         112
00404 #define PKCS7_F_PKCS7_DATAFINAL                          128
00405 #define PKCS7_F_PKCS7_DATAINIT                           105
00406 #define PKCS7_F_PKCS7_DATASIGN                           106
00407 #define PKCS7_F_PKCS7_DATAVERIFY                         107
00408 #define PKCS7_F_PKCS7_DECRYPT                            114
00409 #define PKCS7_F_PKCS7_ENCRYPT                            115
00410 #define PKCS7_F_PKCS7_FIND_DIGEST                        127
00411 #define PKCS7_F_PKCS7_GET0_SIGNERS                       124
00412 #define PKCS7_F_PKCS7_SET_CIPHER                         108
00413 #define PKCS7_F_PKCS7_SET_CONTENT                        109
00414 #define PKCS7_F_PKCS7_SET_DIGEST                         126
00415 #define PKCS7_F_PKCS7_SET_TYPE                           110
00416 #define PKCS7_F_PKCS7_SIGN                               116
00417 #define PKCS7_F_PKCS7_SIGNATUREVERIFY                    113
00418 #define PKCS7_F_PKCS7_SIMPLE_SMIMECAP                    119
00419 #define PKCS7_F_PKCS7_VERIFY                             117
00420 #define PKCS7_F_SMIME_READ_PKCS7                         122
00421 #define PKCS7_F_SMIME_TEXT                               123
00422 
00423 /* Reason codes. */
00424 #define PKCS7_R_CERTIFICATE_VERIFY_ERROR                 117
00425 #define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER          144
00426 #define PKCS7_R_CIPHER_NOT_INITIALIZED                   116
00427 #define PKCS7_R_CONTENT_AND_DATA_PRESENT                 118
00428 #define PKCS7_R_DECODE_ERROR                             130
00429 #define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH            100
00430 #define PKCS7_R_DECRYPT_ERROR                            119
00431 #define PKCS7_R_DIGEST_FAILURE                           101
00432 #define PKCS7_R_ERROR_ADDING_RECIPIENT                   120
00433 #define PKCS7_R_ERROR_SETTING_CIPHER                     121
00434 #define PKCS7_R_INVALID_MIME_TYPE                        131
00435 #define PKCS7_R_INVALID_NULL_POINTER                     143
00436 #define PKCS7_R_MIME_NO_CONTENT_TYPE                     132
00437 #define PKCS7_R_MIME_PARSE_ERROR                         133
00438 #define PKCS7_R_MIME_SIG_PARSE_ERROR                     134
00439 #define PKCS7_R_MISSING_CERIPEND_INFO                    103
00440 #define PKCS7_R_NO_CONTENT                               122
00441 #define PKCS7_R_NO_CONTENT_TYPE                          135
00442 #define PKCS7_R_NO_MULTIPART_BODY_FAILURE                136
00443 #define PKCS7_R_NO_MULTIPART_BOUNDARY                    137
00444 #define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE         115
00445 #define PKCS7_R_NO_RECIPIENT_MATCHES_KEY                 146
00446 #define PKCS7_R_NO_SIGNATURES_ON_DATA                    123
00447 #define PKCS7_R_NO_SIGNERS                               142
00448 #define PKCS7_R_NO_SIG_CONTENT_TYPE                      138
00449 #define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE     104
00450 #define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR                124
00451 #define PKCS7_R_PKCS7_DATAFINAL                          126
00452 #define PKCS7_R_PKCS7_DATAFINAL_ERROR                    125
00453 #define PKCS7_R_PKCS7_DATASIGN                           145
00454 #define PKCS7_R_PKCS7_PARSE_ERROR                        139
00455 #define PKCS7_R_PKCS7_SIG_PARSE_ERROR                    140
00456 #define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE   127
00457 #define PKCS7_R_SIGNATURE_FAILURE                        105
00458 #define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND             128
00459 #define PKCS7_R_SIG_INVALID_MIME_TYPE                    141
00460 #define PKCS7_R_SMIME_TEXT_ERROR                         129
00461 #define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE               106
00462 #define PKCS7_R_UNABLE_TO_FIND_MEM_BIO                   107
00463 #define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST            108
00464 #define PKCS7_R_UNKNOWN_DIGEST_TYPE                      109
00465 #define PKCS7_R_UNKNOWN_OPERATION                        110
00466 #define PKCS7_R_UNSUPPORTED_CIPHER_TYPE                  111
00467 #define PKCS7_R_UNSUPPORTED_CONTENT_TYPE                 112
00468 #define PKCS7_R_WRONG_CONTENT_TYPE                       113
00469 #define PKCS7_R_WRONG_PKCS7_TYPE                         114
00470 
00471 #ifdef  __cplusplus
00472 }
00473 #endif
00474 #endif

Copyright © Nokia Corporation 2001-2008
Back to top