forked from Caume/CaumeDSE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine_interface.h
87 lines (73 loc) · 5.86 KB
/
engine_interface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/***
Copyright 2010-2012 by Omar Alejandro Herrera Reyna
Caume Data Security Engine, also known as CaumeDSE is released under the
GNU General Public License by the Copyright holder, with the additional
exemption that compiling, linking, and/or using OpenSSL is allowed.
LICENSE
This file is part of Caume Data Security Engine, also called CaumeDSE.
CaumeDSE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CaumeDSE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with CaumeDSE. If not, see <http://www.gnu.org/licenses/>.
INCLUDED SOFTWARE
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).
This product includes cryptographic software written by
Eric Young ([email protected]).
This product includes software written by
Tim Hudson ([email protected]).
This product includes software from the SQLite library that is in
the public domain (http://www.sqlite.org/copyright.html).
This product includes software from the GNU Libmicrohttpd project, Copyright
© 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 , 2011, 2012 Free Software Foundation, Inc.
This product includes software from Perl5, which is Copyright (C) 1993-2005,
by Larry Wall and others.
***/
#ifndef ENGINE_INTERFACE_H_INCLUDED
#define ENGINE_INTERFACE_H_INCLUDED
// Function that deletes a SecureDB (registers from ResourcesDB and column files).
// ~ DELETE CSVFile
int cmeDeleteSecureDB (sqlite3 *pResourcesDB,const char *documentId, const char *orgKey, const char *storagePath);
// Function for unprotecting and importing a secure DB into an insecure SQLite3, memory based, database
int cmeSecureDBToMemDB (sqlite3 **resultDB, sqlite3 *pResourcesDB,const char *documentId,
const char *orgKey, const char *storagePath);
// Function to get all columns for all registers that match columnValues for each columnNames (after decrypting with orgKey).
int cmeGetUnprotectDBRegisters (sqlite3 *pDB, const char *tableName, const char **columnNames,
const char **columnValues,const int numColumnValues, char ***resultRegisterCols,
int *numResultRegisterCols, int *numResultRegisters, const char *orgKey);
// Function to delete all registers that match columnValues for each columnNames (after decrypting with orgKey).
int cmeDeleteUnprotectDBRegisters (sqlite3 *pDB, const char *tableName, const char **columnNames,
const char **columnValues,const int numColumnValues, char ***resultRegisterCols,
int *numResultRegisterCols, int *numResultRegisters, const char *orgKey);
// Function to insert all columns for all registers that match columnValues for each columnNames (encrypting with orgKey before insert).
int cmePostProtectDBRegister (sqlite3 *pDB, const char *tableName, const char **columnNames,
const char **columnValues,const int numColumnValues, const char *orgKey);
// Function to update all registers that match columnValues for each columnNames using columnNamesUpdate=columnValuesUpdate (after decrypting with orgKey).
int cmePutProtectDBRegisters (sqlite3 *pDB, const char *tableName, const char **columnNames,
const char **columnValues,const int numColumnValues, const char **columnNamesUpdate,
const char **columnValuesUpdate,const int numColumnValuesUpdate, char ***resultRegisterCols,
int *numResultRegisterCols, int *numResultRegisters, const char *orgKey);
// Function to process all Match and Save parameters + orgId, userId, orgKey and optional parameter newOrgKey; puts them in corresponding arrays before method execution.
int cmeProcessURLMatchSaveParameters (const char *urlMethod, const char **argumentElements, const char **validNamesToMatch,
const char **validNamesToSave, const int numValidMatch, const int numValidSaves,
char **columnValuesToMatch, char **columnNamesToMatch, char **columnValuesToSave,
char **columnNamesToSave, int *numMatchArgs, int *numSaveArgs, char **userId, char **orgId,
char **orgKey, char **newOrgKey, int *usrArg, int *orgArg, int *keyArg, int *newKeyArg);
// Function to construct a contentRow using id=registerId for POST/PUT requests.
int cmeConstructContentRow (const char **argumentElements, const char **columnNames, const int numColumns,
const char *registerId, char ***newContentRow);
// Function to list number of matching entries for a specified documentId in ResourcesDB database (document table).
int cmeExistsDocumentId (sqlite3 *pResourcesDB,const char *documentId, const char *orgKey,
int *numEntries);
// Function to get all columns for all registers that match columnValues for each columnNames in a transactions DB (after unprotecting them, if required).
int cmeGetUnprotectDBTransactions (sqlite3 *pDB, const char *tableName, const char **columnNames,
const char **columnValues,const int numColumnValues, char ***resultRegisterCols,
int *numResultRegisterCols, int *numResultRegisters, const char *orgKey);
#endif // ENGINE_INTERFACE_H_INCLUDED