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 SECURITYRESOURCEMANAGER_H_
22 #define SECURITYRESOURCEMANAGER_H_
29 * @brief Register Persistent storage callback.
30 * @param persistentStorageHandler [IN] Pointers to open, read, write, close & unlink handlers.
32 * OC_STACK_OK - No errors; Success
33 * OC_STACK_INVALID_PARAM - Invalid parameter
35 OCStackResult SRMRegisterPersistentStorageHandler(OCPersistentStorage* persistentStorageHandler);
38 * @brief Get Persistent storage handler pointer.
40 * The pointer to Persistent Storage callback handler
42 OCPersistentStorage* SRMGetPersistentStorageHandler();
45 * @brief Register request and response callbacks.
46 * Requests and responses are delivered in these callbacks.
47 * @param reqHandler [IN] Request handler callback ( for GET,PUT ..etc)
48 * @param respHandler [IN] Response handler callback.
49 * @param errHandler [IN] Error handler callback.
51 * OC_STACK_OK - No errors; Success
52 * OC_STACK_INVALID_PARAM - Invalid parameter
54 OCStackResult SRMRegisterHandler(CARequestCallback reqHandler,
55 CAResponseCallback respHandler,
56 CAErrorCallback errHandler);
59 * @brief Initialize all secure resources ( /oic/sec/cred, /oic/sec/acl, /oic/sec/pstat etc).
60 * @return OC_STACK_OK for Success, otherwise some error value
62 OCStackResult SRMInitSecureResources();
65 * @brief Perform cleanup for secure resources ( /oic/sec/cred, /oic/sec/acl, /oic/sec/pstat etc).
68 void SRMDeInitSecureResources();
71 * @brief Initialize Policy Engine context.
72 * @return OC_STACK_OK for Success, otherwise some error value.
74 OCStackResult SRMInitPolicyEngine();
77 * @brief Cleanup Policy Engine context.
80 void SRMDeInitPolicyEngine();
86 #endif /* SECURITYRESOURCEMANAGER_H_ */