Refactor SignatureValidator and reduce interface headers
[platform/core/security/cert-svc.git] / vcore / src / cert-svc / ccrl.h
1 /**
2  * Copyright (c) 2011 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        ccrl.h
18  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
19  * @version     1.0
20  * @brief       This is part of C api for ValidationCore.
21  */
22 #ifndef _CERTSVC_CCRL_H_
23 #define _CERTSVC_CCRL_H_
24
25 #include <time.h>
26
27 #include <cert-svc/ccert.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define CERTSVC_CRL_GOOD                 (1<<0)
34 #define CERTSVC_CRL_REVOKED              (1<<1)
35 #define CERTSVC_CRL_VERIFICATION_ERROR   (1<<3)
36 #define CERTSVC_CRL_NO_SUPPORT           (1<<4)
37
38 typedef void (*CertSvcCrlCacheWrite)(
39     const char *distributionPoint,
40     const char *body,
41     int bodySize,
42     time_t nextUpdateTime,
43     void *userParam);
44
45 typedef int (*CertSvcCrlCacheRead)(
46     const char *distributionPoint,
47     char **body,
48     int *bodySize,
49     time_t *nextUpdateTime,
50     void *userParam);
51
52 typedef void (*CertSvcCrlFree)(
53     char *buffer,
54     void *userParam);
55
56 void certsvc_crl_cache_functions(
57     CertSvcInstance instance,
58     CertSvcCrlCacheWrite writePtr,
59     CertSvcCrlCacheRead readPtr,
60     CertSvcCrlFree freePtr);
61
62 int certsvc_crl_check(
63     CertSvcCertificate certificate,
64     CertSvcCertificate *trustedStore,
65     int storeSize,
66     int force,
67     int *status,
68     void *userParam);
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif
75