[Patch #1] Refactored provisioning manager
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / internal / secureresourceprovider.h
1 /* *****************************************************************
2  *
3  * Copyright 2015 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
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
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  * *****************************************************************/
20
21 #ifndef SRP_SECURERESOURCEPROVIDER_H
22 #define SRP_SECURERESOURCEPROVIDER_H
23
24 #include "ocstack.h"
25 #include "securevirtualresourcetypes.h"
26 #include "pmtypes.h"
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32
33 /**
34  * API to send ACL information to resource.
35  *
36  * @param[in] selectedDeviceInfo Selected target device.
37  * @param[in] acl ACL to provision.
38  * @param[in] resultCallback callback provided by API user, callback will be called when
39  *            provisioning request recieves a response from resource server.
40  * @return  SP_SUCCESS in case of success and other value otherwise.
41  */
42 OCStackResult SRPProvisionACL(void *ctx, const OCProvisionDev_t *selectedDeviceInfo,
43                                         OicSecAcl_t *acl, OCProvisionResultCB resultCallback);
44
45 /**
46  * API to provision credential to devices.
47  *
48  * @param[in] type Type of credentials to be provisioned to the device.
49  * @param[in] pDev1 Pointer to PMOwnedDeviceInfo_t instance,respresenting resource to be provsioned.
50    @param[in] pDev2 Pointer to PMOwnedDeviceInfo_t instance,respresenting resource to be provsioned.
51  * @param[in] resultCallback callback provided by API user, callback will be called when
52  *            provisioning request recieves a response from first resource server.
53  * @return  OC_STACK_OK in case of success and other value otherwise.
54  */
55 OCStackResult SRPProvisionCredentials(void *ctx,OicSecCredType_t type, size_t keySize,
56                                       const OCProvisionDev_t *pDev1,
57                                       const OCProvisionDev_t *pDev2,
58                                       OCProvisionResultCB resultCallback);
59 #ifdef __cplusplus
60 }
61 #endif
62 #endif //SRP_SECURERESOURCEPROVIDER_H