tizen 2.4 release
[framework/security/key-manager.git] / src / include / ckm / ckm-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    ckm-manager.h
17  * @version 1.0
18  * @brief   This file contains APIs of the Central Key Manager
19 */
20 #ifndef _CKM_ERROR_H_
21 #define _CKM_ERROR_H_
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /**
28  * \name Return Codes
29  * exported by the foundation API.
30  * result codes begin with the start error code and extend into negative direction.
31  * @{
32 */
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
36
37 /*! \brief   indicating the socket between client and Central Key Manager failed  */
38 #define CKM_API_ERROR_BAD_REQUEST -2
39
40 /*! \brief   indicating the response from Central Key Manager is malformed */
41 #define CKM_API_ERROR_BAD_RESPONSE -3
42
43 /*! \brief   indicating the transmitting request failed */
44 /* deprecated unused */
45 #define CKM_API_ERROR_SEND_FAILED -4
46
47 /*! \brief   indicating the receiving response failed */
48 /* deprecated unused */
49 #define CKM_API_ERROR_RECV_FAILED -5
50
51 /*! \brief   indicating the authentication between client and manager failed */
52 #define CKM_API_ERROR_AUTHENTICATION_FAILED -6
53
54 /*! \brief   indicating the API's input parameter is malformed */
55 #define CKM_API_ERROR_INPUT_PARAM -7
56
57 /*! \brief   indicating the output buffer size which is passed as parameter is too small */
58 #define CKM_API_ERROR_BUFFER_TOO_SMALL -8
59
60 /*! \brief   indicating system  is running out of memory state */
61 #define CKM_API_ERROR_OUT_OF_MEMORY -9
62
63 /*! \brief   indicating the access has been denied by Central Key Manager */
64 #define CKM_API_ERROR_ACCESS_DENIED -10
65
66 /*! \brief   indicating Central Key Manager has been failed for some reason */
67 #define CKM_API_ERROR_SERVER_ERROR -11
68
69 /*! \brief   indicating the database was not unlocked - user did not login */
70 #define CKM_API_ERROR_DB_LOCKED -12
71
72 /*! \brief   indicating an internal error inside the database */
73 #define CKM_API_ERROR_DB_ERROR -13
74
75 /*! \brief   indicating that provided alias already exists in the database */
76 #define CKM_API_ERROR_DB_ALIAS_EXISTS -14
77
78 /*! \brief   indicating that request give to database returned no result */
79 #define CKM_API_ERROR_DB_ALIAS_UNKNOWN -15
80
81 /*! \brief   indicating that CA certificate(s) were unknown and chain could not be created */
82 #define CKM_API_ERROR_VERIFICATION_FAILED -16
83
84 /*! \brief   indicating that a provided file or binary has not a valid format */
85 #define CKM_API_ERROR_INVALID_FORMAT -17
86
87 /*! \brief   deprecated please do not use it. This value was replaced with CKM_API_ERROR_FILE_SYSTEM */
88 #define CKM_API_ERROR_FILE_ACCESS_DENIED -18
89
90 /*! \brief   indicating that keys are not exportable and could not be returned to client */
91 #define CKM_API_ERROR_NOT_EXPORTABLE -19
92
93 /*! \brief   indicating that files are corrupted or access to files was denied */
94 #define CKM_API_ERROR_FILE_SYSTEM -20
95
96 /*! \brief   indicating that device needed to run API is not supported */
97 #define CKM_API_ERROR_NOT_SUPPORTED -21
98
99 #define CKM_API_OCSP_STATUS_GOOD                (1<<0)
100 #define CKM_API_OCSP_STATUS_UNSUPPORTED         (1<<1)
101 #define CKM_API_OCSP_STATUS_UNKNOWN             (1<<2)
102 #define CKM_API_OCSP_STATUS_REVOKED             (1<<3)
103 #define CKM_API_OCSP_STATUS_NET_ERROR           (1<<4)
104 #define CKM_API_OCSP_STATUS_INVALID_URL         (1<<5)
105 #define CKM_API_OCSP_STATUS_INVALID_RESPONSE    (1<<6)
106 #define CKM_API_OCSP_STATUS_REMOTE_ERROR        (1<<7)
107 #define CKM_API_OCSP_STATUS_INTERNAL_ERROR      (1<<8)
108
109 /*! \brief   indicating the error with unknown reason */
110 #define CKM_API_ERROR_UNKNOWN -255
111 /** @}*/
112
113 #ifdef __cplusplus
114 }
115 #endif
116
117 #endif