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

Diff of /trunk/Include/wptCard.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 28 by twoaday, Thu Oct 20 12:35:59 2005 UTC revision 37 by werner, Thu Oct 27 19:12:40 2005 UTC
# Line 1  Line 1 
1  /* wptCard.h  /* wptCard.h
2   *      Copyright (C) 2003, 2004, 2005 Timo Schulz   *      Copyright (C) 2003, 2004, 2005 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
6   * WinPT is free software; you can redistribute it and/or modify   * 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   * 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   * the Free Software Foundation; either version 2 of the License, or
9   * (at your option) any later version.   * (at your option) any later version.
10   *   *
11   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   * GNU General Public License for more details.   * GNU General Public License for more details.
15   *   *
16   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
20  #ifndef WPT_CARD_H  #ifndef WPT_CARD_H
21  #define WPT_CARD_H  #define WPT_CARD_H
22    
23  /* Existing card flags. */  /* Existing card flags. */
24  enum {  enum card_flag_t {
25      GPG_CARDFLAG_NONE    = 0,      GPG_CARDFLAG_NONE    = 0,
26      GPG_CARDFLAG_REPLACE = 1,   /* replace existing keys. */      GPG_CARDFLAG_REPLACE = 1,   /* replace existing keys. */
27      GPG_CARDFLAG_BAKENC  = 2    /* backup encryption key. */      GPG_CARDFLAG_BAKENC  = 2    /* backup encryption key. */
28  };  };
29    
30  /* Symbolic PIN ids */  /* Symbolic PIN ids */
31  enum {  enum card_pin_t {
32      CARD_ADMIN_PIN,      CARD_ADMIN_PIN,
33      CARD_USER_PIN      CARD_USER_PIN
34  };  };
35    
36  /* (callback) card control ids */  /* (callback) card control ids */
37  enum {  enum card_ctl_t {
38      CARD_CTL_INSERT     = '1',      /* insert card */      CARD_CTL_INSERT     = '1',      /* insert card */
39      CARD_CTL_REMOVE     = '2',      /* remove card */      CARD_CTL_REMOVE     = '2',      /* remove card */
40      CARC_CTL_DETECT     = '3',      /* right card detected */      CARC_CTL_DETECT     = '3',      /* right card detected */
41      CARD_CTL_NO_CARD    = '4' ,     /* no card found */      CARD_CTL_NO_CARD    = '4' ,     /* no card found */
42      CARD_CTL_NO_READER  = '5'       /* no reader found */      CARD_CTL_NO_READER  = '5'       /* no reader found */
43  };  };
44    
45    
46  /* openpgp card context. */  /* openpgp card context. */
47  struct gpg_card_s {  struct gpg_card_s {
48      char *aid;          /* appID */      char *aid;          /* appID */
49      char *card_type;      char *card_type;
50      char *version;      /* version */      char *version;      /* version */
51      char *vendor;       /* vendor */      char *vendor;       /* vendor */
52      char *serial;       /* serial number */      char *serial;       /* serial number */
53      char *surname;      /* card users surname */      char *surname;      /* card users surname */
54      char *givenname;    /* card users given name */      char *givenname;    /* card users given name */
55      char *lang;         /* language */      char *lang;         /* language */
56      char sex;           /* card users sex */      char sex;           /* card users sex */
57      char *url;          /* key url */      char *url;          /* key url */
58      char *login;        /* login data (name) */      char *login;        /* login data (name) */
59      int force_pin;      int force_pin;
60      char *maxpinlen[3];      char *maxpinlen[3];
61      int sig_count;      /* signature counter */      int sig_count;      /* signature counter */
62      char *ca_fpr[3];    /* CA fingerprints */          char *ca_fpr[3];    /* CA fingerprints */    
63      char *fpr[3];       /* key fingerprints */      char *fpr[3];       /* key fingerprints */
64      long fpr_created[3];/* fingerprint timestamps. */      long fpr_created[3];/* fingerprint timestamps. */
65      char *fpr_created_str[3];      char *fpr_created_str[3];
66  };  };
67  typedef struct gpg_card_s *gpg_card_t;  typedef struct gpg_card_s *gpg_card_t;
68    
69  /* PIN callback context. */  /* PIN callback context. */
70  struct pin_cb_ctx_s {  struct pin_cb_ctx_s {
71      int which;          /* which command to execute. */      int which;          /* which command to execute. */
72      char *info_text;    /* additional info text. */      char *info_text;    /* additional info text. */
73      char *apin;         /* admin pin */      char *apin;         /* admin pin */
74      char *upin;         /* user pin */      char *upin;         /* user pin */
75  };  };
76    
77  /* Card callback context. */  /* Card callback context. */
78  struct card_cb_s {  struct card_cb_s {
79      int cancel;             /* 1=user cancelled operation. */      int cancel;             /* 1=user cancelled operation. */
80      int init;      int init;
81      int code;               /* 1=user need to insert card. */      int code;               /* 1=user need to insert card. */
82      char val[128];          /* application specific value. */      char val[128];          /* application specific value. */
83  };  };
84    
85    
86  /*-- wptCardManager.cpp --*/  /*-- wptCardManager.cpp --*/
87  const char* card_callback (int code, void *opaque);  const char* card_callback (int code, void *opaque);
88    
89  #endif /*WPT_CARD_H*/  #endif /*WPT_CARD_H*/

Legend:
Removed from v.28  
changed lines
  Added in v.37

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26