Modify APIs and doxygen to meet ACR(TIZEN 2.4) requirement 57/36257/1
authoryuseok.jeon <yuseok.jeon@samsung.com>
Wed, 25 Feb 2015 07:00:09 +0000 (16:00 +0900)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 4 Mar 2015 08:31:41 +0000 (09:31 +0100)
Change-Id: I7a883273c6563df23f8e4668d88fbd73d61c2a08
Signed-off-by: yuseok.jeon <yuseok.jeon@samsung.com>
src/include/ckmc/ckmc-manager.h
src/include/ckmc/ckmc-type.h
src/manager/client-capi/ckmc-manager.cpp
src/manager/client-capi/ckmc-type.cpp

index c122b82..3c2ac43 100644 (file)
@@ -75,7 +75,7 @@ extern "C" {
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_remove_key()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_key()
  * @see ckmc_get_key_alias_list()
  * @see #ckmc_key_s
@@ -84,6 +84,7 @@ extern "C" {
 int ckmc_save_key(const char *alias, const ckmc_key_s key, const ckmc_policy_s policy);
 
 /**
+ * @deprecated Deprecated since 2.4. [Use ckmc_remove_alias() instead]
  * @brief Removes a key from key manager.
  *
  * @since_tizen 2.3
@@ -147,7 +148,7 @@ int ckmc_remove_key(const char *alias);
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_key()
- * @see ckmc_remove_key()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_key_alias_list()
  */
 int ckmc_get_key(const char *alias, const char *password, ckmc_key_s **ppkey);
@@ -181,7 +182,7 @@ int ckmc_get_key(const char *alias, const char *password, ckmc_key_s **ppkey);
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_key()
- * @see ckmc_remove_key()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_key()
  */
 int ckmc_get_key_alias_list(ckmc_alias_list_s** ppalias_list);
@@ -217,7 +218,7 @@ int ckmc_get_key_alias_list(ckmc_alias_list_s** ppalias_list);
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_remove_cert()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_cert()
  * @see ckmc_get_cert_alias_list()
  * @see #ckmc_cert_s
@@ -226,6 +227,7 @@ int ckmc_get_key_alias_list(ckmc_alias_list_s** ppalias_list);
 int ckmc_save_cert(const char *alias, const ckmc_cert_s cert, const ckmc_policy_s policy);
 
 /**
+ * @deprecated Deprecated since 2.4. [Use ckmc_remove_alias() instead]
  * @brief Removes a certificate from key manager.
  *
  * @since_tizen 2.3
@@ -290,7 +292,7 @@ int ckmc_remove_cert(const char *alias);
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_cert()
- * @see ckmc_remove_cert()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_cert_alias_list()
  */
 int ckmc_get_cert(const char *alias, const char *password, ckmc_cert_s **ppcert);
@@ -324,7 +326,7 @@ int ckmc_get_cert(const char *alias, const char *password, ckmc_cert_s **ppcert)
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_cert()
- * @see ckmc_remove_cert()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_cert()
  */
 int ckmc_get_cert_alias_list(ckmc_alias_list_s** ppalias_list);
@@ -336,7 +338,7 @@ int ckmc_get_cert_alias_list(ckmc_alias_list_s** ppalias_list);
  * @brief Stores PKCS12's contents inside key manager based on the provided policies.
  * All items from the PKCS12 will use the same alias.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -358,10 +360,10 @@ int ckmc_get_cert_alias_list(ckmc_alias_list_s** ppalias_list);
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_remove_pkcs12()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_pkcs12()
  * @see ckmc_get_data_alias_list()
- * @see ckmc_load_from_pkcs12_file2()
+ * @see ckmc_pkcs12_load()
  * @see #ckmc_pkcs12_s
  * @see #ckmc_policy_s
  */
@@ -371,9 +373,10 @@ int ckmc_save_pkcs12(const char *alias,
                      const ckmc_policy_s cert_policy);
 
 /**
+ * @deprecated Deprecated since 2.4. [Use ckmc_remove_alias() instead]
  * @brief Removes all PKCS12 contents from key manager.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -395,6 +398,7 @@ int ckmc_save_pkcs12(const char *alias,
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
+ * @see ckmc_remove_alias()
  * @see ckmc_save_pkcs12()
  * @see ckmc_get_pkcs12()
  */
@@ -403,7 +407,7 @@ int ckmc_remove_pkcs12(const char *alias);
 /**
  * @brief Gets a pkcs12 from key manager.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -412,8 +416,8 @@ int ckmc_remove_pkcs12(const char *alias);
  *          longer needed.
  *
  * @param[in]  alias        The name of a data to retrieve
- * @param[in]  keyPassword  Password that was used to encrypt privateKey (may be NULL)
- * @param[in]  certPassword Password used to encrypt certificates (may be NULL)
+ * @param[in]  key_password  Password that was used to encrypt privateKey (may be NULL)
+ * @param[in]  cert_password Password used to encrypt certificates (may be NULL)
  * @param[out] pkcs12       The pointer to a newly created ckmc_pkcs12_s handle
  *
  * @return @c 0 on success,
@@ -432,9 +436,9 @@ int ckmc_remove_pkcs12(const char *alias);
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_pkcs12()
- * @see ckmc_remove_pkcs12()
+ * @see ckmc_remove_alias()
  */
-int ckmc_get_pkcs12(const char *alias, const char *keyPassword, const char *certPassword, ckmc_pkcs12_s **pkcs12);
+int ckmc_get_pkcs12(const char *alias, const char *key_password, const char *cert_password, ckmc_pkcs12_s **pkcs12);
 
 /**
  * @brief Stores a data inside key manager based on the provided policy.
@@ -460,7 +464,7 @@ int ckmc_get_pkcs12(const char *alias, const char *keyPassword, const char *cert
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_remove_data()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_data()
  * @see ckmc_get_data_alias_list()
  * @see #ckmc_raw_buffer_s
@@ -469,6 +473,7 @@ int ckmc_get_pkcs12(const char *alias, const char *keyPassword, const char *cert
 int ckmc_save_data(const char *alias, ckmc_raw_buffer_s data, const ckmc_policy_s policy);
 
 /**
+ * @deprecated Deprecated since 2.4. [Use ckmc_remove_alias() instead]
  * @brief Removes a data from key manager.
  *
  * @since_tizen 2.3
@@ -531,7 +536,7 @@ int ckmc_remove_data(const char *alias);
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_data()
- * @see ckmc_remove_data()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_data_alias_list()
  */
 int ckmc_get_data(const char *alias, const char *password, ckmc_raw_buffer_s **ppdata);
@@ -565,7 +570,7 @@ int ckmc_get_data(const char *alias, const char *password, ckmc_raw_buffer_s **p
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
  * @see ckmc_save_data()
- * @see ckmc_remove_data()
+ * @see ckmc_remove_alias()
  * @see ckmc_get_data()
  */
 int ckmc_get_data_alias_list(ckmc_alias_list_s** ppalias_list);
@@ -798,7 +803,6 @@ int ckmc_verify_signature(const char *public_key_alias,
                           const ckmc_rsa_padding_algo_e padding);
 
 /**
- * @deprecated, see ckmc_get_certificate_chain()
  * @brief Verifies a certificate chain and returns that chain.
  *
  * @since_tizen 2.3
@@ -840,7 +844,6 @@ int ckmc_get_cert_chain(const ckmc_cert_s *cert,
                         ckmc_cert_list_s **ppcert_chain_list);
 
 /**
- * @deprecated, see ckmc_get_certificate_chain_with_alias()
  * @brief Verifies a certificate chain using an alias list of untrusted certificates and return that
  *        chain.
  *
@@ -877,7 +880,7 @@ int ckmc_get_cert_chain(const ckmc_cert_s *cert,
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_get_cert_chain())
+ * @see ckmc_get_cert_chain()
  * @see ckmc_cert_list_all_free()
  */
 int ckmc_get_cert_chain_with_alias(const ckmc_cert_s *cert,
@@ -888,7 +891,7 @@ int ckmc_get_cert_chain_with_alias(const ckmc_cert_s *cert,
  * @brief Verifies a certificate chain and returns that chain using user entered trusted and
  *        untrusted CA certificates
  *
- * @since_tizen 3.0
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -921,20 +924,20 @@ int ckmc_get_cert_chain_with_alias(const ckmc_cert_s *cert,
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_get_cert_chain_with_alias())
+ * @see ckmc_get_cert_chain_with_trustedcert_alias()
  * @see ckmc_cert_list_all_free()
  */
-int ckmc_get_certificate_chain(const ckmc_cert_s *cert,
-                               const ckmc_cert_list_s *untrustedcerts,
-                               const ckmc_cert_list_s *trustedcerts,
-                               const bool use_trustedsystemcerts,
-                               ckmc_cert_list_s **ppcert_chain_list);
+int ckmc_get_cert_chain_with_trustedcert(const ckmc_cert_s *cert,
+                                         const ckmc_cert_list_s *untrustedcerts,
+                                         const ckmc_cert_list_s *trustedcerts,
+                                         const bool use_trustedsystemcerts,
+                                         ckmc_cert_list_s **ppcert_chain_list);
 
 /**
  * @brief Verifies a certificate chain and returns that chain using alias lists of untrusted and
  *        trusted certificates
  *
- * @since_tizen 3.0
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -971,19 +974,19 @@ int ckmc_get_certificate_chain(const ckmc_cert_s *cert,
  *
  * @pre User is already logged in and the user key is already loaded into memory in plain text form.
  *
- * @see ckmc_get_cert_chain())
+ * @see ckmc_get_cert_chain_with_trustedcert() 
  * @see ckmc_cert_list_all_free()
  */
-int ckmc_get_certificate_chain_with_alias(const ckmc_cert_s *cert,
-                                          const ckmc_alias_list_s *untrustedcerts,
-                                          const ckmc_alias_list_s *trustedcerts,
-                                          const bool use_trustedsystemcerts,
-                                          ckmc_cert_list_s **ppcert_chain_list);
+int ckmc_get_cert_chain_with_trustedcert_alias(const ckmc_cert_s *cert,
+                                               const ckmc_alias_list_s *untrustedcerts,
+                                               const ckmc_alias_list_s *trustedcerts,
+                                               const bool use_trustedsystemcerts,
+                                               ckmc_cert_list_s **ppcert_chain_list);
 
 /**
  * @brief Perform OCSP which checks certificate is whether revoked or not
  *
- * @since_tizen 3.0
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -1006,7 +1009,7 @@ int ckmc_get_certificate_chain_with_alias(const ckmc_cert_s *cert,
 int ckmc_ocsp_check(const ckmc_cert_list_s *pcert_chain_list, ckmc_ocsp_status_e *ocsp_status);
 
 /**
- * @deprecated, see ckmc_set_permission()
+ * @deprecated Deprecated since 2.4. [Use ckmc_set_permission() instead]
  * @brief Allows another application to access client's application data
  *
  * @since_tizen 2.3
@@ -1038,7 +1041,7 @@ int ckmc_allow_access(const char *alias, const char *accessor, ckmc_access_right
 /**
  * @brief Allows another application to access client's application data
  *
- * @since_tizen 3.0
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
@@ -1065,7 +1068,7 @@ int ckmc_allow_access(const char *alias, const char *accessor, ckmc_access_right
 int ckmc_set_permission(const char *alias, const char *accessor, int permissions);
 
 /**
- * @deprecated, see ckmc_set_permission()
+ * @deprecated Deprecated since 2.4. [Use ckmc_set_permission() instead]
  * @brief Revokes another application's access to client's application data
  *
  * @since_tizen 2.3
@@ -1099,7 +1102,7 @@ int ckmc_deny_access(const char *alias, const char *accessor);
 /**
  * @brief Removes a an entry (no matter of type) from the key manager.
  *
- * @since_tizen 3.0
+ * @since_tizen 2.4
  * @privlevel public
  * @privilege %http://tizen.org/privilege/keymanager
  *
index 2a5d20f..197a02c 100644 (file)
@@ -105,7 +105,7 @@ typedef enum __ckmc_rsa_padding_algo {
 } ckmc_rsa_padding_algo_e;
 
 /**
- * @deprecated, use ckmc_permission_e instead
+ * @deprecated Deprecated since 2.4. [Use ckmc_permission_e() instead]
  * @brief Enumeration for database access rights.
  * @since_tizen 2.3
  */
@@ -116,7 +116,7 @@ typedef enum __ckmc_access_right{
 
 /**
  * @brief Enumeration for permissions to access/modify alias.
- * @since_tizen 3.0
+ * @since_tizen 2.4
  */
 typedef enum __ckmc_permission{
     CKMC_PERMISSION_NONE        = 0x00, /**< clear permissions */
@@ -185,7 +185,7 @@ typedef struct __ckmc_cert_list {
 
 /**
  * @brief Enumeration for OCSP status.
- * @since_tizen 3.0
+ * @since_tizen 2.4
  */
 typedef enum __ckmc_ocsp_status {
     CKMC_OCSP_STATUS_GOOD = 0,          /**< OCSP status is good */
@@ -201,7 +201,7 @@ typedef enum __ckmc_ocsp_status {
 
 /**
  * @brief The structure for PKCS12 used in key manager CAPI.
- * @since_tizen 2.3
+ * @since_tizen 2.4
  */
 typedef struct __ckmc_pkcs12 {
     ckmc_key_s  *priv_key;      /**< private key, may be null */
@@ -352,9 +352,10 @@ void ckmc_cert_free(ckmc_cert_s *cert);
 int ckmc_load_cert_from_file(const char *file_path, ckmc_cert_s **cert);
 
 /**
+ * @internal
  * @brief Creates a new @a ckmc_pkcs12_s handle and returns it.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks You must destroy the newly created @a ckmc_pkcs12_s by calling ckmc_pkcs12_free() if it
  *          is no longer needed.
@@ -375,7 +376,7 @@ int ckmc_load_cert_from_file(const char *file_path, ckmc_cert_s **cert);
  *
  * @see ckmc_pkcs12_free()
  * @see ckmc_load_from_pkcs12_file()
- * @see ckmc_load_from_pkcs12_file2()
+ * @see ckmc_pkcs12_load()
  * @see #ckmc_key_s
  * @see #ckmc_cert_s
  * @see #ckmc_cert_list_s
@@ -387,7 +388,7 @@ int ckmc_pkcs12_new(ckmc_key_s *private_key,
                     ckmc_pkcs12_s **pkcs12_bundle);
 
 /**
- * @deprecated, use @a ckmc_load_from_pkcs12_file2() instead
+ * @deprecated Deprecated since 2.4. [Use ckmc_pkcs12_load() instead]
  * @brief Creates a new @a ckmc_key_s(private key), @a ckmc_cert_s(certificate), and
  *        @a ckmc_cert_list_s(CA certificates) handle from a given PKCS#12 file and returns them.
  *
@@ -416,7 +417,7 @@ int ckmc_pkcs12_new(ckmc_key_s *private_key,
  * @retval #CKMC_ERROR_FILE_ACCESS_DENIED  Provided file does not exist or cannot be accessed
  *
  * @see ckmc_pkcs12_new()
- * @see ckmc_load_from_pkcs12_file2()
+ * @see ckmc_pkcs12_load()
  * @see ckmc_key_free()
  * @see ckmc_cert_free()
  * @see ckmc_cert_list_all_free()
@@ -432,7 +433,7 @@ int ckmc_load_from_pkcs12_file(const char *file_path,
 /**
  * @brief Creates a new @a ckmc_pkcs12_s handle from a given PKCS#12 file and returns it.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @remarks You must destroy the newly created @a ckmc_pkcs12_s by calling ckmc_pkcs12_free() if
  *          they are no longer needed.
@@ -455,19 +456,19 @@ int ckmc_load_from_pkcs12_file(const char *file_path,
  * @see ckmc_pkcs12_free()
  * @see #ckmc_pkcs12_s
  */
-int ckmc_load_from_pkcs12_file2(const char *file_path,
+int ckmc_pkcs12_load(const char *file_path,
                                 const char *passphrase,
                                 ckmc_pkcs12_s **pkcs12_bundle);
 
 /**
  * @brief Destroys the @a ckmc_pkcs12_s handle and releases all its resources.
  *
- * @since_tizen 2.3
+ * @since_tizen 2.4
  *
  * @param[in] pkcs12 The @a ckmc_pkcs12_s handle to destroy
  *
  * @see ckmc_pkcs12_new()
- * @see ckmc_load_from_pkcs12_file2()
+ * @see ckmc_pkcs12_load()
  */
 void ckmc_pkcs12_free(ckmc_pkcs12_s *pkcs12);
 
index 5a5ab79..a5bebf4 100644 (file)
@@ -344,7 +344,7 @@ int ckmc_remove_pkcs12(const char *alias)
 }
 
 KEY_MANAGER_CAPI
-int ckmc_get_pkcs12(const char *alias, const char *keyPassword, const char *certPassword, ckmc_pkcs12_s **pkcs12)
+int ckmc_get_pkcs12(const char *alias, const char *key_password, const char *cert_password, ckmc_pkcs12_s **pkcs12)
 {
     int ret;
     CKM::PKCS12ShPtr pkcs;
@@ -357,11 +357,11 @@ int ckmc_get_pkcs12(const char *alias, const char *keyPassword, const char *cert
         return CKMC_ERROR_INVALID_PARAMETER;
     }
 
-    if (keyPassword)
-        keyPass = keyPassword;
+    if (key_password)
+        keyPass = key_password;
 
-    if (certPassword)
-        certPass = certPassword;
+    if (cert_password)
+        certPass = cert_password;
 
     auto mgr = CKM::Manager::create();
 
@@ -689,11 +689,11 @@ int ckmc_get_cert_chain_with_alias(const ckmc_cert_s *cert, const ckmc_alias_lis
 }
 
 KEY_MANAGER_CAPI
-int ckmc_get_certificate_chain(const ckmc_cert_s* cert,
-                               const ckmc_cert_list_s* untrustedcerts,
-                               const ckmc_cert_list_s* trustedcerts,
-                               const bool sys_certs,
-                               ckmc_cert_list_s** ppcert_chain_list)
+int ckmc_get_cert_chain_with_trustedcert(const ckmc_cert_s* cert,
+                                         const ckmc_cert_list_s* untrustedcerts,
+                                         const ckmc_cert_list_s* trustedcerts,
+                                         const bool sys_certs,
+                                         ckmc_cert_list_s** ppcert_chain_list)
 {
     int ret;
     CKM::ManagerShPtr mgr = CKM::Manager::create();
@@ -722,11 +722,11 @@ int ckmc_get_certificate_chain(const ckmc_cert_s* cert,
 }
 
 KEY_MANAGER_CAPI
-int ckmc_get_certificate_chain_with_alias(const ckmc_cert_s* cert,
-                                          const ckmc_alias_list_s* untrustedcerts,
-                                          const ckmc_alias_list_s* trustedcerts,
-                                          const bool sys_certs,
-                                          ckmc_cert_list_s** ppcert_chain_list)
+int  ckmc_get_cert_chain_with_trustedcert_alias(const ckmc_cert_s* cert,
+                                                const ckmc_alias_list_s* untrustedcerts,
+                                                const ckmc_alias_list_s* trustedcerts,
+                                                const bool sys_certs,
+                                                ckmc_cert_list_s** ppcert_chain_list)
 {
     int ret;
     CKM::ManagerShPtr mgr = CKM::Manager::create();
index 3325284..3553b02 100644 (file)
@@ -392,7 +392,7 @@ int ckmc_load_from_pkcs12_file(const char *file_path, const char *passphrase, ck
 }
 
 KEY_MANAGER_CAPI
-int ckmc_load_from_pkcs12_file2(const char *file_path, const char *passphrase, ckmc_pkcs12_s **pkcs12_bundle)
+int ckmc_pkcs12_load(const char *file_path, const char *passphrase, ckmc_pkcs12_s **pkcs12_bundle)
 {
     int ec;
     ckmc_key_s *private_key = 0;