[Key Manager] Guide and tutorial
authorLukasz Foniok <l.foniok@samsung.com>
Tue, 2 Feb 2016 16:36:01 +0000 (17:36 +0100)
committerHyunjin Park <hj.na.park@samsung.com>
Fri, 12 Feb 2016 03:15:24 +0000 (12:15 +0900)
Change-Id: I9000bb72a4f11e8ac89386c14986013398c15ed8
Signed-off-by: Lukasz Foniok <l.foniok@samsung.com>
org.tizen.guides/html/index.htm
org.tizen.guides/html/web/tizen/security/keymanager_w.htm [new file with mode: 0644]
org.tizen.guides/html/web/tizen/security/security_guide_w.htm [new file with mode: 0644]
org.tizen.guides/index.xml
org.tizen.tutorials/html/index.htm
org.tizen.tutorials/html/web/tizen/security/keymanager_tutorial_w.htm [new file with mode: 0644]
org.tizen.tutorials/html/web/tizen/security/security_tutorials_w.htm [new file with mode: 0644]
org.tizen.tutorials/index.xml
org.tizen.web.apireference/html/device_api/mobile/index.html
org.tizen.web.apireference/html/device_api/mobile/tizen/keymanager.html [new file with mode: 0644]
org.tizen.web.apireference/html/index.htm

index 7acc2d2..ae90dea 100644 (file)
                                                <li><a href="web/tizen/network/secure_element_w.htm">Secure Element</a></li>
                                        </ul>
                                </li>
+                               <li><a href="web/tizen/security/security_guide_w.htm">Security</a>
+                                       <ul>
+                                               <li><a href="web/tizen/security/keymanager_w.htm">Key Manager</a>
+                                       </ul>
+                               </li>
                                <li><a href="web/tizen/social/social_guide_w.htm">Social</a>
                                        <ul>
                                                <li><a href="web/tizen/social/bookmark_w.htm">Bookmark</a></li>
diff --git a/org.tizen.guides/html/web/tizen/security/keymanager_w.htm b/org.tizen.guides/html/web/tizen/security/keymanager_w.htm
new file mode 100644 (file)
index 0000000..c33c6b8
--- /dev/null
@@ -0,0 +1,106 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+  <title>Key Manager</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w.png"/></p>
+    </div>
+
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <a href="../../../../../org.tizen.tutorials/html/web/tizen/security/keymanager_tutorial_w.htm">Key Manager tutorial</a>   
+            </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Key Manager</h1>
+  
+<p>The key manager provides functions to securely store keys, certificates, and sensitive data related to users and their password-protected APPs. Additionally, it provides secure cryptographic operations for non-exportable keys without revealing the key values to clients.</p>
+
+
+<p> A key manager stores keys, certificates, and sensitive user data in a central secure repository. The central secure repository is protected by a password.</p>
+
+<p>The main features of the Key Manager API include:</p>
+
+<ul>
+<li>Data store policy
+<p>A client can specify simple access rules when storing data in the key manager:</p>
+<ul>
+<li>Extractable or non-extractable
+    <ul>
+    <li>Only for data tagged as extractable, the key manager returns the raw value of the data.</li>
+    <li>If data is tagged as non-extractable, the key manager does not return its raw value. In that case, the key manager provides secure cryptographic operations for non-exportable keys without revealing the key values to the clients.</li></ul></li>
+<li>Per key password
+    <ul>
+    <li>All data in the key manager is protected by a user password.</li>
+    <li>A client can encrypt its data using their own password additionally.</li>
+    <li>If a client provides a password when storing data, the data is encrypted with the password. This password must be provided when getting the data from the key manager.</li></ul></li>
+    </ul>
+</li>
+<li>User login
+
+<p>The user login control is implemented as follows:</p>
+
+<ul>
+<li>A user&#39;s database file is encrypted by the user&#39;s DKEK (domain key encryption key). A DKEK of a user is randomly generated and stored as encrypted with a user password when a user logs in for the first time.</li>
+<li>When a user logs in, the key manager decrypts the user DKEK with a user password. During the login session, any client can access the data which is protected by a user password. When a user logs out, the key manager removes the user DKEK from the memory.</li>
+<li>When a user logs in, logs out, or changes their password, the key manager must be notified. Only privileged APPs, such as LockScreen APP or Setting APP, can notify the key manager.</li>
+<li>When a user changes their password, the key manager re-encrypts the user DKEK with the new password.</li>
+</ul>
+</li>
+
+<li>Data access control
+
+<p>By default, only the owner of a data can access to the data. If the owner grants the access to other applications, those applications can read or delete the data from the key manager database.</p>
+<p>When an application is deleted, the data and access control information granted by the application are also removed.</p>
+</li>
+</ul>
+
+   <p class="figure">Figure: Key manager process</p> 
+   <p align="center"><img alt="Key manager process" src="../../../images/key_manager.png" /></p>   
+
+<p>The key manager provides 1 types of APIs (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__KEY__MANAGER__MODULE.html">mobile</a> applications):</p>
+<ul>
+    <li>Secure repository APIs <p>All APPs can use the secure repository APIs to:</p>
+    <ul>
+        <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/security/keymanager_tutorial_w.htm">Save, get, or remove data</a></li>
+    </ul></li>
+</ul>  
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<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>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
diff --git a/org.tizen.guides/html/web/tizen/security/security_guide_w.htm b/org.tizen.guides/html/web/tizen/security/security_guide_w.htm
new file mode 100644 (file)
index 0000000..f3e8600
--- /dev/null
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+  <title>Security</title>
+ </head>
+ <body onload="prettyPrint()" style="overflow: auto;">
+
+ <div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w_optional.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w_optional.png"/></p>
+    </div>
+
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <li><a href="../../../../../org.tizen.tutorials/html/web/tizen/security/security_tutorials_w.htm">Security Tutorials</a></li>
+            </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Security</h1>
+  <p>Security features include information on how your application can store and recall data in secured manner.</p>
+  
+  <p>The main security features are:</p>
+  <ul>
+    <li><a href="keymanager_w.htm">Key Manager</a> <p>Allows you to use Security functionalities, such as storing and recalling private data.</
+</ul>
+  
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<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>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
index 4e9eb81..44594d4 100644 (file)
@@ -45,6 +45,9 @@
                        <topic href="html/web/tizen/network/nfc_w.htm" label="NFC"></topic>
                        <topic href="html/web/tizen/network/secure_element_w.htm" label="Secure Element"></topic>
                </topic>
+               <topic href="html/web/tizen/security/security_guide_w.htm" label="Security">
+                   <topic href="html/web/tizen/security/keymanager_w.htm" label="Key Manager"></topic>
+               </topic>
                <topic href="html/web/tizen/social/social_guide_w.htm" label="Social">                                  
                        <topic href="html/web/tizen/social/bookmark_w.htm" label="Bookmark"></topic>
                        <topic href="html/web/tizen/social/calendar_w.htm" label="Calendar"></topic>
index 7fc3b5e..de9b7c4 100644 (file)
@@ -35,6 +35,7 @@
                                        </ul>
                                </li>
                        <li><a href="web/tizen/base/tizen_tutorial_w.htm">Tizen</a></li>
+                       <li><a href="web/tizen/base/keymanager_tutorial_w.htm">Key Manager</a></li>
                    </ul>
         </li>
         <li><a href="web/tizen/account/account_tutorial_w.htm">Account</a></li>
                                <li><a href="web/tizen/network/secure_element_tutorial_w.htm">Secure Element</a></li>                                   
                        </ul>           
                </li>
+               <li><a href="web/tizen/security/security_tutorials_w.htm">Security</a>
+                       <ul>
+                               <li><a href="web/tizen/security/keymanager_tutorial_w.htm">Key Manager</a>
+                               </li>
+                       </ul>           
+               </li>
                <li><a href="web/tizen/social/social_tutorials_w.htm">Social</a>
                        <ul>
                                <li><a href="web/tizen/social/bookmark_tutorial_w.htm">Bookmark</a></li>
diff --git a/org.tizen.tutorials/html/web/tizen/security/keymanager_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/security/keymanager_tutorial_w.htm
new file mode 100644 (file)
index 0000000..6b9da55
--- /dev/null
@@ -0,0 +1,165 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+
+    <title>Key Manager: Save, get, or remove data</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w.png"/></p>
+    </div>
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Content</p>
+        <ul class="toc">
+            <li><a href="#save">Save data in Key Manager</a></li>
+            <li><a href="#remove">Remove data from Key Manager</a></li>
+            <li><a href="#get">Get Data from key manager</a></li>
+        </ul>
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <a href="../../../../../org.tizen.guides/html/web/tizen/security/keymanager_w.htm">Key Manager Guide</a>      
+        </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Key Manager: Save, get, or remove data</h1>
+
+<h2 id="save">Save data in Key Manager</h2>
+<ol>
+<li><p>Save data</p><pre class="prettyprint">
+ var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+     console.log("Successfully saved data");
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre></li>
+ <li>
+  <p>Application this time set permission for application with id 9PdoiICQ4c to remove its data.</p>
+ <pre class="prettyprint">
+  var data_name = "data1", raw_data = "my data";
+
+ function onPermissionSet() {
+     console.log("Successfully set permission");
+ }
+
+ function onSave() {
+     // Dictionary does not require package ID because an
+     // application can only set permission for data which it saved
+     tizen.keymanager.setPermission({
+         "name": data_name
+     }, "9PdoiICQ4c", "READ_REMOVE", onPermissionSet);
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre></li>
+</ol>
+
+<h2 id="remove">Remove data from Key Manager</h2>
+<ol>
+<li><p>Remove data from application which added particular data.</p><pre class="prettyprint">
+ var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+
+     // do something
+
+     // Dictionary does not require package ID because the
+     // application which is calling removeData() saved "data1"
+     tizen.keymanager.removeData({
+         "name": data_name
+     });
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre></li>
+ <li><p>Remove data from other application with assuming that application which, added data gave, permission for it.</p>
+  
+ <p> Now the other application can remove it assuming they are on list item 0</p>
+ <pre class="prettyprint">
+
+ var aliases = tizen.keymanager.getDataAliasList();
+
+ if (aliases.length != 0) {
+     // Assuming the application calling removeData() has permission
+     // to remove aliases[0]
+     var app_data = tizen.keymanager.removeData(aliases[0]);
+ }
+ </pre></li>
+</ol>
+
+<h2 id="get">Get Data from key manager</h2>
+<ol>
+<li><p>Getdata from application which added particular data.</p><pre class="prettyprint">
+ var data_name = "data1", raw_data = "my data";
+
+ var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+     // Dictionary does not require package ID because the
+     // application which is calling getData() saved "data1"
+     var app_data = tizen.keymanager.getData({
+         "name": data_name
+     });
+     console.log("App data: " + app_data + " was retrieved");
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre></li>
+
+ <li><p>Get data from other application with assuming that application, which added data, gave permission for it.</p>
+  
+ <p> Now the other application can read it assuming they are on list item 0</p>
+ <pre class="prettyprint">
+
+ var aliases = tizen.keymanager.getDataAliasList();
+
+ if (aliases.length != 0) {
+     // Assuming the application calling getData() has permission to read
+     // aliases[0]
+     var app_data = tizen.keymanager.getData(aliases[0]);
+     console.log("App data: " + app_data + " was retrieved");
+ }
+ </pre></li>
+</ol>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<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>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+</body>
+</html>
diff --git a/org.tizen.tutorials/html/web/tizen/security/security_tutorials_w.htm b/org.tizen.tutorials/html/web/tizen/security/security_tutorials_w.htm
new file mode 100644 (file)
index 0000000..efd5034
--- /dev/null
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=9" />
+    <link rel="stylesheet" type="text/css" href="../../../css/styles.css" />
+    <link rel="stylesheet" type="text/css" href="../../../css/snippet.css" />
+    <script type="text/javascript" src="../../../scripts/snippet.js"></script>
+    <script type="text/javascript" src="../../../scripts/jquery.util.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/core.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../../scripts/search.js" charset="utf-8"></script>
+
+    <title>Security: Storing and recalling data in secure storage</title>
+</head>
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+<div id="toc-navigation">
+    <div id="profile">
+        <p><img alt="Mobile Web" src="../../../images/mobile_s_w_optional.png"/> <img alt="Wearable Web" src="../../../images/wearable_s_w_optional.png"/></p>
+    </div>
+    <div id="toc_border"><div id="toc">
+        <p class="toc-title">Related Info</p>
+        <ul class="toc">
+            <li><a href="../../../../../org.tizen.guides/html/web/tizen/security/security_guide_w.htm">Security Guide</a></li>
+        </ul>
+    </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+<h1>Security: Storing and recalling data in secure storage</h1>
+
+
+<p>The Security tutorials demonstrate how to use the following features in creating Tizen Web applications:</p>
+  <ul>
+   <li><a href="keymanager_tutorial_w.htm">Security: Save, get, or remove data</a></li> 
+  </ul>
+
+<script type="text/javascript" src="../../../scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="../../../scripts/showhide.js"></script>
+
+</div></div></div>
+
+<a class="top sms" href="#"><img src="../../../images/btn_top.gif" alt="Go to top" /></a>
+
+<div id="footer">
+<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>
+</div>
+
+  <script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+ </body>
+</html>
index e9d9c69..8597ae4 100644 (file)
@@ -53,6 +53,9 @@
                        <topic href="html/web/tizen/network/secure_element_tutorial_w.htm" label="Secure Element"></topic>
                        </topic>
                </topic>
+               <topic href="html/web/tizen/security/security_tutorials_w.htm" label="security">
+                       <topic href="html/web/tizen/security/keymanager_tutorial_w.htm" label="Key Manager"></topic>
+               </topic>
                <topic href="html/web/tizen/system/system_tutorials_w.htm" label="System">                      
                        <topic href="html/web/tizen/system/ham_tutorial_w.htm" label="Human Activity Monitor"></topic>
                        <topic href="html/web/tizen/system/media_key_tutorial_w.htm" label="Media Key"></topic>
                        <topic href="html/web/tizen/system/system_setting_tutorial_w.htm" label="System Setting"></topic>
                        <topic href="html/web/tizen/system/time_tutorial_w.htm" label="Time"></topic>
                        <topic href="html/web/tizen/system/web_setting_tutorial_w.htm" label="Web Setting"></topic>
-               </topic>        
+               </topic>
+               <topic href="html/web/tizen/security/security_tutorials_w.htm" label="Security">        
+                   <topic href="html/web/tizen/security/keymanager_tutorial_w.htm" label="Key Manager"></topic>        
+               </topic>
                <topic href="html/web/tizen/social/social_tutorials_w.htm" label="Social">                      
                        <topic href="html/web/tizen/social/bookmark_tutorial_w.htm" label="Bookmark"></topic>
                        <topic href="html/web/tizen/social/calendar_tutorial_w.htm" label="Calendar">                                   
index 21f623c..131c3b2 100644 (file)
                 <td>Optional</td>
                 <td>No</td>
 
+                </tr></tbody></table><h4 id="Security">Security</h4>
+             <table class="api-list"><thead><tr><th>API</th><th>Description</th><th>Version (Since)</th><th>Mobile</th><th>Supported on<br>Mobile Emulator</th></tr>
+       </thead><tbody><tr><td><a href="tizen/keymanager.html" data-origin="tizen" data-domain="pim" data-category="core" data-status="S" data-version="">
+                        Keymanager</a></td>
+                <td>This API provides interfaces and methods for a secure repository for storing, retrieving and removing the sensitive data of users and their applications </td>
+                <td>3.0</td>
+                <td>Mandatory</td>
+                <td>Yes</td>
+
                 </tr></tbody></table><h4 id="Social">Social</h4>
              <table class="api-list"><thead><tr><th>API</th><th>Description</th><th>Version (Since)</th><th>Mobile</th><th>Supported on<br>Mobile Emulator</th></tr>
        </thead><tbody><tr><td><a href="tizen/bookmark.html" data-origin="tizen" data-domain="pim" data-category="core" data-status="S" data-version="">
diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/keymanager.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/keymanager.html
new file mode 100644 (file)
index 0000000..b3e9676
--- /dev/null
@@ -0,0 +1,683 @@
+<!DOCTYPE html PUBLIC "html">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<link rel="stylesheet" type="text/css" href="tizen.css" media="screen">
+<script type="text/javascript" src="snippet.js"></script><title>KeyManager API</title>
+</head>
+<body id="page-content" onload="prettyPrint()">
+<div class="api" id="::KeyManager">
+<div class="title"><h1>KeyManager API</h1></div>
+<div class="brief">
+ The KeyManager API provides a secure repository for storing, retrieving and removing the sensitive data of users and their applications. Users can protect the data with passwords.
+        </div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+        </p>
+<h2>Table of Contents</h2>
+<ul class="toc">
+<li>1. <a href="#typedefs-section">Type Definitions</a><ul class="toc">
+<li>1.1. <a href="#RawData">RawData</a>
+</li>
+<li>1.2. <a href="#PermissionType">PermissionType</a>
+</li>
+</ul>
+</li>
+<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
+<li>2.1. <a href="#KeyManagerObject">KeyManagerObject</a>
+</li>
+<li>2.2. <a href="#KeyManager">KeyManager</a>
+</li>
+<li>2.3. <a href="#KeyManagerAlias">KeyManagerAlias</a>
+</li>
+</ul>
+</li>
+<li>3. <a href="#full-webidl">Full WebIDL</a>
+</li>
+</ul>
+<hr>
+<h2 id="method-summary">Summary of Interfaces and Methods</h2>
+<table class="informaltable">
+<thead><tr>
+<th>Interface</th>
+<th>Method</th>
+</tr></thead>
+<tbody>
+<tr>
+<td><a href="#KeyManagerObject">KeyManagerObject</a></td>
+<td></td>
+</tr>
+<tr>
+<td><a href="#KeyManager">KeyManager</a></td>
+<td>void <a href="#KeyManager::saveData">saveData</a> (DOMString name, <a href="#RawData">RawData</a> rawData, optional DOMString? password, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)<br>
+    void <a href="#KeyManager::removeData">removeData</a> (<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias)<br>
+    <a href="#RawData">RawData</a> <a href="#KeyManager::getData">getData</a> (<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, optional DOMString? password)<br>
+    <a href="#KeyManagerAlias">KeyManagerAlias</a>[] <a href="#KeyManager::getDataAliasList">getDataAliasList</a> ()<br>
+    void <a href="#KeyManager::setPermission">setPermission</a> (<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, <a href="package.html#PackageId">PackageId</a> packageId, <a href="#PermissionType">PermissionType</a> permissionType, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback)</td>
+</tr>
+<tr>
+<td><a href="#KeyManagerAlias">KeyManagerAlias</a></td>
+<td></td>
+</tr>
+</tbody>
+</table>
+<div class="typedefs" id="typedefs-section">
+<h2>1. Type Definitions</h2>
+<div class="typedef" id="RawData">
+<a class="backward-compatibility-anchor" name="::KeyManager::RawData"></a><h3>1.1. RawData</h3>
+<div class="brief">
+ Data to be stored or retrieved.
+          </div>
+<pre class="webidl prettyprint">  typedef DOMString RawData;</pre>
+<p><span class="version">
+            Since: </span>
+ 3.0
+          </p>
+</div>
+<div class="enum" id="PermissionType">
+<a class="backward-compatibility-anchor" name="::KeyManager::PermissionType"></a><h3>1.2. PermissionType</h3>
+<div class="brief">
+ An enumerator to indicate permissions.
+          </div>
+<pre class="webidl prettyprint">  enum PermissionType{
+      "NONE",
+      "READ",
+      "REMOVE",
+      "READ_REMOVE"
+  };</pre>
+<p><span class="version">
+            Since: </span>
+ 3.0
+          </p>
+<div class="description">
+          <ul>
+            <li>
+ NONE - Clears or removes permissions             </li>
+            <li>
+ READ - Permission to read data             </li>
+            <li>
+ REMOVE - Permission to remove data             </li>
+            <li>
+ READ_REMOVE - Permission to read and remove data             </li>
+          </ul>
+         </div>
+</div>
+</div>
+<div class="interfaces" id="interfaces-section">
+<h2>2. Interfaces</h2>
+<div class="interface" id="KeyManagerObject">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManagerObject"></a><h3>2.1. KeyManagerObject</h3>
+<div class="brief">
+ The KeyManagerObject interface defines what is instantiated by the <em>Tizen </em>object from the Tizen Platform.
+          </div>
+<pre class="webidl prettyprint">  [NoInterfaceObject] interface KeyManagerObject {
+      readonly attribute <a href="#KeyManager">KeyManager</a> keymanager;
+  };</pre>
+<pre class="webidl prettyprint">  <a href="tizen.html#Tizen">Tizen</a> implements <a href="#KeyManagerObject">KeyManagerObject</a>;</pre>
+<p><span class="version">
+            Since: </span>
+ 3.0
+          </p>
+<div class="description">
+          <p>
+The <em>tizen.keymanager </em>object allows access to the functionality of the KeyManager API.
+          </p>
+         </div>
+</div>
+<div class="interface" id="KeyManager">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager"></a><h3>2.2. KeyManager</h3>
+<pre class="webidl prettyprint">  [NoInterfaceObject] interface KeyManager {
+
+    void saveData(DOMString name,
+                  <a href="#RawData">RawData</a> rawData,
+                  optional DOMString? password,
+                  optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+                  optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    void removeData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    <a href="#RawData">RawData</a> getData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, optional DOMString? password) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    <a href="#KeyManagerAlias">KeyManagerAlias</a>[] getDataAliasList() raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    void setPermission(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias,
+                       <a href="package.html#PackageId">PackageId</a> packageId,
+                       <a href="#PermissionType">PermissionType</a> permissionType,
+                       optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+                       optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+  };</pre>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="KeyManager::saveData">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager::saveData"></a><code><b><span class="methodName">saveData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Saves and stores data as a <a href="#KeyManagerAlias">KeyManagerAlias</a> inside the KeyManager.
+            </div>
+<div class="synopsis"><pre class="signature prettyprint">void saveData(DOMString name, <a href="#RawData">RawData</a> rawData, optional DOMString? password, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+             </pre></div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+<div class="description">
+            <p>
+On success, this method will add a <a href="#KeyManagerAlias">KeyManagerAlias</a> into the KeyManager. The <em>name</em> attribute of that KeyManagerAlias will be set to be the value of the <em>name</em> parameter which is used in this method call. The <em>packageId</em> attribute of that KeyManagerAlias will automatically be set to be the package ID of the application which calls this method.
+            </p>
+            <p>
+The <em>ErrorCallback</em> is launched with these error types:
+            </p>
+            <ul>
+              <li>
+UnknownError - If the method cannot be completed because of an unknown error.              </li>
+            </ul>
+           </div>
+<p><span class="privilegelevel">
+            Privilege level: </span>
+ public
+            </p>
+<p><span class="privilege">
+            Privilege: </span>
+      http://tizen.org/privilege/keymanager
+            </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+          <li class="param">
+<span class="name">name</span>: 
+ Name to identify the data - this will be the <em>name</em> attribute of the <a href="#KeyManagerAlias">KeyManagerAlias</a> which this method adds, on success, into the KeyManager
+                </li>
+          <li class="param">
+<span class="name">rawData</span>: 
+ Raw data to be stored
+                </li>
+          <li class="param">
+<span class="name">password</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Password to use for encrypting the data
+                </li>
+          <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Callback function that is called when data is successfully saved
+                </li>
+          <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Callback function that is called when an error occurs
+                </li>
+        </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+          <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+                </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+                </p></li>
+</ul>
+</li></ul>
+        </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+     console.log("Successfully saved data");
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre>
+</div>
+</dd>
+<dt class="method" id="KeyManager::removeData">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager::removeData"></a><code><b><span class="methodName">removeData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Removes data from the KeyManager.
+            </div>
+<div class="synopsis"><pre class="signature prettyprint">void removeData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias);
+             </pre></div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+<div class="description">
+            <p>
+To remove data, an application must have permission to remove that data. By default, an application which saved data into the KeyManager has permission to remove the data. An application can also use the <a href="#KeyManager::setPermission">setPermission</a> method to allow another application to remove its data.
+            </p>
+            <p>
+If an application calls this method to remove data which it saved into the KeyManager, the <em>dataAlias</em> parameter does not require the <em>packageId</em> attribute.
+            </p>
+           </div>
+<p><span class="privilegelevel">
+            Privilege level: </span>
+ public
+            </p>
+<p><span class="privilege">
+            Privilege: </span>
+      http://tizen.org/privilege/keymanager
+            </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+          <li class="param">
+<span class="name">dataAlias</span>: 
+ Alias of the data to remove
+                </li>
+        </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+          <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotFoundError, if the dataAlias cannot be found.
+                </p></li>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+                </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+                </p></li>
+<li class="list"><p>
+ with error type UnknownError, if the method cannot be completed because of an unknown error
+                </p></li>
+</ul>
+</li></ul>
+        </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+
+     // do something
+
+     // Dictionary does not require package ID because the
+     // application which is calling removeData() saved "data1"
+     tizen.keymanager.removeData({
+         "name": data_name
+     });
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var aliases = tizen.keymanager.getDataAliasList();
+
+ if (aliases.length != 0) {
+     // Assuming the application calling removeData() has permission
+     // to remove aliases[0]
+     var app_data = tizen.keymanager.removeData(aliases[0]);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="KeyManager::getData">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager::getData"></a><code><b><span class="methodName">getData</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets raw data from the KeyManager.
+            </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#RawData">RawData</a> getData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, optional DOMString? password);
+             </pre></div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+<div class="description">
+            <p>
+To get raw data, an application must have permission to get that raw data. By default, an application which saved raw data into the KeyManager has permission to get that raw data. An application can also use the <a href="#KeyManager::setPermission">setPermission</a> method to allow another application to get and read its raw data.
+            </p>
+            <p>
+If an application calls this method to retrieve raw data which it saved into the KeyManager, the <em>dataAlias</em> parameter does not require the <em>packageId</em> attribute.
+            </p>
+           </div>
+<p><span class="privilegelevel">
+            Privilege level: </span>
+ public
+            </p>
+<p><span class="privilege">
+            Privilege: </span>
+      http://tizen.org/privilege/keymanager
+            </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+          <li class="param">
+<span class="name">dataAlias</span>: 
+ Alias of the data to get
+                </li>
+          <li class="param">
+<span class="name">password</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Password which was used to encrypt the data
+                </li>
+        </ul>
+</div>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ RawData Data.
+              </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+          <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotFoundError, if the dataAlias cannot be found.
+                </p></li>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+                </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+                </p></li>
+<li class="list"><p>
+ with error type VerificationError, if the method cannot be completed because an incorrect password is used.
+                </p></li>
+<li class="list"><p>
+ with error type UnknownError, if the method cannot be completed because of a database access failure or any other unknown error.
+                </p></li>
+</ul>
+</li></ul>
+        </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var data_name = "data1", raw_data = "my data";
+
+ function onSave() {
+     // Dictionary does not require package ID because the
+     // application which is calling getData() saved "data1"
+     var app_data = tizen.keymanager.getData({
+         "name": data_name
+     });
+     console.log("App data: " + app_data + " was retrieved");
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var aliases = tizen.keymanager.getDataAliasList();
+
+ if (aliases.length != 0) {
+     // Assuming the application calling getData() has permission to read
+     // aliases[0]
+     var app_data = tizen.keymanager.getData(aliases[0]);
+     console.log("App data: " + app_data + " was retrieved");
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="KeyManager::getDataAliasList">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager::getDataAliasList"></a><code><b><span class="methodName">getDataAliasList</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets all the aliases which an application can access.
+            </div>
+<div class="synopsis"><pre class="signature prettyprint"><a href="#KeyManagerAlias">KeyManagerAlias</a>[] getDataAliasList();
+             </pre></div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+<p><span class="privilegelevel">
+            Privilege level: </span>
+ public
+            </p>
+<p><span class="privilege">
+            Privilege: </span>
+      http://tizen.org/privilege/keymanager
+            </p>
+<div class="returntype">
+<p><span class="return">Return value:</span></p>
+ KeyManagerAlias[] Array of aliases.
+              </div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+          <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+                </p></li>
+<li class="list"><p>
+ with error type UnknownError, if the method cannot be completed because of an unknown error.
+                </p></li>
+</ul>
+</li></ul>
+        </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var aliases = tizen.keymanager.getDataAliasList();
+
+ console.log("aliases: ");
+ for (var i = 0; i &lt; aliases.length; i++) {
+     console.log("Package ID: " + aliases[i].packageId + ", Name: "
+             + aliases[i].name);
+ }
+ </pre>
+</div>
+</dd>
+<dt class="method" id="KeyManager::setPermission">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManager::setPermission"></a><code><b><span class="methodName">setPermission</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Sets permissions that another application has for accessing an application's data.
+            </div>
+<div class="synopsis"><pre class="signature prettyprint">void setPermission(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, <a href="package.html#PackageId">PackageId</a> packageId, <a href="#PermissionType">PermissionType</a> permissionType, optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback);
+             </pre></div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+<div class="description">
+            <p>
+An application can only set permissions for data which it saved into the KeyManager. Therefore, the <em>dataAlias</em> parameter does not require the <em>packageId</em> attribute.
+            </p>
+            <p>
+The <em>ErrorCallback</em> is launched with these error types:
+            </p>
+            <ul>
+              <li>
+NotFoundError - If the dataAlias cannot be found.              </li>
+              <li>
+UnknownError - If the method cannot be completed because of an unknown error.              </li>
+            </ul>
+           </div>
+<p><span class="privilegelevel">
+            Privilege level: </span>
+ public
+            </p>
+<p><span class="privilege">
+            Privilege: </span>
+      http://tizen.org/privilege/keymanager
+            </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+          <li class="param">
+<span class="name">dataAlias</span>: 
+ Alias the data for which permission will be set
+                </li>
+          <li class="param">
+<span class="name">packageId</span>: 
+ Package ID of the accessor application
+                </li>
+          <li class="param">
+<span class="name">permissionType</span>: 
+ Permission to grant to the accessor application
+                </li>
+          <li class="param">
+<span class="name">successCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Callback function that is called when permission is successfully set
+                </li>
+          <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>: 
+ Callback function that is called when an error occurs
+                </li>
+        </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+          <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+                </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+                </p></li>
+</ul>
+</li></ul>
+        </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var data_name = "data1", raw_data = "my data";
+
+ function onPermissionSet() {
+     console.log("Successfully set permssion");
+ }
+
+ function onSave() {
+     // Dictionary does not require package ID because an
+     // application can only set permission for data which it saved
+     tizen.keymanager.setPermission({
+         "name": data_name
+     }, "9PdoiICQ4c", "READ_REMOVE", onPermissionSet);
+ }
+
+ tizen.keymanager.saveData(data_name, raw_data, null, onSave);
+ </pre>
+</div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var aliases = tizen.keymanager.getDataAliasList();
+
+ function onPermissionSet() {
+     console.log("Successfully set permssion");
+ }
+
+ if (aliases.length != 0) {
+     // Check that the application calling setPermission() saved aliases[0] into
+     // the KeyManager
+     if (aliases[0].packageId === tizen.package.getPackageInfo().id) {
+         tizen.keymanager.setPermission(aliases[0], "9PdoiICQ4c", "READ_REMOVE",
+                 onPermissionSet);
+     } else {
+         console.log("This application did not save aliases[0] into the KeyManager");
+     }
+ }
+ </pre>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+<div class="dictionary" id="KeyManagerAlias">
+<a class="backward-compatibility-anchor" name="::KeyManager::KeyManagerAlias"></a><h3>2.3. KeyManagerAlias</h3>
+<div class="brief">
+ The KeyManagerAlias dictionary identifies items in the KeyManager.
+          </div>
+<pre class="webidl prettyprint">  dictionary KeyManagerAlias {
+    <a href="package.html#PackageId">PackageId</a> packageId;
+
+    DOMString name;
+  };</pre>
+<p><span class="version">
+            Since: </span>
+ 3.0
+          </p>
+<div class="attributes">
+<h4>Dictionary members</h4>
+<dl>
+<dt class="member" id="KeyManagerAlias::packageId"><span class="attrName"><a href="package.html#PackageId">PackageId</a> packageId</span></dt>
+<dd>
+<div class="brief">
+ Package ID of the application which saved the item into the KeyManager.
+            </div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+</dd>
+<dt class="member" id="KeyManagerAlias::name"><span class="attrName">DOMString name</span></dt>
+<dd>
+<div class="brief">
+ Name which describes the item.
+            </div>
+<div class="description">
+            <p>
+If this attribute contains any spaces, the spaces will be removed. Characters which are separated by spaces will be concatenated.
+            </p>
+           </div>
+<p><span class="version">
+            Since: </span>
+ 3.0
+            </p>
+</dd>
+</dl>
+</div>
+</div>
+</div>
+<h2 id="full-webidl">3. Full WebIDL</h2>
+<pre class="webidl prettyprint">module KeyManager {
+  typedef DOMString RawData;
+
+  enum PermissionType{
+      "NONE",
+      "READ",
+      "REMOVE",
+      "READ_REMOVE"
+  };
+
+  [NoInterfaceObject] interface KeyManagerObject {
+      readonly attribute <a href="#KeyManager">KeyManager</a> keymanager;
+  };
+  <a href="tizen.html#Tizen">Tizen</a> implements <a href="#KeyManagerObject">KeyManagerObject</a>;
+
+  [NoInterfaceObject] interface KeyManager {
+
+    void saveData(DOMString name,
+                  <a href="#RawData">RawData</a> rawData,
+                  optional DOMString? password,
+                  optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+                  optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    void removeData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    <a href="#RawData">RawData</a> getData(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias, optional DOMString? password) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    <a href="#KeyManagerAlias">KeyManagerAlias</a>[] getDataAliasList() raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
+    void setPermission(<a href="#KeyManagerAlias">KeyManagerAlias</a> dataAlias,
+                       <a href="package.html#PackageId">PackageId</a> packageId,
+                       <a href="#PermissionType">PermissionType</a> permissionType,
+                       optional <a href="tizen.html#SuccessCallback">SuccessCallback</a>? successCallback,
+                       optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback) raises (<a href="tizen.html#WebAPIException">WebAPIException</a>);
+  };
+
+  dictionary KeyManagerAlias {
+    <a href="package.html#PackageId">PackageId</a> packageId;
+
+    DOMString name;
+  };
+};</pre>
+</div>
+<div id="page-footer">
+<div class="copyright" align="center">
+         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>.
+            </div>
+<script type="text/javascript">
+
+              var _gaq = _gaq || [];
+              _gaq.push(['_setAccount', 'UA-25976949-1']);
+              _gaq.push(['_setDomainName', 'tizen.org']);
+              _gaq.push(['_trackPageview']);
+
+              (function() {
+                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+              })();
+
+            </script>
+</div>
+</body>
+</html>
index a62d2c0..83ac430 100644 (file)
                                                                <li><a href="device_api/mobile/tizen/sound.html">Sound</a></li>
                                                        </ul>
                                                </li>
+                                               <li><a href="device_api/mobile/index.html#Security">Security</a>
+                                                       <ul>
+                                                               <li><a href="device_api/mobile/tizen/keymanager.html">Keymanager</a></li>
+                                                       </ul>
+                                               </li>
                                                <li><a href="device_api/mobile/index.html#Social">Social</a>
                                                        <ul>
                                                                <li><a href="device_api/mobile/tizen/bookmark.html">Bookmark</a></li>