diff options
author | Werner Koch <[email protected]> | 2003-09-28 13:41:58 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-09-28 13:41:58 +0000 |
commit | e369270a655fdab6b78053231c03bc2d82b672a9 (patch) | |
tree | 52d106255c5a1ce9dbfdffd09cb9b3f08197eb77 /g10/app-common.h | |
parent | First bits of a card support backport from 1.9. It is not enabled by (diff) | |
download | gnupg-e369270a655fdab6b78053231c03bc2d82b672a9.tar.gz gnupg-e369270a655fdab6b78053231c03bc2d82b672a9.zip |
* g10.c (main): New commands --card-edit, --card-status and
--change-pin. New options --ctapi-driver, --pcsc-driver and
--disable-ccid
* options.h (DBG_CARD_IO): New.
* cardglue.c, cardclue.h: Enhanced.
* card-util.c: New. Taken from current the gnupg 1.9 branch.
* app-common.h, app-openpgp.c, iso7816.c, iso7816.h, apdu.c
* apdu.h, ccid-driver.c, ccid-driver.h: New. Takem from the current
gnupg 1.9 branch withy minor changes to include directives.
* Makefile.am: Added these files.
Diffstat (limited to 'g10/app-common.h')
-rw-r--r-- | g10/app-common.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/g10/app-common.h b/g10/app-common.h new file mode 100644 index 000000000..26666e7a7 --- /dev/null +++ b/g10/app-common.h @@ -0,0 +1,76 @@ +/* app-common.h + * Copyright (C) 2003 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifndef APP_COMMON_H +#define APP_COMMON_H + +struct app_ctx_s { + int initialized; /* The application has been initialied and the + function pointers may be used. Note that for + unsupported operations the particular + function pointer is set to NULL */ + int slot; /* Used reader. */ + unsigned char *serialno; /* Serialnumber in raw form, allocated. */ + size_t serialnolen; /* Length in octets of serialnumber. */ + unsigned int card_version; + int did_chv1; + int did_chv2; + int did_chv3; + struct { + int (*learn_status) (APP app, CTRL ctrl); + int (*setattr) (APP app, const char *name, + int (*pincb)(void*, const char *, char **), + void *pincb_arg, + const unsigned char *value, size_t valuelen); + int (*sign) (APP app, + const char *keyidstr, int hashalgo, + int (pincb)(void*, const char *, char **), + void *pincb_arg, + const void *indata, size_t indatalen, + unsigned char **outdata, size_t *outdatalen ); + int (*auth) (APP app, const char *keyidstr, + int (*pincb)(void*, const char *, char **), + void *pincb_arg, + const void *indata, size_t indatalen, + unsigned char **outdata, size_t *outdatalen); + int (*decipher) (APP app, const char *keyidstr, + int (pincb)(void*, const char *, char **), + void *pincb_arg, + const void *indata, size_t indatalen, + unsigned char **outdata, size_t *outdatalen); + int (*genkey) (APP app, CTRL ctrl, + const char *keynostr, unsigned int flags, + int (*pincb)(void*, const char *, char **), + void *pincb_arg); + int (*change_pin) (APP app, CTRL ctrl, + const char *chvnostr, int reset_mode, + int (*pincb)(void*, const char *, char **), + void *pincb_arg); + } fnc; +}; + + +int app_select_openpgp (APP app, unsigned char **sn, size_t *snlen); +int app_get_serial_and_stamp (APP app, char **serial, time_t *stamp); + +#endif /*APP_COMMON_H*/ + + + |