Add explanations of C client APIs
[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 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * @addtogroup CAPI_KEY_MANAGER_MODULE
29  * @{
30  */
31
32 /**
33  * @brief indicating the result of the one specific API is successful
34  */
35 #define CKM_API_SUCCESS 0
36
37 /**
38  * @brief indicating the socket between client and Central Key Manager failed
39  */
40 #define CKM_API_ERROR_SOCKET -1
41
42 /**
43  * @brief indicating the request from client is malformed
44  */
45 #define CKM_API_ERROR_BAD_REQUEST -2
46
47 /**
48  * @brief indicating the response from Central Key Manager is malformed
49  */
50 #define CKM_API_ERROR_BAD_RESPONSE -3
51
52 /**
53  * @brief indicating the transmitting request failed.
54  * @remarks This Error code is deprecated.
55  */
56 #define CKM_API_ERROR_SEND_FAILED -4
57
58 /**
59  * @brief indicating the receiving response failed.
60  * @remarks This Error code is deprecated.
61  */
62 #define CKM_API_ERROR_RECV_FAILED -5
63
64 /**
65  * @brief indicating the authentication between client and manager failed.
66  * @remarks This Error code is deprecated.
67  */
68 #define CKM_API_ERROR_AUTHENTICATION_FAILED -6
69
70 /**
71  * @brief indicating the API's input parameter is malformed
72  */
73 #define CKM_API_ERROR_INPUT_PARAM -7
74
75 /**
76  * @brief indicating the output buffer size which is passed as parameter is too small
77  */
78 #define CKM_API_ERROR_BUFFER_TOO_SMALL -8
79
80 /**
81  * @brief indicating system  is running out of memory state
82  */
83 #define CKM_API_ERROR_OUT_OF_MEMORY -9
84
85 /**
86  * @brief indicating the access has been denied by Central Key Manager
87  */
88 #define CKM_API_ERROR_ACCESS_DENIED -10
89
90 /**
91  * @brief indicating Central Key Manager has been failed for some reason
92  */
93 #define CKM_API_ERROR_SERVER_ERROR -11
94
95 /**
96  * @brief indicating the database was not unlocked - user did not login
97  */
98 #define CKM_API_ERROR_DB_LOCKED -12
99
100 /**
101  * @brief indicating an internal error inside the database
102  */
103 #define CKM_API_ERROR_DB_ERROR -13
104
105 /**
106  * @brief indicating that provided alias already exists in the database
107  */
108 #define CKM_API_ERROR_DB_ALIAS_EXISTS -14
109
110
111 /**
112  * @brief indicating that request given to database returned no result
113  */
114 #define CKM_API_ERROR_DB_ALIAS_UNKNOWN -15
115
116 /**
117  * @brief indicating that CA certificate(s) were unknown and chain could not be created
118  */
119 #define CKM_API_ERROR_VERIFICATION_FAILED -16
120
121 /**
122  * @brief indicating that a provided file or binary has not a valid format
123  */
124 #define CKM_API_ERROR_INVALID_FORMAT -17
125
126 /**
127  * @brief indicating that provided file doesn't exists or cannot be accessed in the file system
128  */
129 #define CKM_API_ERROR_FILE_ACCESS_DENIED -18
130
131 /**
132  * @brief indicating the error with unknown reason
133  */
134 #define CKM_API_ERROR_UNKNOWN -255
135
136
137 /**
138  * @}
139  */
140
141 #ifdef __cplusplus
142 }
143 #endif
144
145 #endif /* __TIZEN_CORE_CKMC_ERROR_H_ */