tizen 2.4 release
[framework/security/key-manager.git] / src / include / ckmc / ckmc-type.h
index ef9cc7c..ad0100e 100644 (file)
@@ -15,7 +15,7 @@
  *
  *
  * @file        ckmc-type.h
- * @version     1.0
+ * @version     1.2
  * @brief       Definitions of struct for the Key Manager's CAPI and their utility functions.
  */
 
@@ -23,7 +23,7 @@
 #define __TIZEN_CORE_CKMC_TYPE_H
 
 #include <stddef.h>
-#include <ckmc/ckmc-error.h>
+#include <stdbool.h>
 
 #define KEY_MANAGER_CAPI __attribute__((visibility("default")))
 
@@ -38,18 +38,20 @@ extern "C" {
  */
 
 /**
- * alias can be provided as an alias alone, or together with label - in this
- * case, separator " " (space bar) is used to separate label and alias.
+ * @brief Sperator between alias and label.
+ * @since_tizen 2.3
+ * @remarks Alias can be provided as an alias alone, or together with label - in this
+ *          case, separator " " (space bar) is used to separate label and alias.
  * @see key-manager_doc.h
  */
 KEY_MANAGER_CAPI extern char const * const ckmc_label_name_separator;
 
 /**
  * @brief Enumeration for key types of key manager.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_key_type {
-    CKMC_KEY_NONE = 0,       /**< key type not specified */
+    CKMC_KEY_NONE = 0,       /**< Key type not specified */
     CKMC_KEY_RSA_PUBLIC,     /**< RSA public key */
     CKMC_KEY_RSA_PRIVATE,    /**< RSA private key */
     CKMC_KEY_ECDSA_PUBLIC,   /**< ECDSA public key */
@@ -61,7 +63,7 @@ typedef enum __ckmc_key_type {
 
 /**
  * @brief Enumeration for data format.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_data_format {
     CKMC_FORM_DER_BASE64 = 0,  /**< DER format base64 encoded data */
@@ -72,7 +74,7 @@ typedef enum __ckmc_data_format {
 
 /**
  * @brief Enumeration for elliptic curve.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_ec_type {
     CKMC_EC_PRIME192V1 = 0, /**< Elliptic curve domain "secp192r1" listed in "SEC 2" recommended
@@ -84,7 +86,7 @@ typedef enum __ckmc_ec_type {
 
 /**
  * @brief Enumeration for hash algorithm.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_hash_algo {
     CKMC_HASH_NONE = 0, /**< No Hash Algorithm  */
@@ -96,7 +98,7 @@ typedef enum __ckmc_hash_algo {
 
 /**
  * @brief Enumeration for RSA padding algorithm.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_rsa_padding_algo {
     CKMC_NONE_PADDING = 0,  /**< No Padding */
@@ -105,17 +107,28 @@ typedef enum __ckmc_rsa_padding_algo {
 } ckmc_rsa_padding_algo_e;
 
 /**
+ * @deprecated Deprecated since 2.4. [Use ckmc_permission_e() instead]
  * @brief Enumeration for database access rights.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef enum __ckmc_access_right{
-    CKMC_AR_READ = 0,       /**< access right for read*/
-    CKMC_AR_READ_REMOVE     /**< access right for read and remove*/
+    CKMC_AR_READ = 0,       /**< Access right for read*/
+    CKMC_AR_READ_REMOVE     /**< Access right for read and remove*/
 } ckmc_access_right_e;
 
 /**
+ * @brief Enumeration for permissions to access/modify alias.
+ * @since_tizen 2.4
+ */
+typedef enum __ckmc_permission{
+    CKMC_PERMISSION_NONE        = 0x00, /**< Clear permissions */
+    CKMC_PERMISSION_READ        = 0x01, /**< Eead allowed */
+    CKMC_PERMISSION_REMOVE      = 0x02  /**< Remove allowed */
+} ckmc_permission_e;
+
+/**
  * @brief the structure for binary buffer used in key manager CAPI.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_raw_buff {
     unsigned char* data; /**< Byte array containing binary data */
@@ -124,7 +137,7 @@ typedef struct __ckmc_raw_buff {
 
 /**
  * @brief The structure for a policy for storing key/certificate/binary data.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_policy {
     char* password;   /**< Byte array used to encrypt data inside CKM. If it is not null, the data
@@ -135,7 +148,7 @@ typedef struct __ckmc_policy {
 
 /**
  * @brief The structure for key used in key manager CAPI.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_key {
     unsigned char* raw_key;   /**< Byte array of key. raw_key may be encrypted with password */
@@ -146,7 +159,7 @@ typedef struct __ckmc_key {
 
 /**
  * @brief The structure for certificate used in key manager CAPI.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_cert {
     unsigned char* raw_cert;  /**< Byte array of certificate */
@@ -156,7 +169,7 @@ typedef struct __ckmc_cert {
 
 /**
  * @brief The structure for linked list of alias.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_alias_list {
     char *alias;  /**< The name of key, certificate or data stored in key manager */
@@ -164,35 +177,59 @@ typedef struct __ckmc_alias_list {
 } ckmc_alias_list_s;
 
 /**
- * @brief The structure for linked list of ckmc_cert_s
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @brief The structure for linked list of #ckmc_cert_s.
+ * @since_tizen 2.3
  */
 typedef struct __ckmc_cert_list {
-    ckmc_cert_s *cert; /**< The pointer of ckmc_cert_s */
-    struct __ckmc_cert_list *next; /**< The pointer pointing to the next ckmc_cert_list_s */
+    ckmc_cert_s *cert; /**< The pointer of #ckmc_cert_s */
+    struct __ckmc_cert_list *next; /**< The pointer pointing to the next #ckmc_cert_list_s */
 } ckmc_cert_list_s;
 
+/**
+ * @brief Enumeration for OCSP status.
+ * @since_tizen 2.4
+ */
+typedef enum __ckmc_ocsp_status {
+    CKMC_OCSP_STATUS_GOOD = 0,          /**< OCSP status is good */
+    CKMC_OCSP_STATUS_REVOKED,           /**< The certificate is revoked */
+    CKMC_OCSP_STATUS_UNKNOWN,           /**< Unknown error */
+    CKMC_OCSP_ERROR_UNSUPPORTED,        /**< The certificate does not provide OCSP extension */
+    CKMC_OCSP_ERROR_INVALID_URL,        /**< The invalid URL in certificate OCSP extension */
+    CKMC_OCSP_ERROR_INVALID_RESPONSE,   /**< The invalid response from OCSP server */
+    CKMC_OCSP_ERROR_REMOTE,             /**< OCSP remote server error */
+    CKMC_OCSP_ERROR_NET,                /**< Network connection error */
+    CKMC_OCSP_ERROR_INTERNAL            /**< OpenSSL API error */
+} ckmc_ocsp_status_e;
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_key_s handle and returns it.
+ * @brief The structure for PKCS12 used in key manager CAPI.
+ * @since_tizen 2.4
+ */
+typedef struct __ckmc_pkcs12 {
+    ckmc_key_s  *priv_key;      /**< The private key, may be null */
+    ckmc_cert_s *cert;          /**< The certificate, may be null */
+    ckmc_cert_list_s *ca_chain; /**< The chain certificate list, may be null */
+} ckmc_pkcs12_s;
+
+
+/**
+ * @brief Creates a new #ckmc_key_s handle and returns it.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks You must destroy the newly created @a ckmc_key_s by calling ckmc_key_free() if it is no
- *          longer needed.
+ * @remarks You must destroy the newly created @a ppkey by calling ckmc_key_free()
+ *          if it is no longer needed.
  *
- * @param[in] raw_key  The byte array of key \n
- *                     @a raw_key may be encrypted with password.
+ * @param[in] raw_key  The byte array of key @a raw_key may be encrypted with password
  * @param[in] key_size The byte size of @a raw_key
  * @param[in] key_type The @a raw_key's type
  * @param[in] password The byte array used to decrypt @a raw_key inside key manager \n
- *                     If @a raw_key is not encrypted, @a password can be null.
- * @param[out] ppkey   The pointer to a newly created @a ckmc_key_s handle
+ *                     If @a raw_key is not encrypted, @a password can be null
+ * @param[out] ppkey   The pointer to a newly created #ckmc_key_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE              Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY     Not enough memory
  *
@@ -202,75 +239,74 @@ typedef struct __ckmc_cert_list {
 int ckmc_key_new(unsigned char *raw_key,
                  size_t key_size,
                  ckmc_key_type_e key_type,
-                 char *password, ckmc_key_s **ppkey);
+                 char *password,
+                 ckmc_key_s **ppkey);
 
 /**
- * @brief Destroys the @a ckmc_key_s handle and releases all its resources.
+ * @brief Destroys the #ckmc_key_s handle and releases all its resources.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @param[in] key The @a ckmc_key_s handle to destroy
+ * @param[in] key The #ckmc_key_s handle to destroy
  *
  */
 void ckmc_key_free(ckmc_key_s *key);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_raw_buffer_s handle and returns it.
+ * @brief Creates a new #ckmc_raw_buffer_s handle and returns it.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks You must destroy the newly created @a ckmc_raw_buffer_s by calling ckmc_buffer_free() if
- *          it is no longer needed.
+ * @remarks You must destroy the newly created @a ppbuffer by calling ckmc_buffer_free()
+ *          if it is no longer needed.
  *
  * @param[in]  data      The byte array of buffer
  * @param[in]  size      The byte size of buffer
- * @param[out] ppbuffer  The pointer to a newly created @a ckmc_buffer_s handle
+ * @param[out] ppbuffer  The pointer to a newly created #ckmc_buffer_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE               Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
  *
  * @see ckmc_buffer_free()
  * @see #ckmc_raw_buffer_s
  */
-int ckmc_buffer_new(unsigned char *data, size_t size,ckmc_raw_buffer_s **ppbuffer);
+int ckmc_buffer_new(unsigned char *data, size_t size, ckmc_raw_buffer_s **ppbuffer);
 
 /**
- * @brief Destroys the @a ckmc_raw_buffer_s handle and releases all its resources.
+ * @brief Destroys the #ckmc_raw_buffer_s handle and releases all its resources.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @param[in] buffer The @a ckmc_raw_buffer_s handle to destroy
+ * @param[in] buffer The #ckmc_raw_buffer_s structure to destroy
  *
  */
 void ckmc_buffer_free(ckmc_raw_buffer_s *buffer);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_cert_s handle and returns it.
+ * @brief Creates a new #ckmc_cert_s handle and returns it.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks You must destroy the newly created @a ckmc_cert_s by calling ckmc_cert_free() if it is
- *          no longer needed.
+ * @remarks You must destroy the newly created @a ppcert by calling ckmc_cert_free()
+ *          if it is no longer needed.
  *
  * @param[in]  raw_cert     The byte array of certificate
  * @param[in]  cert_size    The byte size of raw_cert
  * @param[in]  data_format  The encoding format of raw_cert
- * @param[out] ppcert       The pointer to a newly created @a ckmc_cert_s handle
+ * @param[out] ppcert       The pointer to a newly created #ckmc_cert_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE               Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
  *
  * @see ckmc_cert_free()
  * @see ckmc_load_cert_from_file()
- * @see ckmc_load_from_pkcs12_file()
+ * @see #ckmc_data_format_e
  * @see #ckmc_cert_s
  */
 int ckmc_cert_new(unsigned char *raw_cert,
@@ -279,31 +315,31 @@ int ckmc_cert_new(unsigned char *raw_cert,
                   ckmc_cert_s **ppcert);
 
 /**
- * @brief Destroys the @a ckmc_cert handle and releases all its resources.
+ * @brief Destroys the #ckmc_cert handle and releases all its resources.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @param[in] cert The @a ckmc_cert_s handle to destroy
+ * @param[in] cert The #ckmc_cert_s handle to destroy
  *
  * @see ckmc_load_cert_from_file()
  * @see ckmc_load_from_pkcs12_file()
+ * @see #ckmc_cert_s
  */
 void ckmc_cert_free(ckmc_cert_s *cert);
 
 /**
- * @brief Creates a new @a ckmc_cert_s handle from a given file and returns it.
+ * @brief Creates a new #ckmc_cert_s handle from a given file and returns it.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @remarks You must destroy the newly created @a ckmc_cert_s by calling ckmc_cert_free() if it is
- *          no longer needed.
+ * @remarks You must destroy the newly created @a cert by calling ckmc_cert_free()
+ *          if it is no longer needed.
  *
  * @param[in]  file_path  The path of certificate file to be loaded \n
- *                        The only DER or PEM encoded certificate file is supported.
- * @param[out] cert       The pointer of newly created @a ckmc_cert_s handle
+ *                        The only DER or PEM encoded certificate file is supported
+ * @param[out] cert       The pointer of newly created #ckmc_cert_s handle
  *
- * @return #CKMC_ERROR_NONE on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
  * @retval #CKMC_ERROR_NONE                Successful
  * @retval #CKMC_ERROR_OUT_OF_MEMORY       Not enough memory space
@@ -311,39 +347,75 @@ void ckmc_cert_free(ckmc_cert_s *cert);
  * @retval #CKMC_ERROR_FILE_ACCESS_DENIED  Provided file does not exist or cannot be accessed
  *
  * @see ckmc_cert_free()
- * @see ckmc_load_from_pkcs12_file()
  * @see #ckmc_cert_s
  */
 int ckmc_load_cert_from_file(const char *file_path, ckmc_cert_s **cert);
 
 /**
- * @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.
+ * @brief Creates a new #ckmc_pkcs12_s handle and returns it.
+ *
+ * @since_tizen 2.4
+ *
+ * @remarks You must destroy the newly created @a pkcs12_bundle by calling ckmc_pkcs12_free()
+ *          if it is no longer needed.
+ * @remarks On success, @a private_key, @a cert and @a ca_cert_list ownership is transferred
+ *          into newly returned #ckmc_pkcs12_s.
+ *
+ * @param[in]  private_key      #ckmc_key_s handle to the private key (optional)
+ * @param[in]  cert             #ckmc_cert_s handle to the certificate (optional)
+ * @param[in]  ca_cert_list     #ckmc_cert_list_s list of chain certificate handles (optional)
+ * @param[out] pkcs12_bundle    The pointer to a newly created #ckmc_pkcs12_s handle
+ *
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
+ *
+ * @retval #CKMC_ERROR_NONE               Successful
+ * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid or @a private_key, @a cert
+ *                                        and @a ca_cert_list all are null
+ * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
+ *
+ * @see ckmc_pkcs12_free()
+ * @see ckmc_load_from_pkcs12_file()
+ * @see ckmc_pkcs12_load()
+ * @see #ckmc_key_s
+ * @see #ckmc_cert_s
+ * @see #ckmc_cert_list_s
+ * @see #ckmc_pkcs12_s
+ */
+int ckmc_pkcs12_new(ckmc_key_s *private_key,
+                    ckmc_cert_s *cert,
+                    ckmc_cert_list_s *ca_cert_list,
+                    ckmc_pkcs12_s **pkcs12_bundle);
+
+/**
+ * @deprecated Deprecated since 2.4. [Use ckmc_pkcs12_load() instead]
+ * @brief Creates a new @a private_key, @a cert and @a ca_cert_list handle from a given
+ *        PKCS12 file and returns them.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @remarks You must destroy the newly created @a ckmc_key_s, @a ckmc_cert_s, and
- *          @a ckmc_cert_list_s by calling ckmc_key_free(), ckmc_cert_free(), and
+ * @remarks You must destroy the newly created @a private_key, @a cert and
+ *          @a ca_cert_list by calling ckmc_key_free(), ckmc_cert_free() and
  *          ckmc_cert_list_all_free() if they are no longer needed.
  *
  * @param[in]  file_path    The path of PKCS12 file to be loaded
  * @param[in]  passphrase   The passphrase used to decrypt the PCKS12 file \n
- *                          If PKCS12 file is not encrypted, passphrase can be null.
- * @param[out] private_key  The pointer of newly created @a ckmc_key_s handle for a private key
- * @param[out] cert         The pointer of newly created @a ckmc_cert_s handle for a certificate \n
- *                          It is null if the PKCS12 file does not contain a certificate.
- * @param[out] ca_cert_list The pointer of newly created @a ckmc_cert_list_s handle for CA
+ *                          If PKCS12 file is not encrypted, passphrase can be null
+ * @param[out] private_key  The pointer of newly created #ckmc_key_s handle for a private key
+ * @param[out] cert         The pointer of newly created #ckmc_cert_s handle for a certificate \n
+ *                          It is null if the PKCS12 file does not contain a certificate
+ * @param[out] ca_cert_list The pointer of newly created #ckmc_cert_list_s handle for CA
  *                          certificates \n
- *                          It is null if the PKCS12 file does not contain CA certificates.
+ *                          It is null if the PKCS12 file does not contain CA certificates
  *
- * @return #CKMC_ERROR_NONE on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
  * @retval #CKMC_ERROR_NONE                Successful
  * @retval #CKMC_ERROR_OUT_OF_MEMORY       Not enough memory space
  * @retval #CKMC_ERROR_INVALID_FORMAT      Invalid PKCS12 file format
  * @retval #CKMC_ERROR_FILE_ACCESS_DENIED  Provided file does not exist or cannot be accessed
  *
+ * @see ckmc_pkcs12_new()
+ * @see ckmc_pkcs12_load()
  * @see ckmc_key_free()
  * @see ckmc_cert_free()
  * @see ckmc_cert_list_all_free()
@@ -353,27 +425,67 @@ int ckmc_load_cert_from_file(const char *file_path, ckmc_cert_s **cert);
  */
 int ckmc_load_from_pkcs12_file(const char *file_path,
                                const char *passphrase,
-                               ckmc_key_s **private_key, ckmc_cert_s **cert,
+                               ckmc_key_s **private_key,
+                               ckmc_cert_s **cert,
                                ckmc_cert_list_s **ca_cert_list);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_alias_list_s handle and returns it.
- *        The alias pointer in the returned @a ckmc_alias_list_s handle points to the provided
+ * @brief Creates a new #ckmc_pkcs12_s handle from a given PKCS#12 file and returns it.
+ *
+ * @since_tizen 2.4
+ *
+ * @remarks You must destroy the newly created @a pkcs12_bundle by calling ckmc_pkcs12_free() if
+ *          they are no longer needed.
+ *
+ * @param[in]  file_path     The path of PKCS12 file to be loaded
+ * @param[in]  passphrase    The passphrase used to decrypt the PCKS12 file \n
+ *                           If PKCS12 file is not encrypted, passphrase can be null
+ * @param[out] pkcs12_bundle The pointer of newly created #ckmc_cert_list_s handle for CA
+ *                           certificates \n
+ *                           It is null if the PKCS12 file does not contain CA certificates
+ *
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
+ *
+ * @retval #CKMC_ERROR_NONE                Successful
+ * @retval #CKMC_ERROR_OUT_OF_MEMORY       Not enough memory space
+ * @retval #CKMC_ERROR_INVALID_FORMAT      Invalid PKCS12 file format
+ * @retval #CKMC_ERROR_FILE_ACCESS_DENIED  Provided file does not exist or cannot be accessed
+ *
+ * @see ckmc_pkcs12_free()
+ * @see #ckmc_pkcs12_s
+ */
+int ckmc_pkcs12_load(const char *file_path,
+                     const char *passphrase,
+                     ckmc_pkcs12_s **pkcs12_bundle);
+
+/**
+ * @brief Destroys the #ckmc_pkcs12_s handle and releases all its resources.
+ *
+ * @since_tizen 2.4
+ *
+ * @param[in] pkcs12 The #ckmc_pkcs12_s handle to destroy
+ *
+ * @see ckmc_pkcs12_new()
+ * @see ckmc_pkcs12_load()
+ */
+void ckmc_pkcs12_free(ckmc_pkcs12_s *pkcs12);
+
+/**
+ * @brief Creates a new #ckmc_alias_list_s handle and returns it.
+ *        The alias pointer in the returned #ckmc_alias_list_s handle points to the provided
  *        characters and next is null.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks You must destroy the newly created @a ckmc_alias_list_s
- *          by calling ckmc_alias_list_free() or ckmc_alias_list_all_free() if it is no longer
- *          needed.
+ * @remarks You must destroy the newly created @a ppalias_list by calling ckmc_alias_list_free()
+ *          or ckmc_alias_list_all_free() if it is no longer needed.
  *
- * @param[in]  alias        The first item to be set in the newly created @a ckmc_alias_list_s
- * @param[out] ppalias_list The pointer to a newly created @a ckmc_alias_list_s handle
+ * @param[in]  alias        The first item to be set in the newly created #ckmc_alias_list_s
+ * @param[out] ppalias_list The pointer to a newly created #ckmc_alias_list_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE              Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY     Not enough memory
  *
@@ -383,21 +495,20 @@ int ckmc_load_from_pkcs12_file(const char *file_path,
 int ckmc_alias_list_new(char *alias, ckmc_alias_list_s **ppalias_list);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_alias_list_s handle, adds it to a previous @a ckmc_alias_list_s and
- *        returns it. The alias pointer in the returned @a ckmc_alias_list_s handle points to the
+ * @brief Creates a new #ckmc_alias_list_s handle, adds it to a @a previous and returns it.
+ *        The alias pointer in the returned #ckmc_alias_list_s handle points to the
  *        provided characters and next is null.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @param[in]  previous  The last @a ckmc_alias_list_s handle to which a newly created
- *                       @a ckmc_alias_list_s is added
- * @param[in]  alias     The item to be set in the newly created @a ckmc_alias_list_s
- * @param[out] pplast    The pointer to a newly created and added @a ckmc_alias_list_s handle
+ * @param[in]  previous  The last #ckmc_alias_list_s handle to which a newly created
+ *                       #ckmc_alias_list_s is added
+ * @param[in]  alias     The item to be set in the newly created #ckmc_alias_list_s
+ * @param[out] pplast    The pointer to a newly created and added #ckmc_alias_list_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE               Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
  *
@@ -409,15 +520,14 @@ int ckmc_alias_list_add(ckmc_alias_list_s *previous,
                         ckmc_alias_list_s **pplast);
 
 /**
- * @internal
- * @brief Destroys the @a ckmc_alias_list_s handle and releases resources of @a ckmc_alias_list_s
- *        from the provided first handle cascadingly.
+ * @brief Destroys the #ckmc_alias_list_s handle and releases resources from the provided
+ *        @a first handle cascadingly.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks It does not destroy an alias itself in @a ckmc_alias_list_s.
+ * @remarks It does not destroy an alias itself in #ckmc_alias_list_s.
  *
- * @param[in] first The first @a ckmc_alias_list_s handle to destroy
+ * @param[in] first The first #ckmc_alias_list_s handle to destroy
  *
  * @see ckmc_alias_list_all_free()
  * @see #ckmc_alias_list_s
@@ -425,36 +535,36 @@ int ckmc_alias_list_add(ckmc_alias_list_s *previous,
 void ckmc_alias_list_free(ckmc_alias_list_s *first);
 
 /**
- * @brief Destroys the @a ckmc_alias_list_s handle and releases all its resources from the provided
- *        first handle cascadingly.
+ * @brief Destroys the #ckmc_alias_list_s handle and releases all its resources from the provided
+ *        @a first handle cascadingly.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks It also destroys the alias in @a ckmc_alias_list_s.
+ * @remarks It also destroys the alias in #ckmc_alias_list_s.
  *
- * @param[in] first The first @a ckmc_alias_list_s handle to destroy
+ * @param[in] first The first #ckmc_alias_list_s handle to destroy
  *
+ * @see ckmc_alias_list_free()
  * @see #ckmc_alias_list_s
  */
 void ckmc_alias_list_all_free(ckmc_alias_list_s *first);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_cert_list_s handle and returns it.
- *        The cert pointer in the returned @a ckmc_cert_list_s handle points to the provided
- *        @a ckmc_cert_s and next is null.
+ * @brief Creates a new #ckmc_cert_list_s handle and returns it.
+ *        The cert pointer in the returned #ckmc_cert_list_s handle points to the provided
+ *        #ckmc_cert_s and next is null.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks You must destroy the newly created @a ckmc_cert_list_s by calling ckmc_cert_list_free()
+ * @remarks You must destroy the newly created @a ppalias_list by calling ckmc_cert_list_free()
  *          or ckmc_cert_list_all_free() if it is no longer needed.
  *
- * @param[in]  cert          The first item to be set in the newly created @a ckmc_cert_list_s
- * @param[out] ppalias_list  The pointer to a newly created @a ckmc_alias_list_s handle
+ * @param[in]  cert          The first item to be set in the newly created #ckmc_cert_list_s
+ * @param[out] ppalias_list  The pointer to a newly created #ckmc_alias_list_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE               Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
  *
@@ -464,21 +574,20 @@ void ckmc_alias_list_all_free(ckmc_alias_list_s *first);
 int ckmc_cert_list_new(ckmc_cert_s *cert, ckmc_cert_list_s **ppalias_list);
 
 /**
- * @internal
- * @brief Creates a new @a ckmc_cert_list_s handle, adds it to a previous @a ckmc_cert_list_s and
- *        returns it. The cert pointer in the returned @a ckmc_alias_list_s handle points to the
- *        provided @a ckmc_cert_s and next is null.
+ * @brief Creates a new #ckmc_cert_list_s handle, adds it to a previous #ckmc_cert_list_s and
+ *        returns it. The cert pointer in the returned #ckmc_alias_list_s handle points to the
+ *        provided #ckmc_cert_s and next is null.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @param[in]  previous  The last @a ckmc_cert_list_s handle to which a newly created
- *                       @a ckmc_cert_list_s is added
- * @param[in]  cert      The item to be set in the newly created @a ckmc_cert_list_s
- * @param[out] pplast    The pointer to a newly created and added @a ckmc_alias_list_s handle
+ * @param[in]  previous  The last #ckmc_cert_list_s handle to which a newly created
+ *                       #ckmc_cert_list_s is added
+ * @param[in]  cert      The item to be set in the newly created #ckmc_cert_list_s
+ * @param[out] pplast    The pointer to a newly created and added #ckmc_alias_list_s handle
  *
- * @return @c 0 on success,
- *         otherwise a negative error value
+ * @return #CKMC_ERROR_NONE on success, otherwise a negative error value
  *
+ * @retval #CKMC_ERROR_NONE               Successful
  * @retval #CKMC_ERROR_INVALID_PARAMETER  Input parameter is invalid
  * @retval #CKMC_ERROR_OUT_OF_MEMORY      Not enough memory
  *
@@ -488,15 +597,14 @@ int ckmc_cert_list_new(ckmc_cert_s *cert, ckmc_cert_list_s **ppalias_list);
 int ckmc_cert_list_add(ckmc_cert_list_s *previous, ckmc_cert_s *cert, ckmc_cert_list_s **pplast);
 
 /**
- * @internal
- * @brief Destroys the @a ckmc_cert_list_s handle and releases resources of @a ckmc_cert_list_s
- *        from the provided first handle cascadingly.
+ * @brief Destroys the #ckmc_cert_list_s handle and releases resources from the provided
+ *        @a first handle cascadingly.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.4
  *
- * @remarks It does not destroy @a ckmc_cert_s itself in @a ckmc_cert_list_s.
+ * @remarks It does not destroy #ckmc_cert_s itself in #ckmc_cert_list_s.
  *
- * @param[in] first The first @a ckmc_cert_list_s handle to destroy
+ * @param[in] first The first #ckmc_cert_list_s handle to destroy
  *
  * @see ckmc_cert_list_all_free()
  * @see #ckmc_cert_list_s
@@ -504,15 +612,16 @@ int ckmc_cert_list_add(ckmc_cert_list_s *previous, ckmc_cert_s *cert, ckmc_cert_
 void ckmc_cert_list_free(ckmc_cert_list_s *first);
 
 /**
- * @brief Destroys the @a ckmc_cert_list_s handle and releases all its resources from the provided
- *        first handle cascadingly.
+ * @brief Destroys the #ckmc_cert_list_s handle and releases all its resources from the provided
+ *        @a first handle cascadingly.
  *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since_tizen 2.3
  *
- * @remarks It also destroys @a ckmc_cert_s in ckmc_cert_list_s.
+ * @remarks It also destroys #ckmc_cert_s in #ckmc_cert_list_s.
  *
- * @param[in] first The first @a ckmc_cert_list_s handle to destroy
+ * @param[in] first The first #ckmc_cert_list_s handle to destroy
  *
+ * @see ckmc_cert_list_free()
  * @see #ckmc_cert_list_s
  */
 void ckmc_cert_list_all_free(ckmc_cert_list_s *first);