root/trunk/src/libopensc/errors.h

Revision 3084, 4.1 KB (checked in by aj, 2 years ago)

convert to utf-8.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * errors.h: OpenSC error codes
3 *
4 * Copyright (C) 2001, 2002  Juha YrjölÀ <juha.yrjola@iki.fi>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21#ifndef _OPENSC_ERRORS_H
22#define _OPENSC_ERRORS_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#define SC_SUCCESS                              0
29#define SC_NO_ERROR                             0
30
31/* Errors related to reader operation */
32#define SC_ERROR_READER                         -1100
33#define SC_ERROR_NO_READERS_FOUND               -1101
34#define SC_ERROR_SLOT_NOT_FOUND                 -1102
35#define SC_ERROR_SLOT_ALREADY_CONNECTED         -1103
36#define SC_ERROR_CARD_NOT_PRESENT               -1104
37#define SC_ERROR_CARD_REMOVED                   -1105
38#define SC_ERROR_CARD_RESET                     -1106
39#define SC_ERROR_TRANSMIT_FAILED                -1107
40#define SC_ERROR_KEYPAD_TIMEOUT                 -1108
41#define SC_ERROR_KEYPAD_CANCELLED               -1109
42#define SC_ERROR_KEYPAD_PIN_MISMATCH            -1110
43#define SC_ERROR_KEYPAD_MSG_TOO_LONG            -1111
44#define SC_ERROR_EVENT_TIMEOUT                  -1112
45#define SC_ERROR_CARD_UNRESPONSIVE              -1113
46#define SC_ERROR_READER_DETACHED                -1114
47#define SC_ERROR_READER_REATTACHED              -1115
48
49/* Resulting from a card command or related to the card*/
50#define SC_ERROR_CARD_CMD_FAILED                -1200
51#define SC_ERROR_FILE_NOT_FOUND                 -1201
52#define SC_ERROR_RECORD_NOT_FOUND               -1202
53#define SC_ERROR_CLASS_NOT_SUPPORTED            -1203
54#define SC_ERROR_INS_NOT_SUPPORTED              -1204
55#define SC_ERROR_INCORRECT_PARAMETERS           -1205
56#define SC_ERROR_WRONG_LENGTH                   -1206
57#define SC_ERROR_MEMORY_FAILURE                 -1207
58#define SC_ERROR_NO_CARD_SUPPORT                -1208
59#define SC_ERROR_NOT_ALLOWED                    -1209
60#define SC_ERROR_INVALID_CARD                   -1210
61#define SC_ERROR_SECURITY_STATUS_NOT_SATISFIED  -1211
62#define SC_ERROR_AUTH_METHOD_BLOCKED            -1212
63#define SC_ERROR_UNKNOWN_DATA_RECEIVED          -1213
64#define SC_ERROR_PIN_CODE_INCORRECT             -1214
65#define SC_ERROR_FILE_ALREADY_EXISTS            -1215
66#define SC_ERROR_DATA_OBJECT_NOT_FOUND          -1216
67
68/* Returned by OpenSC library when called with invalid arguments */
69#define SC_ERROR_INVALID_ARGUMENTS              -1300
70#define SC_ERROR_CMD_TOO_SHORT                  -1301
71#define SC_ERROR_CMD_TOO_LONG                   -1302
72#define SC_ERROR_BUFFER_TOO_SMALL               -1303
73#define SC_ERROR_INVALID_PIN_LENGTH             -1304
74#define SC_ERROR_INVALID_DATA                   -1305
75
76/* Resulting from OpenSC internal operation */
77#define SC_ERROR_INTERNAL                       -1400
78#define SC_ERROR_INVALID_ASN1_OBJECT            -1401
79#define SC_ERROR_ASN1_OBJECT_NOT_FOUND          -1402
80#define SC_ERROR_ASN1_END_OF_CONTENTS           -1403
81#define SC_ERROR_OUT_OF_MEMORY                  -1404
82#define SC_ERROR_TOO_MANY_OBJECTS               -1405
83#define SC_ERROR_OBJECT_NOT_VALID               -1406
84#define SC_ERROR_OBJECT_NOT_FOUND               -1407
85#define SC_ERROR_NOT_SUPPORTED                  -1408
86#define SC_ERROR_PASSPHRASE_REQUIRED            -1409
87#define SC_ERROR_EXTRACTABLE_KEY                -1410
88#define SC_ERROR_DECRYPT_FAILED                 -1411
89#define SC_ERROR_WRONG_PADDING                  -1412
90#define SC_ERROR_WRONG_CARD                     -1413
91#define SC_ERROR_CANNOT_LOAD_MODULE             -1414
92#define SC_ERROR_OFFSET_TOO_LARGE               -1415
93
94/* Relating to PKCS #15 init stuff */
95#define SC_ERROR_PKCS15INIT                     -1500
96#define SC_ERROR_SYNTAX_ERROR                   -1501
97#define SC_ERROR_INCONSISTENT_PROFILE           -1502
98#define SC_ERROR_INCOMPATIBLE_KEY               -1503
99#define SC_ERROR_NO_DEFAULT_KEY                 -1504
100#define SC_ERROR_ID_NOT_UNIQUE                  -1505
101#define SC_ERROR_CANNOT_LOAD_KEY                -1006
102#define SC_ERROR_INCOMPATIBLE_OBJECT            -1007
103#define SC_ERROR_TEMPLATE_NOT_FOUND             -1008
104#define SC_ERROR_INVALID_PIN_REFERENCE          -1009
105#define SC_ERROR_FILE_TOO_SMALL                 -1010
106
107/* Errors that do not fit the categories above */
108#define SC_ERROR_UNKNOWN                        -1900
109#define SC_ERROR_PKCS15_APP_NOT_FOUND           -1901
110
111const char *sc_strerror(int sc_errno);
112
113#ifdef __cplusplus
114}
115#endif
116
117#endif
Note: See TracBrowser for help on using the browser.