update the latest source
[platform/core/connectivity/smartcard-service.git] / common / include / GPSEACL.h
1 /*
2 * Copyright (c) 2012 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
18 #ifndef GPSEACL_H_
19 #define GPSEACL_H_
20
21 /* standard library header */
22
23 /* SLP library header */
24
25 /* local header */
26 #include "smartcard-types.h"
27 #ifdef __cplusplus
28 #include "AccessControlList.h"
29 #include "PKCS15.h"
30 #endif /* __cplusplus */
31
32 #ifdef __cplusplus
33 namespace smartcard_service_api
34 {
35         class GPSEACL: public AccessControlList
36         {
37         private:
38                 PKCS15 *pkcs15;
39                 ByteArray refreshTag;
40
41                 static ByteArray OID_GLOBALPLATFORM;
42
43                 int loadAccessControl(PKCS15DODF *dodf);
44                 int loadRules(ByteArray path);
45                 int loadAccessConditions(ByteArray aid, ByteArray path);
46
47         public:
48                 GPSEACL(Channel *channel);
49                 ~GPSEACL();
50
51                 int loadACL();
52
53         };
54
55 } /* namespace smartcard_service_api */
56 #endif /* __cplusplus */
57
58 /* export C API */
59 #ifdef __cplusplus
60 extern "C"
61 {
62 #endif /* __cplusplus */
63
64 typedef void *gp_se_acl_h;
65
66 gp_se_acl_h gp_se_acl_create_instance(channel_h channel);
67 int gp_se_acl_load_acl(gp_se_acl_h handle);
68 int gp_se_acl_update_acl(gp_se_acl_h handle);
69 void gp_se_acl_release_acl(gp_se_acl_h handle);
70 bool gp_se_acl_is_authorized_access(gp_se_acl_h handle, unsigned char *aidBuffer, unsigned int aidLength, unsigned char *certHashBuffer, unsigned int certHashLength);
71 void gp_se_acl_destroy_instance(gp_se_acl_h handle);
72
73 #ifdef __cplusplus
74 }
75 #endif /* __cplusplus */
76
77 #endif /* GPSEACL_H_ */