Add DPM guide 67/104367/3
authorSungjun, Lee <sjun221.lee@samsung.com>
Tue, 13 Dec 2016 07:45:01 +0000 (16:45 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Tue, 13 Dec 2016 13:31:09 +0000 (15:31 +0200)
PS3: [LB] Reviewed

Change-Id: I95cd772753f8b72f7a43265d332b71996381f63d
Signed-off-by: Sungjun, Lee <sjun221.lee@samsung.com>
org.tizen.guides/html/images/dpm-framework.png [new file with mode: 0644]
org.tizen.guides/html/index.htm
org.tizen.guides/html/native/security/dpm_n.htm [new file with mode: 0644]
org.tizen.guides/html/native/security/security_cover_n.htm
org.tizen.guides/index.xml

diff --git a/org.tizen.guides/html/images/dpm-framework.png b/org.tizen.guides/html/images/dpm-framework.png
new file mode 100644 (file)
index 0000000..8ee6d0a
Binary files /dev/null and b/org.tizen.guides/html/images/dpm-framework.png differ
index 18584e8..106f42a 100644 (file)
                                <li><a href="native/security/secure_key_n.htm">Secure Key Management</a></li>
                                <li><a href="native/security/privilege_n.htm">Privilege Information</a></li>
                                <li><a href="native/security/yaca_n.htm">Cryptographic Operations</a></li>
+                <li><a href="native/security/dpm_n.htm">Device Policy Management</a></li>
                                <li><a href="native/security/security_tip.htm">Security Tips</a></li>
                        </ul>
                </li>
diff --git a/org.tizen.guides/html/native/security/dpm_n.htm b/org.tizen.guides/html/native/security/dpm_n.htm
new file mode 100644 (file)
index 0000000..4854647
--- /dev/null
@@ -0,0 +1,174 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head>\r
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>\r
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />\r
+    <link rel="stylesheet" type="text/css" href="../../css/styles.css" />\r
+    <link rel="stylesheet" type="text/css" href="../../css/snippet.css" />\r
+    <script type="text/javascript" src="../../scripts/snippet.js"></script>\r
+    <script type="text/javascript" src="../../scripts/jquery.util.js" charset="utf-8"></script>\r
+    <script type="text/javascript" src="../../scripts/common.js" charset="utf-8"></script>\r
+    <script type="text/javascript" src="../../scripts/core.js" charset="utf-8"></script>\r
+    <script type="text/javascript" src="../../scripts/search.js" charset="utf-8"></script>\r
+  <title>Device Policy Management</title>\r
+ </head>\r
+ <body onload="prettyPrint()" style="overflow: auto;">\r
+\r
+ <div id="toc-navigation">\r
+    <div id="profile">\r
+        <p><img alt="Mobile native" src="../../images/mobile_s_n.png"/> <img alt="Wearable native" src="../../images/wearable_s_n.png"/></p>\r
+    </div>\r
+\r
+    <div id="toc_border"><div id="toc">\r
+               <p class="toc-title">Dependencies</p>\r
+               <ul class="toc">\r
+                       <li>Tizen 3.0 and Higher for Mobile</li>\r
+                       <li>Tizen 3.0 and Higher for Wearable</li>\r
+               </ul>\r
+        <p class="toc-title">Content</p>\r
+        <ul class="toc">\r
+                       <li><a href="#prerequisites">Prerequisites</a></li>\r
+                       <li><a href="#client_application">Managing Device Policies</a></li>             \r
+        </ul>\r
+        <p class="toc-title">Related Info</p>\r
+        <ul class="toc">\r
+                       <li><a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SECURITY__DPM__MODULE.html">Device Policy Manager API for Mobile Native</a></li>\r
+                       <li><a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SECURITY__DPM__MODULE.html">Device Policy Manager API for Wearable Native</a></li>\r
+            </ul>\r
+    </div></div>\r
+</div>\r
+\r
+<div id="container"><div id="contents"><div class="content">\r
+<h1>Device Policy Management</h1>\r
+\r
+<p>The Device Policy Management (DPM) framework supports enterprise applications by providing IT administrators means to create security-aware applications. They are useful in situations where IT administrators require rich control over employee devices.</p>\r
+<p>DPM consists of a device policy client library and a device policy manager. The device policy manager manages all device policies and provides interfaces for the device policy client library. The device policy client library contains the device administration functions the client application can call. Internally, the device policy client library communicates with the device policy manager using a built-in remote method invocation engine.</p>\r
+\r
+<p>The main features of the Device Policy Manager API include:</p>\r
+       <ul>\r
+       <li>Managing policies\r
+<p>You can <a href="#client_application">track the state between the device admin client and the device policy manager</a> with a device policy manager handle, provided by the Policy Manager Interface API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__MANAGER__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__MANAGER__MODULE.html">wearable</a> applications).</p></li>\r
+       </ul>\r
+       <ul>\r
+       <li>Checking restrictions\r
+<p>You can <a href="#client_application">check the restriction states of the device</a>, such as camera, microphone, Wi-Fi, Bluetooth, and USB, using the getter functions of the Restriction policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__RESTRICTION__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__RESTRICTION__POLICY__MODULE.html">wearable</a> applications).</p>\r
+<p>You can also check the external and internal storage encryption state using the Security policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__SECURITY__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__SECURITY__POLICY__MODULE.html">wearable</a> applications) and get the name of the created zone and the zone state using the Zone policy group API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__DPM__ZONE__POLICY__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__DPM__ZONE__POLICY__MODULE.html">wearable</a> applications).</p></li>\r
+       </ul>\r
+\r
+<p>The following figure illustrates the DPM framework process.</p>\r
+       \r
+   <p class="figure">Figure: DPM framework process</p>\r
+   <p align="center"><img alt="DPM framework process" src="../../images/dpm-framework.png" /></p>\r
+\r
+<h2 id="warm-up" name="warm-up">Warm-up</h2>\r
+       <p>\r
+       Become familiar with the Device Policy Manager API basics by learning about:</p>\r
+       <ul>\r
+               <li><a href="#prerequisites">Prerequisites</a>\r
+               <p>Prepare your application to use the DPM framework functionality.</p></li>\r
+               <li><a href="#client_application">Managing Device Policies</a>\r
+               <p>Create a DPM handle, track policy changes, and check the device restriction state.</p></li>\r
+       </ul>\r
+\r
+<h2 id="prerequisites">Prerequisites</h2>\r
+\r
+<p>To use the functions and data types of the Device Policy Manager API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__SECURITY__DPM__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__SECURITY__DPM__MODULE.html">wearable</a> applications), include the <span style="font-family: Courier New,Courier,monospace">&lt;dpm/device-policy-manager.h&gt;</span> header file in your application:</p>\r
+<pre class="prettyprint">\r
+#include &lt;dpm/device-policy-manager.h&gt;\r
+</pre>\r
+\r
+<h2 id="client_application" name="client_application">Managing Device Policies</h2>\r
+\r
+<p>To manage device policies:</p>\r
+<ol>\r
+\r
+<li>Create a DPM handle:\r
+<pre class="prettyprint">\r
+device_policy_manager_h dpm;\r
+\r
+/* Create a DPM handle */\r
+dpm = dpm_manager_create();\r
+</pre>\r
+</li>\r
+\r
+<li>Add a policy change callback to the device policy manager:\r
+<pre class="prettyprint">\r
+int callback_id;\r
+\r
+/* Create the policy change callback function */\r
+void\r
+on_policy_changed(const char* name, const char* value, void* data)\r
+{\r
+&nbsp;&nbsp;&nbsp;&nbsp;int state = strcmp(value, &quot;allowed&quot;) ? 0 : 1;\r
+\r
+&nbsp;&nbsp;&nbsp;&nbsp;if (strcmp(name, &quot;camera&quot;) == 0) {\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (state)\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* Using the camera is allowed */\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* Using the camera is not allowed */\r
+&nbsp;&nbsp;&nbsp;&nbsp;} \r
+}\r
+\r
+/* Add the policy change callback to the device policy manager */\r
+int\r
+dpm_init()\r
+{\r
+&nbsp;&nbsp;&nbsp;&nbsp;int ret = dpm_add_policy_changed_cb(dpm, &quot;camera&quot;, on_policy_changed, user_data, &amp;callback_id);\r
+&nbsp;&nbsp;&nbsp;&nbsp;if (ret &lt; 0)\r
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* Error handling */   \r
+}\r
+</pre>\r
+</li>\r
+\r
+<li>Check the device restriction state:\r
+<pre class="prettyprint">\r
+#include &lt;dpm/restriction.h&gt;\r
+\r
+int state;\r
+\r
+/* Check the restriction state of the camera */\r
+if (dpm_restriction_get_camera_state(dpm, &amp;state) == DPM_ERROR_NONE) {\r
+&nbsp;&nbsp;&nbsp;&nbsp;/* state: 0: using the camera is not allowed */\r
+&nbsp;&nbsp;&nbsp;&nbsp;/* state: 1: using the camera is allowed */\r
+}\r
+</pre>\r
+</li>\r
+\r
+<li>When no longer needed, remove the policy change callback from the device policy manager and destroy the DPM handle:\r
+<pre class="prettyprint">\r
+void\r
+dpm_finalize()\r
+{\r
+&nbsp;&nbsp;&nbsp;&nbsp;/* Remove the policy change callback from the device policy manager */\r
+&nbsp;&nbsp;&nbsp;&nbsp;dpm_remove_policy_changed_cb(dpm, callback_id);\r
+&nbsp;&nbsp;&nbsp;&nbsp;/* Destroy the DPM handle */\r
+&nbsp;&nbsp;&nbsp;&nbsp;dpm_manager_destroy(dpm);\r
+}\r
+</pre>\r
+</li>\r
+</ol>\r
+\r
+\r
+<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
+<script type="text/javascript" src="../../scripts/showhide.js"></script>\r
+</div></div></div>\r
+\r
+<a class="top sms" href="#"><img src="../../images/btn_top.gif" alt="Go to top" /></a>\r
+\r
+<div id="footer">\r
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br/>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>\r
+</div>\r
+\r
+<script type="text/javascript">\r
+var _gaq = _gaq || [];\r
+_gaq.push(['_setAccount', 'UA-25976949-1']);\r
+_gaq.push(['_trackPageview']);\r
+(function() {\r
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
+})();\r
+</script>\r
+\r
+</body>\r
+</html>\r
index 2bb9089..a11fb8b 100644 (file)
@@ -47,6 +47,9 @@
 <li><a href="yaca_n.htm">Cryptographic Operations</a>
 
 <p>You can encrypt and decrypt data with symmetric or asymmetric encryption, and manage keys with YACA (Yet Another Crypto API). You can also digest messages and create digital signatures.</p></li>
+<li><a href="dpm_n.htm">Device Policy Management</a>
+
+<p>You can create security-aware applications to manage device policies. In enterprise settings, you can provide rich control for IT administrators over employee devices.</p></li>
 </ul>
 
 <p>For information on how to minimize any accidental introduction of security vulnerabilities in your application, see <a href="security_tip.htm">Security Tips</a> (<strong>in mobile applications only</strong>).</p>
index e624715..ece2ea2 100644 (file)
                <topic href="html/native/security/secure_key_n.htm" label="Secure Key Management"></topic>
                <topic href="html/native/security/privilege_n.htm" label="Privilege Information"></topic>
                <topic href="html/native/security/yaca_n.htm" label="Cryptographic Operations"></topic>
+                <topic href="html/native/security/dpm_n.htm" label="Device Policy Management"></topic>
                <topic href="html/native/security/security_tip.htm" label="Security Tips"></topic>
        </topic>
        <topic href="html/native/error/error_cover_n.htm" label="Error Handling">