bind the new starcos spk 2.3 support to the pkcs15init code

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1765 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2004-04-17 09:23:26 +00:00
parent 846a14849e
commit 564d07ebe6
3 changed files with 22 additions and 1 deletions

View File

@ -14,6 +14,7 @@ PROFILES = \
miocos.profile \
etoken.profile \
jcop.profile \
starcos.profile \
pkcs15.profile
EXTRA_DIST = $(PROFILES) Makefile.mak
@ -23,7 +24,7 @@ lib_LTLIBRARIES = libpkcs15init.la
libpkcs15init_la_SOURCES = \
pkcs15-lib.c profile.c keycache.c \
pkcs15-gpk.c pkcs15-miocos.c pkcs15-cflex.c \
pkcs15-etoken.c pkcs15-jcop.c
pkcs15-etoken.c pkcs15-jcop.c pkcs15-starcos.c
libpkcs15init_la_LDFLAGS = -version-info @OPENSC_LT_CURRENT@:@OPENSC_LT_REVISION@:@OPENSC_LT_AGE@
include_HEADERS = pkcs15-init.h

View File

@ -105,6 +105,14 @@ struct sc_pkcs15init_operations {
struct sc_pkcs15_prkey_rsa *,
u8 *buf, size_t *bufsize, int key_ref);
/*
* Finalize card
* Ends the initialization phase of the smartcard/token
* (actually this command is currently only for starcos spk 2.3
* cards).
*/
int (*finalize_card)(sc_card_t *);
/*
* Old-style API
*/
@ -262,6 +270,9 @@ extern void sc_pkcs15init_set_p15card(sc_profile_t *,
extern int sc_pkcs15init_set_lifecycle(sc_card_t *card, int lcycle);
extern int sc_pkcs15init_erase_card(struct sc_card *,
struct sc_profile *);
/* XXX could this function be merged with ..._set_lifecycle ?? */
extern int sc_pkcs15init_finalize_card(sc_card_t *,
struct sc_profile *);
extern int sc_pkcs15init_add_app(struct sc_card *,
struct sc_profile *,
struct sc_pkcs15init_initargs *);
@ -353,6 +364,7 @@ extern struct sc_pkcs15init_operations *sc_pkcs15init_get_cryptoflex_ops(void);
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_cyberflex_ops(void);
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_etoken_ops(void);
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_jcop_ops(void);
extern struct sc_pkcs15init_operations *sc_pkcs15init_get_starcos_ops(void);
#ifdef __cplusplus
}

View File

@ -137,6 +137,7 @@ static struct profile_operations {
{ "cyberflex", (void *) sc_pkcs15init_get_cyberflex_ops },
{ "etoken", (void *) sc_pkcs15init_get_etoken_ops },
{ "jcop", (void *) sc_pkcs15init_get_jcop_ops },
{ "starcos", (void *) sc_pkcs15init_get_starcos_ops },
{ NULL, NULL },
};
@ -429,6 +430,13 @@ sc_pkcs15init_rmdir(struct sc_card *card, struct sc_profile *profile,
return r;
}
int
sc_pkcs15init_finalize_card(struct sc_card *card, struct sc_profile *profile)
{
if (profile->ops->finalize_card == NULL)
return SC_ERROR_NOT_SUPPORTED;
return profile->ops->finalize_card(card);
}
/*
* Initialize the PKCS#15 application