Fix implementation of exportable flag.
[platform/core/security/key-manager.git] / src / include / ckmc / ckmc-error.h
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  *
16  * @file    ckmc-error.h
17  * @version 1.0
18  * @brief   This file contains error codes of the Key Manager
19 */
20 #ifndef __TIZEN_CORE_CKMC_ERROR_H_
21 #define __TIZEN_CORE_CKMC_ERROR_H_
22
23 #include <tizen.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /**
30  * @addtogroup CAPI_KEY_MANAGER_TYPES_MODULE
31  * @{
32  */
33
34
35 #define KEY_MANAGER_ERROR_CLASS          0x0FFF0000
36
37
38 /**
39  * @brief Enumeration for Key Manager Errors.
40  * @since_tizen 2.3
41  */
42 typedef enum{
43         CKMC_ERROR_NONE                     = TIZEN_ERROR_NONE,               /**< Successful */
44         CKMC_ERROR_INVALID_PARAMETER        = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid function parameter */
45         CKMC_ERROR_OUT_OF_MEMORY            = TIZEN_ERROR_OUT_OF_MEMORY,      /**< Out of memory */
46         CKMC_ERROR_PERMISSION_DENIED        = TIZEN_ERROR_PERMISSION_DENIED,  /**< Permission denied */
47
48         CKMC_ERROR_SOCKET                   = KEY_MANAGER_ERROR_CLASS | 0x01, /**< Socket error between client and Central Key Manager */
49         CKMC_ERROR_BAD_REQUEST                  = KEY_MANAGER_ERROR_CLASS | 0x02,  /**< Invalid request from client */
50         CKMC_ERROR_BAD_RESPONSE             = KEY_MANAGER_ERROR_CLASS | 0x03, /**< Invalid response from Central Key Manager */
51         CKMC_ERROR_SEND_FAILED              = KEY_MANAGER_ERROR_CLASS | 0x04, /**< Transmitting request failed */
52         CKMC_ERROR_RECV_FAILED              = KEY_MANAGER_ERROR_CLASS | 0x05, /**< Receiving response failed */
53         CKMC_ERROR_AUTHENTICATION_FAILED    = KEY_MANAGER_ERROR_CLASS | 0x06, /**< Authentication between client and manager failed */
54         CKMC_ERROR_BUFFER_TOO_SMALL         = KEY_MANAGER_ERROR_CLASS | 0x07, /**< The output buffer size which is passed as parameter is too small */
55         CKMC_ERROR_SERVER_ERROR             = KEY_MANAGER_ERROR_CLASS | 0x08, /**< Central Key Manager has been failed for some reason */
56         CKMC_ERROR_DB_LOCKED                = KEY_MANAGER_ERROR_CLASS | 0x09, /**< The database was not unlocked - user did not login */
57         CKMC_ERROR_DB_ERROR                 = KEY_MANAGER_ERROR_CLASS | 0x0A, /**< An internal error inside the database */
58         CKMC_ERROR_DB_ALIAS_EXISTS          = KEY_MANAGER_ERROR_CLASS | 0x0B, /**< Provided alias already exists in the database */
59         CKMC_ERROR_DB_ALIAS_UNKNOWN         = KEY_MANAGER_ERROR_CLASS | 0x0C, /**< No data for given alias */
60         CKMC_ERROR_VERIFICATION_FAILED      = KEY_MANAGER_ERROR_CLASS | 0x0D, /**< CA certificate(s) were unknown and chain could not be created */
61         CKMC_ERROR_INVALID_FORMAT           = KEY_MANAGER_ERROR_CLASS | 0x0E, /**< A provided file or binary has not a valid format */
62         CKMC_ERROR_FILE_ACCESS_DENIED       = KEY_MANAGER_ERROR_CLASS | 0x0F, /**< A provided file or binary has not a valid format */
63     CKMC_ERROR_NOT_EXPORTABLE           = KEY_MANAGER_ERROR_CLASS | 0x10, /**< Key is not exportable. It could not be returned to client */
64         CKMC_ERROR_UNKNOWN                  = KEY_MANAGER_ERROR_CLASS | 0x11, /**< A provided file or binary has not a valid format */
65 } key_manager_error_e;
66
67
68 /**
69  * @}
70  */
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /* __TIZEN_CORE_CKMC_ERROR_H_ */