Chaskiel Grundman:

I found the following patch to opensc-explorer handy when cleaning up 
after some failed keygens (but not all, since you can't delete private
key objects). It switches the card to the admin lifecycle at startup:


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3538 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2008-07-21 14:39:37 +00:00
parent 64fd479aa5
commit 758adbc7ac
1 changed files with 7 additions and 0 deletions

View File

@ -1762,6 +1762,13 @@ int main(int argc, char * const argv[])
printf("unable to select MF: %s\n", sc_strerror(r));
return 1;
}
{
int lcycle = SC_CARDCTRL_LIFECYCLE_ADMIN;
r = sc_card_ctl(card, SC_CARDCTL_LIFECYCLE_SET, &lcycle);
if (r && r != SC_ERROR_NOT_SUPPORTED)
printf("unable to change lifecycle: %s\n",
sc_strerror(r));
}
while (1) {
struct command *cmd;
size_t i;