gemalto .net card

12/1/2010 12:16:50 PM
Gravatar
Total Posts 3

gemalto .net card

Hi Ugo

Gemalto .net card defines default SO pin as 24 bytes all of value '0' 

When I try

Session session = token.OpenSession(Session.CKF_SERIAL_SESSION | Session.CKF_RW_SESSION,
                                   null,
                                   null);     

session.Login(Session.CKU_SO, "000000000000000000000000");

returns CKR_PIN_INCORRECT exception.

Is there a sollution?

12/1/2010 2:51:38 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: gemalto .net card

Hi,
NCryptoki wraps the functions exported by the native underlying PKCS#11 module. This means when you call the Login method with 24 '0' NCryptoki as PIN it passes 24 '0' to the function C_Login of the underlying PKCS#11 module and returns the error code returned by that native function.

That gives us two chances:

1) the SO PIN isn't 24 '0'

2) the SO is 24 0 not 24 '0'. i.e. the char '0' is 0x30 (hex) while 0 is 0x00
 

Let me know...

Regards,

Ugo

12/1/2010 7:16:14 PM
Gravatar
Total Posts 3

Re: gemalto .net card

Yes pin is 24 zeros as 0x00 not '0'

SO pin is defined as special kind of password. It is not ASCII pin code it is a raw 24 byte buffer.

What now?

12/1/2010 10:51:23 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: gemalto .net card

I just uploaded the new version 1.4.4.1 which has a new Login method that takes the PIN as byte array.
Now you can pass a byte array as the PIN in the following way:

byte[] pin = {0x00, 0x00, ... 0x00};
session.Login(Session.CKU_SO, pin);

Download this new version and try.

Regards,

Ugo

12/5/2010 7:42:57 PM
Gravatar
Total Posts 3

Re: gemalto .net card

Thanks for prompt response!

This worked, now we need session.SetPIN(byte[], byte[]) to change SO password :)

12/6/2010 5:56:00 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: gemalto .net card

Download the latest version 1.4.5.1

Regards,

Ugo Chirico