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_AMACLR_H
22 #define IOTVT_SRM_AMACLR_H
27 * This file contains the APIs for the /oic/sec/amacl resource is an ACL structure that
28 * specifies which resources will use an Access Manager Service (AMS) to resolve access decisions.
29 * It dynamically obtains an ACL using an AMS.
37 * Initialize Amacl resource by loading data from persistent storage.
39 * @retval OC_STACK_OK for Success, otherwise some error value
41 OCStackResult InitAmaclResource();
44 * Perform cleanup for Amacl resources.
48 void DeInitAmaclResource();
51 * This method is used by PolicyEngine to retrieve Amacl for a Subject.
53 * @param subjectId ID of the subject for which Amacl is required.
54 * @param savePtr is used internally by @ref GetAmaclResourceData to maintain index between
55 * successive calls for same subjectId.
57 * @retval reference to @ref OicSecAmacl_t if Amacl is found, else NULL
59 * @note On the first call to @ref GetAmaclResourceData, savePtr should point to NULL
61 const OicSecAmacl_t* GetAmaclResourceData(const OicUuid_t* subjectId, OicSecAmacl_t **savePtr);
64 * This function converts Amacl data into JSON format.
65 * Caller needs to invoke 'free' when done using
67 * @param Amacl instance of OicSecAmacl_t structure.
69 * @retval pointer to Amacl in json format.
71 char* BinToAmaclJSON(const OicSecAmacl_t * amacl);
77 #endif //IOTVT_SRM_AMACLR_H