1
/* iso7816.h - ISO 7816 commands
2
* Copyright (C) 2003 Free Software Foundation, Inc.
4
* This file is part of GnuPG.
6
* GnuPG is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* GnuPG 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
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20
* $Id: iso7816.h,v 1.2.2.5 2004/10/14 09:12:36 werner Exp $
26
#if GNUPG_MAJOR_VERSION == 1
30
gpg_error_t iso7816_map_sw (int sw);
32
gpg_error_t iso7816_select_application (int slot,
33
const char *aid, size_t aidlen);
34
gpg_error_t iso7816_select_file (int slot, int tag, int is_dir,
35
unsigned char **result, size_t *resultlen);
36
gpg_error_t iso7816_list_directory (int slot, int list_dirs,
37
unsigned char **result, size_t *resultlen);
38
gpg_error_t iso7816_verify (int slot,
39
int chvno, const char *chv, size_t chvlen);
40
gpg_error_t iso7816_change_reference_data (int slot, int chvno,
41
const char *oldchv, size_t oldchvlen,
42
const char *newchv, size_t newchvlen);
43
gpg_error_t iso7816_reset_retry_counter (int slot, int chvno,
44
const char *newchv, size_t newchvlen);
45
gpg_error_t iso7816_get_data (int slot, int tag,
46
unsigned char **result, size_t *resultlen);
47
gpg_error_t iso7816_put_data (int slot, int tag,
48
const unsigned char *data, size_t datalen);
49
gpg_error_t iso7816_manage_security_env (int slot, int p1, int p2,
50
const unsigned char *data,
52
gpg_error_t iso7816_compute_ds (int slot,
53
const unsigned char *data, size_t datalen,
54
unsigned char **result, size_t *resultlen);
55
gpg_error_t iso7816_decipher (int slot,
56
const unsigned char *data, size_t datalen,
58
unsigned char **result, size_t *resultlen);
59
gpg_error_t iso7816_internal_authenticate (int slot,
60
const unsigned char *data, size_t datalen,
61
unsigned char **result, size_t *resultlen);
62
gpg_error_t iso7816_generate_keypair (int slot,
63
const unsigned char *data, size_t datalen,
64
unsigned char **result, size_t *resultlen);
65
gpg_error_t iso7816_read_public_key (int slot,
66
const unsigned char *data, size_t datalen,
67
unsigned char **result, size_t *resultlen);
68
gpg_error_t iso7816_get_challenge (int slot,
69
int length, unsigned char *buffer);
71
gpg_error_t iso7816_read_binary (int slot, size_t offset, size_t nmax,
72
unsigned char **result, size_t *resultlen);
73
gpg_error_t iso7816_read_record (int slot, int recno, int reccount,
75
unsigned char **result, size_t *resultlen);