Change the authorization sequence
[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                 ByteArray refreshTag;
39
40                 static ByteArray OID_GLOBALPLATFORM;
41
42                 int loadAccessControl(Channel *channel, PKCS15DODF *dodf);
43                 int loadRules(Channel *channel, ByteArray path);
44                 int loadAccessConditions(Channel *channel, ByteArray aid, ByteArray path);
45
46         public:
47                 GPSEACL();
48                 ~GPSEACL();
49
50                 int loadACL(Channel *channel);
51
52         };
53
54 } /* namespace smartcard_service_api */
55 #endif /* __cplusplus */
56
57 /* export C API */
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif /* __cplusplus */
62
63 typedef void *gp_se_acl_h;
64
65 gp_se_acl_h gp_se_acl_create_instance();
66 int gp_se_acl_load_acl(gp_se_acl_h handle, channel_h channel);
67 int gp_se_acl_update_acl(gp_se_acl_h handle, channel_h channel);
68 void gp_se_acl_release_acl(gp_se_acl_h handle);
69 bool gp_se_acl_is_authorized_access(gp_se_acl_h handle, unsigned char *aidBuffer, unsigned int aidLength, unsigned char *certHashBuffer, unsigned int certHashLength);
70 void gp_se_acl_destroy_instance(gp_se_acl_h handle);
71
72 #ifdef __cplusplus
73 }
74 #endif /* __cplusplus */
75
76 #endif /* GPSEACL_H_ */