Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / sample / README-Provisioning-Tool.txt
1 LAST UPDATED 3/28/2016
2
3 To execute Provisioning Tool sample:
4
5 1) Build IoTivity with security enabled:
6
7     $ cd <iotivity-base>
8         $ scons resource SECURED=1
9         
10 2) Verify Provisioning Tool functionality using secure sample apps:
11
12     Run Resource Server Device which needs to be 'provisioned' in the directory:
13     $ ./sampleserver_justworks (Just Works)
14         or
15         $ ./sampleserver_randompin (Random Pin)
16         
17     Run Provisioning Tool Device:
18     $ ./provisioningclient
19     
20     Provisioning Tool will provide prompts for discovery, ownership transfer, and provisioning.
21
22     Enter 10 (Discover All Un/Owned Devices on Network)
23     and you should see the list of discovered owned and unowned devices.
24     
25     Then enter 20 (Register/Own All Discovered Unowned Devices) to perform ownership transfer
26     between the Server device and the Provisioning Tool device.
27
28     If the random pin server is running, you must enter the PIN code that 
29     appears on the server terminal to finish ownership transfer.
30
31     Enter 12 (Discover Only Owned Devices on Network) to confirm that
32     ownership transfer succeeded. If successful,
33     you should find the Server device on the Owned device list.
34     
35  3) Verify Ownership Transfer using sample apps:
36
37     If you would like to check whether ownership transfer successfully 
38     created credentials, replace the server and client sample DAT files
39     with oic_svr_db_client.dat and oic_svr_db_server.dat files from the 
40     ownership transfer as follows:
41     $ cp ./oic_svr_db_client.dat <iotivity-base>/out/<...>/release/resource/csdk/stack/samples/linux/secure/oic_svr_db.client.dat
42     $ cp ./oic_svr_db_server_<...>.dat <iotivity-base>/out/<...>/release/resource/csdk/stack/samples/linux/secure/oic_svr_db.server.dat
43
44     Then move to the sample app directory
45     and execute the server and client apps:
46     $ cd <iotivity-base>/out/release/resource/csdk/stack/samples/linux/secure/
47     $ export LD_LIBRARY_PATH=<iotivity-base>/out/<...>/release/
48     $ ./ocserverbasicops
49     $ ./occlientbasicops -u 0 -t 3
50
51     If successful, the client and server should successfully send and receive payloads.
52
53     All security functionality operate using CBOR data (DAT files).
54     JSON files are for reference only as they are human-readable.
55     JSON files are not used by security-related functions.
56     
57     If you wish to test functionality with data file
58     different from the provided default DAT file, modify the JSON files
59     (oic_svr_db_server_justworks.json, oic_svr_db_server_randompin.json)
60     and then use the JSON-to-CBOR conversion tool
61     (<iotivity-base>/out/<...>/release/resource/csdk/security/tool/json2cbor)
62     to create a new DAT file.