Refactoring cert-server
[platform/core/security/cert-svc.git] / vcore / 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-server-logic.h
18  * @author   Madhan A K (madhan.ak@samsung.com)
19  * @version  1.0
20  * @brief    cert-server routines.
21  */
22
23 #ifndef CERT_SERVER_LOGIC_H_
24 #define CERT_SERVER_LOGIC_H_
25
26 int getCertificateDetailFromStore(CertStoreType storeType, CertType certType, const char* gname, char* cert);
27
28 int getCertificateDetailFromSystemStore(const char* gname, char* cert);
29
30 int deleteCertificateFromStore(CertStoreType storeType, const char* gname);
31
32 int getCertificateStatusFromStore(CertStoreType storeType, const char* gname, CertStatus *status);
33
34 int setCertificateStatusToStore(CertStoreType storeType, int is_root_app, const char* gname, CertStatus status);
35
36 int checkAliasExistsInStore(CertStoreType storeType, const char* alias, int *punique);
37
38 int installCertificateToStore(CertStoreType storeType, const char* gname, const char *common_name, const char *private_key_gname, const char *associated_gname, const char *pCertBuffer, CertType certType);
39
40 int getCertificateListFromStore(int reqType, CertStoreType storeType, int is_root_app, char **ppCertListBuffer, size_t *bufferLen, size_t *certCount);
41
42 int getCertificateAliasFromStore(CertStoreType storeType, const char* gname, char* alias);
43
44 int loadCertificatesFromStore(CertStoreType storeType, const char* gname, char **ppCertBlockBuffer, size_t *bufferLen, size_t *certBlockCount);
45
46 int update_ca_certificate_file(char *cert);
47
48 #endif