Eneboo - Documentación para desarrolladores
|
00001 #ifndef __DIGIDOC_SAX_PARSER_H__ 00002 #define __DIGIDOC_SAX_PARSER_H__ 00003 //================================================== 00004 // FILE: DigiDocSAXParser.h 00005 // PROJECT: Digi Doc 00006 // DESCRIPTION: Digi Doc functions for xml parsing using SAX interface 00007 // This is the older parser and will probably 00008 // be removed in new versions 00009 // AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia 00010 //================================================== 00011 // Copyright (C) AS Sertifitseerimiskeskus 00012 // This library is free software; you can redistribute it and/or 00013 // modify it under the terms of the GNU Lesser General Public 00014 // License as published by the Free Software Foundation; either 00015 // version 2.1 of the License, or (at your option) any later version. 00016 // This library is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 // Lesser General Public License for more details. 00020 // GNU Lesser General Public Licence is available at 00021 // http://www.gnu.org/copyleft/lesser.html 00022 //==========< HISTORY >============================= 00023 // 12.08.2004 Veiko Sinivee 00024 // Creation 00025 // 22.08.2004 Veiko Sinivee 00026 // Renamed readSignedDoc() to ddocSaxReadSignedDocFromFile(). Params changed. 00027 // Renamed extractDataFile() to ddocSaxExtractDataFile(). Uses chached content. 00028 //================================================== 00029 00030 #include <libdigidoc/DigiDocDefs.h> 00031 #include <libdigidoc/DigiDocLib.h> 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 //-------------------------------------------------- 00038 // Reads in signed XML document info from digidoc file 00039 // ppSigDoc - pointer to the buffer of newly read info pointer 00040 // szFileName - documents filename 00041 // checkFileDigest - indicates if digests of datafiles referred by the document must be checked 00042 // lMaxDFLen - maximum size for a DataFile whose contents will be 00043 // kept in memory 00044 //-------------------------------------------------- 00045 EXP_OPTION int ddocSaxReadSignedDocFromFile(SignedDoc** ppSigDoc, const char* szFileName, 00046 int checkFileDigest, long lMaxDFLen); 00047 00048 //-------------------------------------------------- 00049 // Reads in signed XML document and extracts the desired data file 00050 // pSigDoc - signed document object if exists. Can be NULL 00051 // szFileName - digidoc filename 00052 // szDataFileName - name of the file where to store embedded data. 00053 // szDocId - DataFile Id atribute value 00054 // szCharset - convert DataFile content to charset 00055 //-------------------------------------------------- 00056 EXP_OPTION int ddocSaxExtractDataFile(SignedDoc* pSigDoc, const char* szFileName, const char* szDataFileName, 00057 const char* szDocId, const char* szCharset); 00058 00059 //-------------------------------------------------- 00060 // Reads in signed XML document and returns the 00061 // desired DataFile-s content in a memory buffer. 00062 // caller is responsible for freeing the memory. 00063 // pSigDoc - signed document object if cached 00064 // szFileName - name of digidoc file 00065 // szDocId - id if DataFile 00066 // pBuf - address of buffer pointer 00067 // bKeepBase64 - 1=don't decode base64, 0=decode base64 00068 // returns error code or ERR_OK 00069 //-------------------------------------------------- 00070 EXP_OPTION int ddocSAXGetDataFile(SignedDoc* pSigDoc, const char* szFileName, 00071 const char* szDocId, DigiDocMemBuf* pBuf, 00072 int bKeepBase64); 00073 00074 //-------------------------------------------------- 00075 // Reads in signed XML document info from memory buffer 00076 // ppSigDoc - pointer to the buffer of newly read info pointer 00077 // szFileName - documents filename 00078 // checkFileDigest - indicates if digests of datafiles referred by the document must be checked 00079 // lMaxDFLen - maximum size for a DataFile whose contents will be 00080 // kept in memory 00081 //-------------------------------------------------- 00082 EXP_OPTION int ddocSaxReadSignedDocFromMemory(SignedDoc** ppSigDoc, const void* pData, 00083 int len, long lMaxDFLen); 00084 00085 //-------------------------------------------------- 00086 // Reads new signatures from another digidoc file 00087 // and adds to existing digidoc. Adds only those 00088 // signatures that don't exist in old digidoc. 00089 // pSigDoc - signed document object 00090 // szFileName - name of digidoc file 00091 // returns error code or ERR_OK 00092 //-------------------------------------------------- 00093 EXP_OPTION int ddocReadNewSignaturesFromDdoc(SignedDoc* pSigDoc, const char* szFileName); 00094 00095 00096 #ifdef __cplusplus 00097 } 00098 #endif 00099 00100 00101 #endif // __DIGIDOC_SAX_PARSER_H__ 00102