Hi Fernando,

it is best to check the command line utilities like
"pkcs11-tool --test --login" to see if these is a general
problem. if there is not, you could use pkcs#11 spy
(pkcs11-spy.dll) and hook it between your application
and opensc-pkcs11.dll. it will generate a log file of
all your function calls and the return values, and thus
help to debug the problem.

> My problems begin when I try to invoke the function C_GetSlotList of the
> opensc-pcks11.dll library. I'm not able to find a slot with information.
>  All the slot available seem to be empty. The code I'm trying to execute
>  can be find below:

pkcs11-tool should show some slots. if it does, the problem is most likely
in your application. if it does not, something is wrong with opensc or
its configuration.

> ##error2text is a function I use to show the error more friendly.

pkcs11-spy.dll is the best way to generate log files - no need for you
to show your code or add debugging / print functions, and it generates
a format well known to us and thus easy to understand.

> Should I configure the type of smart card I'm using in the code? I mean, is
> there a instruction I have to invoke to indicate i'm using a starcos smart
> card?

no. if it is a usual card, opensc will automatically detect it. and if it is
not a card supported by opensc, you are out of luck anyway.

but there is the remote chance, that you have a new starcos card that works
with opensc, but has a different ATR than normal. show us "opensc-tool -a" ...
in such a case you can edit opensc.conf to assign that atr to the starcos
driver. but usualy that is not needed, and the problem is somewhere else.

> I cannot offer more information about my problem since my program doesn't
> have runtime errors or compiled errors, can I?

opensc-tool -a will show us the atr.
pkcs11-tool --test --login will show us if the card works with opensc in 
general.
pkcs11-spy.dll will create a log file, so you and we can see the function
calls and return values.

one of those might help to debug the problem.

also you can edit opensc.conf and set debug to 6 and create an opensc
debug log file with details. but lets try the other options first.

Regards, Andreas
p.s. I'm no starcos expert, so post your new information on the list, as
most likely someone else need to look at it to understand your problem.
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to