2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file cert_svc_server_main.h
18 * @author Madhan A K (madhan.ak@samsung.com)
20 * @brief cert-server routines.
23 #ifndef CERT_SVC_SERVER_MAIN_H_
24 #define CERT_SVC_SERVER_MAIN_H_
28 int getCertificateDetailFromStore(sqlite3 *db_handle, CertStoreType storeType, CertType certType, const char* pGname, char* pCertBuffer, size_t *certLength);
30 int getCertificateDetailFromSystemStore(sqlite3 *db_handle, const char* pGname, char* pCertBuffer, size_t *certLength);
32 int deleteCertificateFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname);
34 int getCertificateStatusFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname, CertStatus *status);
36 int setCertificateStatusToStore(sqlite3 *db_handle, CertStoreType storeType, int is_root_app, const char* pGname, CertStatus status);
38 int checkAliasExistsInStore(sqlite3 *db_handle, CertStoreType storeType, const char* alias, int *isUnique);
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);
42 int getCertificateListFromStore(sqlite3 *db_handle, int reqType, CertStoreType storeType, int is_root_app, char **ppCertListBuffer, size_t *bufferLen, size_t *certCount);
44 int getCertificateAliasFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname, char* alias);
46 int loadCertificatesFromStore(sqlite3 *db_handle, CertStoreType storeType, const char* pGname, char **ppCertBlockBuffer, size_t *bufferLen, size_t *certBlockCount);
48 int update_ca_certificate_file(sqlite3 *db_handle, char *certBuffer, size_t certLength);