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 3 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, see <http://www.gnu.org/licenses/>.
25 #if GNUPG_MAJOR_VERSION == 1
29 gpg_error_t iso7816_map_sw (int sw);
31 gpg_error_t iso7816_select_application (int slot,
32 const char *aid, size_t aidlen);
33 gpg_error_t iso7816_select_file (int slot, int tag, int is_dir,
34 unsigned char **result, size_t *resultlen);
35 gpg_error_t iso7816_select_path (int slot,
36 const unsigned short *path, size_t pathlen,
37 unsigned char **result, size_t *resultlen);
38 gpg_error_t iso7816_list_directory (int slot, int list_dirs,
39 unsigned char **result, size_t *resultlen);
40 gpg_error_t iso7816_verify (int slot,
41 int chvno, const char *chv, size_t chvlen);
42 gpg_error_t iso7816_change_reference_data (int slot, int chvno,
43 const char *oldchv, size_t oldchvlen,
44 const char *newchv, size_t newchvlen);
45 gpg_error_t iso7816_reset_retry_counter (int slot, int chvno,
46 const char *newchv, size_t newchvlen);
47 gpg_error_t iso7816_get_data (int slot, int tag,
48 unsigned char **result, size_t *resultlen);
49 gpg_error_t iso7816_put_data (int slot, int tag,
50 const unsigned char *data, size_t datalen);
51 gpg_error_t iso7816_manage_security_env (int slot, int p1, int p2,
52 const unsigned char *data,
54 gpg_error_t iso7816_compute_ds (int slot,
55 const unsigned char *data, size_t datalen,
56 unsigned char **result, size_t *resultlen);
57 gpg_error_t iso7816_decipher (int slot,
58 const unsigned char *data, size_t datalen,
60 unsigned char **result, size_t *resultlen);
61 gpg_error_t iso7816_internal_authenticate (int slot,
62 const unsigned char *data, size_t datalen,
63 unsigned char **result, size_t *resultlen);
64 gpg_error_t iso7816_generate_keypair (int slot,
65 const unsigned char *data, size_t datalen,
66 unsigned char **result, size_t *resultlen);
67 gpg_error_t iso7816_read_public_key (int slot,
68 const unsigned char *data, size_t datalen,
69 unsigned char **result, size_t *resultlen);
70 gpg_error_t iso7816_get_challenge (int slot,
71 int length, unsigned char *buffer);
73 gpg_error_t iso7816_read_binary (int slot, size_t offset, size_t nmax,
74 unsigned char **result, size_t *resultlen);
75 gpg_error_t iso7816_read_record (int slot, int recno, int reccount,
77 unsigned char **result, size_t *resultlen);