OpenCT
0.6.20
openct
protocol.h
1
/*
2
* Protocol for communication between application and
3
* resource manager
4
*
5
* Copyright (C) 2003, Olaf Kirch <okir@suse.de>
6
*/
7
8
#ifndef OPENCT_PROTOCOL_H
9
#define OPENCT_PROTOCOL_H
10
11
#ifdef __cplusplus
12
extern
"C"
{
13
#endif
14
15
/*
16
* A protocol message from client to server
17
* consists of
18
* - command byte
19
* - unit byte
20
* - optional data, TLV encoded
21
*/
22
23
#define CT_CMD_STATUS 0x00
24
#define CT_CMD_LOCK 0x01
/* prevent concurrent access */
25
#define CT_CMD_UNLOCK 0x02
26
#define CT_CMD_RESET 0x10
27
#define CT_CMD_REQUEST_ICC 0x11
28
#define CT_CMD_EJECT_ICC 0x12
29
#define CT_CMD_OUTPUT 0x13
30
#define CT_CMD_PERFORM_VERIFY 0x14
31
#define CT_CMD_CHANGE_PIN 0x15
32
#define CT_CMD_MEMORY_READ 0x16
33
#define CT_CMD_MEMORY_WRITE 0x17
34
#define CT_CMD_INPUT 0x18
35
#define CT_CMD_TRANSACT_OLD 0x20
/* transceive APDU */
36
#define CT_CMD_TRANSACT 0x21
/* transceive APDU */
37
#define CT_CMD_SET_PROTOCOL 0x22
38
39
#define CT_UNIT_ICC1 0x00
40
#define CT_UNIT_ICC2 0x01
41
#define CT_UNIT_ICC3 0x02
42
#define CT_UNIT_ICC4 0x03
43
#define CT_UNIT_READER 0x10
44
#define CT_UNIT_DISPLAY 0x11
45
#define CT_UNIT_KEYPAD 0x12
46
47
/*
48
* TLV items.
49
*/
50
#define CT_TAG_READER_NAME 0x00
/* ASCII string */
51
#define CT_TAG_READER_UNITS 0x01
/* list CT_UNIT_* bytes */
52
#define CT_TAG_CARD_STATUS 0x02
/* IFD_CARD_* byte */
53
#define CT_TAG_ATR 0x03
/* Answer to reset */
54
#define CT_TAG_LOCK 0x04
55
#define CT_TAG_CARD_RESPONSE 0x05
/* Card response to VERIFY etc */
56
#define CT_TAG_TIMEOUT 0x80
57
#define CT_TAG_MESSAGE 0x81
58
#define CT_TAG_LOCKTYPE 0x82
59
#define CT_TAG_PIN_DATA 0x83
/* CTBCS verify APDU */
60
#define CT_TAG_CARD_REQUEST 0x84
61
#define CT_TAG_ADDRESS 0x85
62
#define CT_TAG_DATA 0x86
63
#define CT_TAG_COUNT 0x87
64
#define CT_TAG_PROTOCOL 0x88
65
66
#define __CT_TAG_LARGE 0x40
67
68
#ifdef __cplusplus
69
}
70
#endif
71
72
#endif
/* OPENCT_PROTOCOL_H */
libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>