Estonian ID Card C-library
DigiDocEncSAXParser.h
1 #ifndef __DIGIDOC_ENC_SAX_PARSER_H__
2 #define __DIGIDOC_ENC_SAX_PARSER_H__
3 //==================================================
4 // FILE: DigiDocEncSAXParser.h
5 // PROJECT: Digi Doc Encryption
6 // DESCRIPTION: DigiDocEnc XML SAX parsing
7 // AUTHOR: Veiko Sinivee, S|E|B IT Partner Estonia
8 //==================================================
9 // Copyright (C) AS Sertifitseerimiskeskus
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 // GNU Lesser General Public Licence is available at
19 // http://www.gnu.org/copyleft/lesser.html
20 //==========< HISTORY >=============================
21 // 11.10.2004 Veiko Sinivee
22 // Creation
23 //==================================================
24 
25 
26 #include <libdigidoc/DigiDocEnc.h>
27 #include <libdigidoc/DigiDocDefs.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33  //--------------------------------------------------
34  // Reads in encrypted XML document.
35  // ppEncData - address for new encrypted data object [REQUIRED]
36  // szFileName - input file name
37  // returns error code or ERR_OK
38  //--------------------------------------------------
39  EXP_OPTION int dencSaxReadEncryptedData(DEncEncryptedData** ppEncData, const char* szFileName);
40 
41  //--------------------------------------------------
42  // Reads in encrypted XML document.
43  // ppEncData - address for new encrypted data object [REQUIRED]
44  // pData - input data [REQUIRED]
45  // returns error code or ERR_OK
46  //--------------------------------------------------
47  EXP_OPTION int dencSaxReadEncryptedDataFromMemory(DEncEncryptedData** ppEncData, DigiDocMemBuf* pData);
48 
49  //--------------------------------------------------
50  // Decrypts an encrypted XML document and stores the
51  // cleartext data in another document. Please note that szCertCN
52  // parameter is no longer required as the users cert will
53  // bea read from smartcard using PKCS#11
54  // szInputFileName - input file name [REQUIRED]
55  // szOutputFileName - output file name [REQUIRED]
56  // szPin - PIN1 of the id-card to decrypt the transport key [REQUIRED]
57  // szPkcs12File - pkcs12 key container filename [OPTIONAL]
58  // returns error code or ERR_OK
59  //--------------------------------------------------
60  EXP_OPTION int dencSaxReadDecryptFile(const char* szInputFileName,
61  const char* szOutputFileName,
62  const char* szPin, const char* szPkcs12File);
63 
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 
70 #endif // __DIGIDOC_ENC_SAX_PARSER_H__
DigiDocMemBuf_st
Definition: DigiDocMem.h:32
DEncEncrytedData_st
Definition: DigiDocEnc.h:60