3 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
5 * Contact: Bumjin Im <bj.im@samsung.com>
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License
20 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
22 * @brief This file is implementation of client-common functions.
28 #include <sys/types.h>
32 * exported by the foundation API.
33 * result codes begin with the start error code and extend into negative direction.
36 #define KEY_MANAGER_API_SUCCESS 0
37 /*! \brief indicating the result of the one specific API is successful */
38 #define KEY_MANAGER_API_ERROR_SOCKET -1
40 /*! \brief indicating the socket between client and Central Key Manager failed */
41 #define KEY_MANAGER_API_ERROR_BAD_REQUEST -2
43 /*! \brief indicating the response from Central Key Manager is malformed */
44 #define KEY_MANAGER_API_ERROR_BAD_RESPONSE -3
46 /*! \brief indicating the transmitting request failed */
47 /* deprecated unused */
48 #define KEY_MANAGER_API_ERROR_SEND_FAILED -4
50 /*! \brief indicating the receiving response failed */
51 /* deprecated unused */
52 #define KEY_MANAGER_API_ERROR_RECV_FAILED -5
54 /*! \brief indicating the authentication between client and manager failed */
55 #define KEY_MANAGER_API_ERROR_AUTHENTICATION_FAILED -6
57 /*! \brief indicating the API's input parameter is malformed */
58 #define KEY_MANAGER_API_ERROR_INPUT_PARAM -7
60 /*! \brief indicating the output buffer size which is passed as parameter is too small */
61 #define KEY_MANAGER_API_ERROR_BUFFER_TOO_SMALL -8
63 /*! \brief indicating system is running out of memory state */
64 #define KEY_MANAGER_API_ERROR_OUT_OF_MEMORY -9
66 /*! \brief indicating the access has been denied by Central Key Manager */
67 #define KEY_MANAGER_API_ERROR_ACCESS_DENIED -10
69 /*! \brief indicating Central Key Manager has been failed for some reason */
70 #define KEY_MANAGER_API_ERROR_SERVER_ERROR -11
72 /*! \brief indicating the database was not unlocked - user did not login */
73 #define KEY_MANAGER_API_ERROR_DB_LOCKED -12
75 /*! \brief indicating that request give to database returned no result */
76 #define KEY_MANAGER_API_ERROR_DB_BAD_REQUEST -13
78 /*! \brief indicating an internal error inside the database */
79 #define KEY_MANAGER_API_ERROR_DB_ERROR -14
81 /*! \brief indicating that provided alias already exists in the database */
82 #define KEY_MANAGER_API_ERROR_DB_ALIAS_EXISTS -15
84 /*! \brief indicating that provided file doesn't exists or cannot be accessed in the file system */
85 #define KEY_MANAGER_API_ERROR_FILE_ACCESS_DENIED -16
87 /*! \brief indicating that a provided file or binary has not a valid format */
88 #define KEY_MANAGER_API_ERROR_INVALID_FORMAT -17
91 /*! \brief indicating the error with unknown reason */
92 #define KEY_MANAGER_API_ERROR_UNKNOWN -255
99 const char * ckm_error_to_string(int error);
114 #endif /* CKMC_ERROR_H */