-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiso7816.h
47 lines (39 loc) · 1.36 KB
/
iso7816.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _ISO7816_H_
#define _ISO7816_H_
#define APDU_SUCCESS 0x90
#define SELECT_FILE 0xa4
#define READ_BINARY 0xb0
#define WRITE_BINARY 0xd0
#define UPDATE_BINARY 0xd6
#define ERASE_BINARY 0x0e
#define VERIFY_PIN 0x20
#define CREATE_FILE 0xe0
#define DELETE_FILE 0xe4
#define INVALIDATE 0x04
#define REHABILITATE 0x44
#define BULL_CP8_CLA 0x80
#define PHILIPS_DS_CLA 0x0
#define CARD_CLA card_class
int apdu_send(int fd, unsigned char cla, unsigned char ins,
unsigned char p1, unsigned char p2, unsigned char p3,
int datalen, const char *data);
int apdu_recv(int fd, unsigned char *sw1, unsigned char *sw2, unsigned char *data);
int select_file(int fd, short int fident);
int read_binary(int fd, short int offset, int read_buf_length, char *read_buf);
int write_binary(int fd, short int offset, int write_buf_length, char *write_buf);
int update_binary(int fd, short int offset, int write_buf_length, char *write_buf);
int erase_binary(int fd);
int create_binary(int fd);
int verify_PIN(int fd, char *pin);
int change_PIN(int fd);
int create_file_tpef(int fd, short int fident, short int size,
unsigned char ac1, unsigned char ac2, unsigned char kn1,
unsigned char kn2);
int delete_file(int fd, short int fident);
int generate_key(int fd);
int get_response(int fd);
int invalidate(int fd);
int rehabilitate(int fd);
int read_directory(int fd);
int unblock_code(int fd);
#endif