Estonian ID Card C-library
DigiDocEncGen.h
1 #ifndef __DIGIDOC_ENC_GEN_H__
2 #define __DIGIDOC_ENC_GEN_H__
3 //==================================================
4 // FILE: DigiDocEncGen.h
5 // PROJECT: Digi Doc Encryption
6 // DESCRIPTION: DigiDocEnc XML generation
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/DigiDocDefs.h>
27 #include <libdigidoc/DigiDocEnc.h>
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33  //--------------------------------------------------
34  // Generates XML for <EncryptedData> element
35  // pEncData - encrypted data object [REQUIRED]
36  // pBuf - memory buffer for storing xml [REQUIRED]
37  // returns error code or ERR_OK
38  //--------------------------------------------------
39  EXP_OPTION int dencGenEncryptedData_toXML(DEncEncryptedData* pEncData, DigiDocMemBuf* pBuf);
40 
41  //--------------------------------------------------
42  // Writes encrypted data to a file
43  // pEncData - encrypted data object [REQUIRED]
44  // szFileName - name of the file to write the data [REQUIRED]
45  // returns error code or ERR_OK
46  //--------------------------------------------------
47  EXP_OPTION int dencGenEncryptedData_writeToFile(DEncEncryptedData* pEncData, const char* szFileName);
48 
49  //--------------------------------------------------
50  // Generates the header of XML for <EncryptedData> element
51  // This contains everything upto the start of base64 encoded cipher data
52  // pEncData - encrypted data object [REQUIRED]
53  // pBuf - memory buffer for storing xml [REQUIRED]
54  // returns error code or ERR_OK
55  //--------------------------------------------------
56  int dencGenEncryptedData_header_toXML(DEncEncryptedData* pEncData, DigiDocMemBuf* pBuf);
57 
58  //--------------------------------------------------
59  // Generates the trailer of XML for <EncryptedData> element
60  // These are all the XML constructs following the
61  // base64 encoded cipher data.
62  // pEncData - encrypted data object [REQUIRED]
63  // pBuf - memory buffer for storing xml [REQUIRED]
64  // returns error code or ERR_OK
65  //--------------------------------------------------
66  int dencGenEncryptedData_trailer_toXML(DEncEncryptedData* pEncData, DigiDocMemBuf* pBuf);
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 
73 #endif // __DIGIDOC_ENC_GEN_H__
74 
Definition: DigiDocEnc.h:60
Definition: DigiDocMem.h:32