Eneboo - Documentación para desarrolladores
|
00001 #ifndef __DIGIDOC_DEFS_H__ 00002 #define __DIGIDOC_DEFS_H__ 00003 //================================================== 00004 // FILE: DigiDocDefs.h 00005 // PROJECT: Digi Doc 00006 // DESCRIPTION: Digi Doc global definitions. 00007 // AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia 00008 //================================================== 00009 // Copyright (C) AS Sertifitseerimiskeskus 00010 // This library is free software; you can redistribute it and/or 00011 // modify it under the terms of the GNU Lesser General Public 00012 // License as published by the Free Software Foundation; either 00013 // version 2.1 of the License, or (at your option) any later version. 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details.ode 00018 // GNU Lesser General Public Licence is available at 00019 // http://www.gnu.org/copyleft/lesser.html 00020 //==========< HISTORY >============================= 00021 // 15.06.2005 Veiko Sinivee 00022 //================================================== 00023 00024 00025 #ifdef WIN32 00026 #include <windows.h> 00027 #endif 00028 #ifdef WIN32 00029 //#define WITH_TS // not automatically defined on win32 00030 #ifdef BUILDINGDLL 00031 #ifdef _MSC_VER 00032 #pragma warning( disable: 4100 4706 4204 4221 ) 00033 #endif 00034 #define EXP_OPTION __declspec(dllexport) 00035 #else 00036 #define EXP_OPTION __declspec(dllimport) 00037 #endif 00038 #else 00039 #define EXP_OPTION 00040 #endif 00041 00042 #ifndef WIN32 00043 #if HAVE_CONFIG_H 00044 #include <../config.h> 00045 #define DIGIDOC_VERSION VERSION 00046 #endif 00047 #endif // no win32 00048 // for win32 00049 #ifndef DIGIDOC_VERSION 00050 #define DIGIDOC_VERSION "2.6.0.17" 00051 #endif 00052 00053 #ifdef WIN32 00054 //for _msize function 00055 #define FILESEPARATOR "\\" 00056 #include <malloc.h> 00057 #include <direct.h> 00058 #define snprintf _snprintf 00059 #else 00060 #define FILESEPARATOR "/" 00061 #define DIGI_DOC_LIB 00062 #include <unistd.h> 00063 #define _mkdir mkdir 00064 #define _rmdir rmdir 00065 #define _unlink unlink 00066 #define _tzset tzset 00067 #define _getcwd getcwd 00068 #ifdef __FreeBSD__ 00069 #define _timezone tzone 00070 extern long int tzone; /* default for Estonia, but see initDigiDocLib() */ 00071 #define _daylight daylight 00072 extern int daylight; /* default, but see initDigiDocLib() */ 00073 #else 00074 #define _timezone timezone 00075 #define _daylight daylight 00076 #endif 00077 #endif 00078 00079 #ifdef __APPLE__ 00080 #define __FreeBSD__ 1 00081 #endif 00082 00083 00084 #define WITH_BASE64_HASHING_HACK 1 00085 00086 //#define WITH_DEPRECATED_FUNCTIONS 00087 00088 00089 // old timestamp struct 00090 #define WITH_TIMETSTAMP_STRUCT 00091 00092 #ifndef byte 00093 typedef unsigned char byte; 00094 #endif 00095 00096 //==========< Digest types >======================= 00097 00098 #define SIGNATURE_LEN 128 00099 #define DIGEST_LEN 20 00100 #define DIGEST_SHA1 0 00101 #define CERT_DATA_LEN 4096 00102 #define X509_NAME_LEN 256 00103 #define SIGNATURE_RSA 0 00104 #define CONTENT_HASHCODE "HASHCODE" 00105 #define CONTENT_DETATCHED "DETATCHED" 00106 #define CONTENT_EMBEDDED "EMBEDDED" 00107 #define CONTENT_EMBEDDED_BASE64 "EMBEDDED_BASE64" 00108 #define X509_NAME_BUF_LEN 500 00109 00110 //==========< Format types >======================= 00111 00112 #define SK_PKCS7_1 "SK-PKCS#7-1.0" 00113 #define SK_XML_1_NAME "SK-XML" 00114 #define DIGIDOC_XML_1_1_NAME "DIGIDOC-XML" 00115 #define SK_XML_1_VER "1.0" 00116 #define DIGIDOC_XML_1_1_VER "1.1" 00117 #define DIGIDOC_XML_1_2_VER "1.2" 00118 #define DIGIDOC_XML_1_3_VER "1.3" 00119 #ifdef WITH_TS 00120 #define DIGIDOC_XML_1_4_VER "1.4" 00121 #endif 00122 #define SK_NOT_VERSION "OCSP-1.0" 00123 00124 #define DIGEST_SHA1_NAME "sha1" 00125 #define SIGN_RSA_NAME "RSA" 00126 #define OCSP_NONCE_NAME "OCSP Nonce" 00127 #define RESPID_NAME_VALUE "NAME" 00128 #define RESPID_KEY_VALUE "KEY HASH" 00129 #define OCSP_SIG_TYPE "sha1WithRSAEncryption" 00130 #define RESPID_NAME_TYPE 1 00131 #define RESPID_KEY_TYPE 2 00132 00133 #define DIGEST_METHOD_SHA1 "http://www.w3.org/2000/09/xmldsig#sha1" 00134 #define NAMESPACE_XML_DSIG "http://www.w3.org/2000/09/xmldsig#" 00135 #define NAMESPACE_XADES_111 "http://uri.etsi.org/01903/v1.1.1#" 00136 #define NAMESPACE_XADES_132 "http://uri.etsi.org/01903/v1.3.2#" 00137 #define NAMESPACE_XADES "http://uri.etsi.org/01903#" 00138 00139 //==========< Format types >======================= 00140 00141 #define CHARSET_ISO_8859_1 "ISO-8859-1" 00142 #define CHARSET_UTF_8 "UTF-8" 00143 00144 00145 //==========< language codes >======================= 00146 #define DDOC_LANG_ENGLISH 0 00147 #define DDOC_LANG_ESTONIAN 1 00148 #define DDOC_NUM_LANGUAGES 2 00149 #ifdef WITH_TS 00150 #define SUPPORTED_VERSION_COUNT 5 00151 #else 00152 #define SUPPORTED_VERSION_COUNT 4 00153 #endif 00154 00155 //==========< file formats >======================= 00156 00157 #define FILE_FORMAT_ASN1 0 00158 #define FILE_FORMAT_PEM 1 00159 //#define FILE_FORMAT_ 00160 00161 //============< OCSP paramaters >================== 00162 00163 #define OCSP_REQUEST_SIGN_NO 1 00164 #define OCSP_REQUEST_SIGN_CSP 2 00165 #define OCSP_REQUEST_SIGN_X509 3 00166 #define OCSP_REQUEST_SIGN_PKCS11_WIN 4 00167 #define OCSP_REQUEST_SIGN_PKCS12 5 00168 00169 //================== Cert search constants ========= 00170 #define CERT_SEARCH_BY_STORE 1 00171 #define CERT_SEARCH_BY_X509 2 00172 #define CERT_SEARCH_BY_PKCS12 3 00173 00174 // thes can be XOR'ed, then all criterias are used 00175 #define CERT_STORE_SEARCH_BY_SERIAL 0x01 00176 #define CERT_STORE_SEARCH_BY_SUBJECT_DN 0x02 00177 #define CERT_STORE_SEARCH_BY_ISSUER_DN 0x04 00178 #define CERT_STORE_SEARCH_BY_KEY_INFO 0x08 00179 00180 #define FILE_BUFSIZE 1024*16 00181 00182 #endif // __DIGIDOC_DEFS_H__ 00183