\r
const char* alias= "mykey";\r
\r
-ret = ckmc_remove_key(alias);\r
+ret = ckmc_remove_alias(alias);\r
if (CKMC_ERROR_NONE != ret) \r
{\r
// Error handling\r
}\r
-</pre></li></ol>\r
+</pre>\r
+<table class="note">\r
+ <tbody>\r
+ <tr>\r
+ <th class="note">Note</th>\r
+ </tr>\r
+ <tr>\r
+ <td class="note">Note that a few Key manager APIs have been <strong>deprecated since Tizen 2.4</strong>. \r
+ For example, several ckmc_remove_* () have been replaced by ckmc_remove_alias(). Although the deprecated APIs continue to be available, it is strongly recommended to use new APIs. For more information on the deprecated information, please refer to the <a href="../../../../org.tizen.native.mobile.apireference/group_CAPIKEYMANAGER_MODULE.html">Key-manager API References</a>.</td>\r
+ </tr>\r
+ </tbody>\r
+</table>\r
+</li></ol>\r
\r
<h2 id="savingcert" name="savingcert">Saving, Getting, or Removing a Certificate</h2>\r
\r
\r
const char* alias= "myCert";\r
\r
-ret = ckmc_remove_cert(alias);\r
+ret = ckmc_remove_alias(alias);\r
if (CKMC_ERROR_NONE != ret)\r
{\r
// Error handling\r
}\r
-</pre></li></ol>\r
+</pre>\r
+</li></ol>\r
\r
<h2 id="savingdata" name="savingdata">Saving, Getting, or Removing Data</h2>\r
\r
\r
const char* alias= "myData";\r
\r
-ret = ckmc_remove_data(alias);\r
+ret = ckmc_remove_alias(alias);\r
if (CKMC_ERROR_NONE != ret)\r
{\r
// Error handling\r
}\r
-</pre></li></ol>\r
+</pre>\r
+</li></ol>\r
\r
<h2 id="creatingkey" name="creatingkey">Creating Key Pairs</h2>\r
\r
<pre class="prettyprint">\r
int ret = CKMC_ERROR_NONE;\r
\r
-ckmc_key_s *private_key = NULL;\r
-ckmc_cert_s *cert = NULL;\r
-ckmc_cert_list_s *ca_cert_list = NULL;\r
+ckmc_pkcs12_s *ppkcs12 = NULL;\r
// defined_media_storage_directory can be obtained with the storage_get_directory() function\r
const char *p12file = "<defined_media_storage_directory>/ckmc_p12_test.p12"; \r
const char *password = "password"; // PKCS#12 file can be protected by a password\r
\r
-ret = ckmc_load_from_pkcs12_file(p12file, password, &private_key, &cert, &ca_cert_list);\r
-if (CKMC_ERROR_NONE != ret)\r
+ret = ckmc_pkcs12_load(p12file, password, &ppkcs12);\r
+if (CKMC_ERROR_NONE != ret || ppkcs12 == NULL)\r
{\r
// Error handling\r
}\r
\r
-if (private_key != NULL)\r
+if (ppkcs12->priv_key != NULL)\r
{\r
// Check a private key\r
}\r
\r
-if (cert != NULL)\r
+if (ppkcs12->cert != NULL)\r
{\r
// Check a certificate\r
\r
}\r
\r
int cnt = 0;\r
-ckmc_cert_list_s *tmp_list = ca_cert_list;\r
+ckmc_cert_list_s *tmp_list = ppkcs12->ca_chain;\r
while(tmp_list!= NULL)\r
{\r
// Check a certificate list\r
tmp_list = tmp_list ->next;\r
}\r
\r
-ckmc_key_free(private_key); // Called when the key is no longer needed\r
-ckmc_cert_free(cert); // Called when the certificate is no longer needed\r
-ckmc_cert_list_all_free(ca_cert_list); // Called when the list is no longer needed\r
-</pre></li></ul>\r
+ckmc_pkcs12_free(ppkcs12);; // Called when the pkcs12 data is no longer needed\r
+</pre>\r
+</li></ul>\r
\r
<h2 id="access" name="access">Implementing Access Control</h2>\r
\r
const char *target2 = "accessor-allow-2";\r
const char *alias = "targetData";\r
\r
-ret = ckmc_allow_access(alias, target1, CKMC_AR_READ); // Only allow reading data\r
+ret = ckmc_set_permission(alias, target1, CKMC_PERMISSION_READ); // Only allow reading data\r
if (CKMC_ERROR_NONE != ret)\r
{\r
// Error handling\r
}\r
\r
-ret = ckmc_allow_access(alias, target2, CKMC_AR_READ_REMOVE); // Allow reading and deleting data\r
+ret = ckmc_set_permission(alias, target2, CKMC_PERMISSION_READ | CKMC_PERMISSION_REMOVE); // Allow reading and deleting data\r
if (CKMC_ERROR_NONE != ret)\r
{\r
// Error handling\r
}\r
-</pre></li>\r
+</pre>\r
+</li>\r
\r
<li><p>Set a rule to deny access:</p>\r
<pre class="prettyprint">\r
const char *target = "denied-accessor";\r
const char *alias = "targetData";\r
\r
-ret = ckmc_allow_access(alias, target, CKMC_AR_READ); // Allow the target user to a read (alias)\r
+ret = ckmc_set_permission(alias, target, CKMC_PERMISSION_READ); // Allow the target user to a read (alias)\r
if (CKMC_ERROR_NONE != ret)\r
{\r
// Error handling\r
}\r
\r
-ret = ckmc_deny_access(alias, target); // Deny the target user access to data (alias)\r
+ret = ckmc_set_permission(alias, target, CKMC_PERMISSION_NONE); // Deny the target user access to data (alias)\r
if (CKMC_ERROR_NONE != ret)\r
\r
{\r
// Error handling\r
}\r
-</pre></li>\r
+</pre>\r
+</li>\r
</ol>\r
\r
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>\r
</script> \r
\r
</body>\r
- </html>
\ No newline at end of file
+ </html>\r