/[winpt]/trunk/Include/wptCard.h
ViewVC logotype

Contents of /trunk/Include/wptCard.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23 - (show annotations)
Fri Sep 30 10:10:16 2005 UTC (19 years, 5 months ago) by twoaday
File MIME type: text/plain
File size: 2357 byte(s)
Almost finished phase 1 of the WinPT GPGME port.
Still need more cleanup, comments and tests.


1 /* wptCard.h
2 * Copyright (C) 2003, 2004, 2005 Timo Schulz
3 *
4 * This file is part of WinPT.
5 *
6 * WinPT 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.
10 *
11 * WinPT 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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with WinPT; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 */
20
21 #ifndef WPT_CARD_H
22 #define WPT_CARD_H
23
24 /* Existing card flags. */
25 enum {
26 GPG_CARDFLAG_NONE = 0,
27 GPG_CARDFLAG_REPLACE = 1, /* replace existing keys. */
28 GPG_CARDFLAG_BAKENC = 2 /* backup encryption key. */
29 };
30
31 /* Possible card states. */
32 enum {
33 CARD_STATE_NONE=0,
34 CARD_STATE_UNAWARE,
35 CARD_STATE_UNAVAIL,
36 CARD_STATE_PRESENT,
37 CARD_STATE_EXCLUSI,
38 CARD_STATE_EMPTY,
39 CARD_STATE_INUSE,
40 CARD_STATE_MUTE
41 };
42
43 enum {
44 CARD_ADMIN_PIN,
45 CARD_USER_PIN
46 };
47
48
49 /* PIN callback context. */
50 struct pin_cb_ctx_s {
51 int which; /* which command to execute. */
52 char *info_text; /* additional info text. */
53 char *apin; /* admin pin */
54 char *upin; /* user pin */
55 };
56
57 /* Card callback context. */
58 struct card_cb_s {
59 int cancel; /* 1=user cancelled operation. */
60 int init;
61 int code;
62 char val[128];
63 };
64
65 struct pcsc_reader_s;
66 typedef struct pcsc_reader_s * pcsc_reader_t;
67
68
69 unsigned get_card_status (void);
70 int show_card_status (void);
71
72 /*-- wptCardManager.cpp --*/
73 const char* card_callback (int code, void *opaque);
74
75 /*-- wptCardPCSC.c --*/
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79
80 int pcsc_loadlib (int scard_support);
81 void pcsc_free_readers (pcsc_reader_t rd);
82 const char* pcsc_get_reader (pcsc_reader_t rd, int idx, int *ret_nrd);
83 int pcsc_scan_readers (pcsc_reader_t *ret_rd);
84 int pcsc_get_card_status (void);
85
86 #ifdef __cplusplus
87 }
88 #endif
89
90 #endif /*WPT_CARD_H*/

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26