2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
18 * @brief This file contains APIs of the Central Key Manager
29 * exported by the foundation API.
30 * result codes begin with the start error code and extend into negative direction.
33 #define CKM_API_SUCCESS 0
34 /*! \brief indicating the result of the one specific API is successful */
35 #define CKM_API_ERROR_SOCKET -1
37 /*! \brief indicating the socket between client and Central Key Manager failed */
38 #define CKM_API_ERROR_BAD_REQUEST -2
40 /*! \brief indicating the response from Central Key Manager is malformed */
41 #define CKM_API_ERROR_BAD_RESPONSE -3
43 /*! \brief indicating the transmitting request failed */
44 /* deprecated unused */
45 #define CKM_API_ERROR_SEND_FAILED -4
47 /*! \brief indicating the receiving response failed */
48 /* deprecated unused */
49 #define CKM_API_ERROR_RECV_FAILED -5
51 /*! \brief indicating the authentication between client and manager failed */
52 #define CKM_API_ERROR_AUTHENTICATION_FAILED -6
54 /*! \brief indicating the API's input parameter is malformed */
55 #define CKM_API_ERROR_INPUT_PARAM -7
57 /*! \brief indicating the output buffer size which is passed as parameter is too small */
58 #define CKM_API_ERROR_BUFFER_TOO_SMALL -8
60 /*! \brief indicating system is running out of memory state */
61 #define CKM_API_ERROR_OUT_OF_MEMORY -9
63 /*! \brief indicating the access has been denied by Central Key Manager */
64 #define CKM_API_ERROR_ACCESS_DENIED -10
66 /*! \brief indicating Central Key Manager has been failed for some reason */
67 #define CKM_API_ERROR_SERVER_ERROR -11
69 /*! \brief indicating the database was not unlocked - user did not login */
70 #define CKM_API_ERROR_DB_LOCKED -12
72 /*! \brief indicating an internal error inside the database */
73 #define CKM_API_ERROR_DB_ERROR -13
75 /*! \brief indicating that provided alias already exists in the database */
76 #define CKM_API_ERROR_DB_ALIAS_EXISTS -14
78 /*! \brief indicating that request give to database returned no result */
79 #define CKM_API_ERROR_DB_ALIAS_UNKNOWN -15
81 /*! \brief indicating that CA certificate(s) were unknown and chain could not be created */
82 #define CKM_API_ERROR_VERIFICATION_FAILED -16
84 /*! \brief indicating that a provided file or binary has not a valid format */
85 #define CKM_API_ERROR_INVALID_FORMAT -17
87 /*! \brief indicating that provided file doesn't exists or cannot be accessed in the file system */
88 #define CKM_API_ERROR_FILE_ACCESS_DENIED -18
90 #define CKM_API_OCSP_STATUS_GOOD (1<<0)
91 #define CKM_API_OCSP_STATUS_UNSUPPORTED (1<<1)
92 #define CKM_API_OCSP_STATUS_UNKNOWN (1<<2)
93 #define CKM_API_OCSP_STATUS_REVOKED (1<<3)
94 #define CKM_API_OCSP_STATUS_NET_ERROR (1<<4)
95 #define CKM_API_OCSP_STATUS_INVALID_URL (1<<5)
96 #define CKM_API_OCSP_STATUS_INVALID_RESPONSE (1<<6)
97 #define CKM_API_OCSP_STATUS_REMOTE_ERROR (1<<7)
98 #define CKM_API_OCSP_STATUS_INTERNAL_ERROR (1<<8)
100 /*! \brief indicating the error with unknown reason */
101 #define CKM_API_ERROR_UNKNOWN -255