protocol.h

00001 /*
00002  * Protocol for communication between application and
00003  * resource manager
00004  *
00005  * Copyright (C) 2003, Olaf Kirch <okir@suse.de>
00006  */
00007 
00008 #ifndef OPENCT_PROTOCOL_H
00009 #define OPENCT_PROTOCOL_H
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00015 /*
00016  * A protocol message from client to server
00017  * consists of
00018  *  -   command byte
00019  *  -   unit byte
00020  *  -   optional data, TLV encoded
00021  */
00022 
00023 #define CT_CMD_STATUS           0x00
00024 #define CT_CMD_LOCK             0x01    /* prevent concurrent access */
00025 #define CT_CMD_UNLOCK           0x02
00026 #define CT_CMD_RESET            0x10
00027 #define CT_CMD_REQUEST_ICC      0x11
00028 #define CT_CMD_EJECT_ICC        0x12
00029 #define CT_CMD_OUTPUT           0x13
00030 #define CT_CMD_PERFORM_VERIFY   0x14
00031 #define CT_CMD_CHANGE_PIN       0x15
00032 #define CT_CMD_MEMORY_READ      0x16
00033 #define CT_CMD_MEMORY_WRITE     0x17
00034 #define CT_CMD_INPUT            0x18
00035 #define CT_CMD_TRANSACT_OLD     0x20    /* transceive APDU */
00036 #define CT_CMD_TRANSACT         0x21    /* transceive APDU */
00037 #define CT_CMD_SET_PROTOCOL     0x22
00038 
00039 #define CT_UNIT_ICC1            0x00
00040 #define CT_UNIT_ICC2            0x01
00041 #define CT_UNIT_ICC3            0x02
00042 #define CT_UNIT_ICC4            0x03
00043 #define CT_UNIT_READER          0x10
00044 #define CT_UNIT_DISPLAY         0x11
00045 #define CT_UNIT_KEYPAD          0x12
00046 
00047 /*
00048  * TLV items.
00049  */
00050 #define CT_TAG_READER_NAME      0x00    /* ASCII string */
00051 #define CT_TAG_READER_UNITS     0x01    /* list CT_UNIT_* bytes */
00052 #define CT_TAG_CARD_STATUS      0x02    /* IFD_CARD_* byte */
00053 #define CT_TAG_ATR              0x03    /* Answer to reset */
00054 #define CT_TAG_LOCK             0x04
00055 #define CT_TAG_CARD_RESPONSE    0x05    /* Card response to VERIFY etc */
00056 #define CT_TAG_TIMEOUT          0x80
00057 #define CT_TAG_MESSAGE          0x81
00058 #define CT_TAG_LOCKTYPE         0x82
00059 #define CT_TAG_PIN_DATA         0x83    /* CTBCS verify APDU */
00060 #define CT_TAG_CARD_REQUEST     0x84
00061 #define CT_TAG_ADDRESS          0x85
00062 #define CT_TAG_DATA             0x86
00063 #define CT_TAG_COUNT            0x87
00064 #define CT_TAG_PROTOCOL         0x88
00065 
00066 #define __CT_TAG_LARGE          0x40
00067 
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071 
00072 #endif /* OPENCT_PROTOCOL_H */

libp11, Copyright (C) 2005 Olaf Kirch <okir@lst.de>OpenSC-Project.org Logo