Imported Upstream version 1.1.1
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / internal / credentialgenerator.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 PM_CREDENTIAL_GENERATOR_H
22 #define PM_CREDENTIAL_GENERATOR_H
23
24 #include "ocstack.h"
25 #include "securevirtualresourcetypes.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif // __cplusplus
30
31 /**
32  * Function to generate credentials according to the type.
33  *
34  * @param[in]  type           Type of credential.
35  * @param[in]  keysize        size of key.
36  * @param[in]  ptDeviceId     Device ID of provisioning tool.
37  * @param[in]  firstDeviceId  DeviceID of the first device.
38  * @param[in]  secondDeviceId DeviceID of the second device.
39  * @param[out] firstCred      Generated credential for first device.
40  * @param[out] secondCred     Generated credential for second device.
41  * @return  OC_STACK_OK on success
42  */
43 OCStackResult PMGeneratePairWiseCredentials(OicSecCredType_t type, size_t keySize,
44                                        const OicUuid_t *ptDeviceId,
45                                        const OicUuid_t *firstDeviceId,
46                                        const OicUuid_t *secondDeviceId,
47                                        OicSecCred_t **firstCred,
48                                        OicSecCred_t **secondCred);
49
50 /**
51  * Function to generate certificate credentials.
52  *
53  * @param[in]  ptDeviceId     Device ID of provisioning tool.
54  * @param[in]  deviceId       DeviceID of the device.
55  * @param[out] cred           Generated credential for device.
56  * @return  OC_STACK_OK on success
57  */
58 OCStackResult PMGenerateCertificateCredentials(const OicUuid_t *ptDeviceId,
59                                           const OicUuid_t *deviceId, OicSecCred_t **cred);
60
61 #ifdef __cplusplus
62 }
63 #endif
64 #endif //PM_CREDENTIAL_GENERATOR_H