0388c3e783e8b602c7f21c26b22004e4ba366a8c
[platform/core/security/cert-svc.git] / vcore / src / server / include / cert-server-logic.h
1 /**
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *  http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16 /**
17  * @file     cert_svc_server_main.h
18  * @author   Madhan A K (madhan.ak@samsung.com)
19  * @version  1.0
20  * @brief    cert-server routines.
21  */
22
23 #ifndef CERT_SVC_SERVER_MAIN_H_
24 #define CERT_SVC_SERVER_MAIN_H_
25
26 #include <db-util.h>
27
28 int getCertificateDetailFromStore(sqlite3 *db_handle, CertStoreType storeType, CertType certType, const char* pGname, char* pCertBuffer, size_t *certLength);
29
30 int getCertificateDetailFromSystemStore(sqlite3 *db_handle, const char* pGname, char* pCertBuffer, size_t *certLength);
31
32 int deleteCertificateFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname);
33
34 int getCertificateStatusFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname, CertStatus *status);
35
36 int setCertificateStatusToStore(sqlite3 *db_handle, CertStoreType storeType, int is_root_app, const char* pGname, CertStatus status);
37
38 int checkAliasExistsInStore(sqlite3 *db_handle, CertStoreType storeType, const char* alias, int *isUnique);
39
40 int installCertificateToStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname, const char *common_name, const char *private_key_gname, const char *associated_gname, const char *pCertBuffer, size_t certLength, CertType certType);
41
42 int getCertificateListFromStore(sqlite3 *db_handle,  int reqType, CertStoreType storeType, int is_root_app, char **ppCertListBuffer, size_t *bufferLen, size_t *certCount);
43
44 int getCertificateAliasFromStore(sqlite3 *db_handle,  CertStoreType storeType, const char* pGname, char* alias);
45
46 int loadCertificatesFromStore(sqlite3 *db_handle,  CertStoreType storeType, const char* pGname, char **ppCertBlockBuffer, size_t *bufferLen, size_t *certBlockCount);
47
48 int update_ca_certificate_file(sqlite3 *db_handle, char *certBuffer, size_t certLength);
49
50 #endif