1 //******************************************************************
3 // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef IOTVT_SRM_ACLR_H
22 #define IOTVT_SRM_ACLR_H
29 * Initialize ACL resource by loading data from persistent storage.
31 * @retval OC_STACK_OK for Success, otherwise some error value
33 OCStackResult InitACLResource();
36 * Perform cleanup for ACL resources.
40 void DeInitACLResource();
43 * This method is used by PolicyEngine to retrieve ACL for a Subject.
45 * @param subjectId ID of the subject for which ACL is required.
46 * @param savePtr is used internally by @ref GetACLResourceData to maintain index between
47 * successive calls for same subjectId.
49 * @retval reference to @ref OicSecAcl_t if ACL is found, else NULL
51 * @note On the first call to @ref GetACLResourceData, savePtr should point to NULL
53 const OicSecAcl_t* GetACLResourceData(const OicUuid_t* subjectId, OicSecAcl_t **savePtr);
56 * This function converts ACL data into JSON format.
57 * Caller needs to invoke 'free' when done using
59 * @param acl instance of OicSecAcl_t structure.
61 * @retval pointer to ACL in json format.
63 char* BinToAclJSON(const OicSecAcl_t * acl);
67 * This function deletes ACL data.
69 * @param acl instance of OicSecAcl_t structure.
71 void DeleteACLList(OicSecAcl_t* acl);
75 * This function installs a new ACL.
76 * @param newJsonStr JSON string representing a new ACL.
78 * @retval OC_STACK_OK for Success, otherwise some error value
80 OCStackResult InstallNewACL(const char* newJsonStr);
83 * This function updates default ACL which is required for ownership transfer.
84 * This function should be invoked after OTM is complete to prevent anonymous user access.
86 * @retval OC_STACK_OK for Success, otherwise some error value
88 OCStackResult UpdateDefaultSecProvACL();
94 #endif //IOTVT_SRM_ACLR_H