tizen 2.4 release
[framework/security/key-manager.git] / src / include / ckmc / ckmc-control.h
index 0424e2c..6666950 100644 (file)
@@ -33,7 +33,6 @@ extern "C" {
 #endif
 
 /**
- * @internal
  * @addtogroup CAPI_KEY_MANAGER_CONTROL_MODULE
  * @{
  */
@@ -43,7 +42,7 @@ extern "C" {
  *        A decrypted user key exists only on memory. If this API is called for the first time, a
  *        user key will be generated internally.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -72,7 +71,7 @@ int ckmc_unlock_user_key(uid_t user, const char *password);
 /**
  * @brief Removes a decrypted user key(DKEK) from memory
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -95,7 +94,7 @@ int ckmc_lock_user_key(uid_t user);
 /**
  * @brief Removes user data from Store and erases a user key(DKEK) used for encryption.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -120,7 +119,7 @@ int ckmc_remove_user_data(uid_t user);
  *        The key manager decrypts a user key (DKEK) with old password and re-encrypts a user key
  *        with new password.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -147,7 +146,7 @@ int ckmc_change_user_password(uid_t user, const char *old_password, const char *
 /**
  * @brief Changes a password for a user without old password.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -173,9 +172,10 @@ int ckmc_change_user_password(uid_t user, const char *old_password, const char *
 int ckmc_reset_user_password(uid_t user, const char *new_password);
 
 /**
+ * @deprecated, see ckmc_set_permission_by_adm()
  * @brief Allows another application to access client's application data
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -198,9 +198,8 @@ int ckmc_reset_user_password(uid_t user, const char *new_password);
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_allow_access()
- * @see ckmc_deny_access()
- * @see ckmc_deny_access_by_adm()
+ * @see ckmc_set_permission_by_adm()
+ * @see ckmc_set_permission()
  */
 int ckmc_allow_access_by_adm(uid_t user,
                              const char *owner,
@@ -209,9 +208,43 @@ int ckmc_allow_access_by_adm(uid_t user,
                              ckmc_access_right_e granted);
 
 /**
+ * @brief Allows another application to access client's application data
+ *
+ * @since_tizen 3.0
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/keymanager.admin
+ *
+ * @remarks Data identified by @a alias should exist
+ * @remarks @a alias must contain owner label (<owner label><ckmc_label_name_separator><name>)
+ *
+ * @param[in] user        User ID of a user whose data will be affected
+ * @param[in] alias       Data alias for which access will be granted
+ * @param[in] accessor    Package id of the application that will gain access rights
+ * @param[in] permissions Mask of permissions granted for @a accessor application
+ *                        (@a ckmc_permission_e)
+ *                        (previous permission mask will be replaced with the new mask value)
+ *
+ * @return @c 0 on success, otherwise a negative error value
+ *
+ * @retval #CKMC_ERROR_NONE                 Successful
+ * @retval #CKMC_ERROR_INVALID_PARAMETER    Input parameter is invalid
+ * @retval #CKMC_ERROR_DB_LOCKED            A user key is not loaded in memory (a user is not logged
+ *                                          in)
+ * @retval #CKMC_ERROR_DB_ALIAS_UNKNOWN     Alias does not exist
+ * @retval #CKMC_ERROR_PERMISSION_DENIED    Failed to access key manager
+ *
+ * @pre User is already logged in and the user key is already loaded into memory in plain text form.
+ *
+ * @see ckmc_set_permission()
+ */
+int ckmc_set_permission_by_adm(uid_t user, const char *alias, const char *accessor, int mask);
+
+
+/**
+ * @deprecated, see ckmc_set_permission_by_adm()
  * @brief Revokes another application's access to client's application data
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  * @privlevel platform
  * @privilege %http://tizen.org/privilege/keymanager.admin
  *
@@ -235,9 +268,8 @@ int ckmc_allow_access_by_adm(uid_t user,
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_allow_access()
- * @see ckmc_deny_access()
- * @see ckmc_allow_access_by_adm()
+ * @see ckmc_set_permission()
+ * @see ckmc_set_permission_by_adm()
  */
 int ckmc_deny_access_by_adm(uid_t user, const char *owner, const char *alias, const char *accessor);