Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

SCardControl and FEATURE_VERIFY_PIN_DIRECT

Solved!
Go to solution

Hi

I have a Reader that has a pinpad attached to it (OmniKey HID) and would like to validate the PIN once a card in the reader is detected.

I have been told that I could use methods of Winscard to achieve this.

 

FEATURE_VERIFY_PIN_DIRECT structure and

 

[DllImport("WINSCARD.DLL")]

 public static extern Int32 SCardControl(IntPtr hCard,uint dwControlCode,refbyte[] lpInBuffer,uint nInBufferSize,refbyte[] lpOutBuffer,uint nOutBufferSize,refuint lpBytesReturned);

 

are what is needed .

 

Since I m doing this in .net and C# has anyone got a working example of this  as I think my c# wrapper may be incorrect.

Thanks

0 Kudos
Message 1 of 7
(7,204 Views)
Solution
Accepted by BADMULLAH

Hi Badmullah,

 

I think your best bet is to try talking to the HID support: http://www.hidglobal.com/main/technical-support/

If you search “WINSCARD.DLL” The first KB gives you a little information about communication with Omnikey readers.

 

I found the user Guide for PC Pinpad Smartcard Readers where the SCardControl method is described on page 6 - http://support.gemalto.com/fileadmin/user_upload/user_guide/Pinpad/PCPinpad_PC-SC_UserGuide.pdf

 

I might be able to give you some suggestions with an error code or something along those lines, but I’m not familiar with the OmniKey HID and wouldn’t be able to try anything.

 

Regards,

 

Michael Miracle

NI Americas | AE

0 Kudos
Message 2 of 7
(7,199 Views)

Thanks Micheal

with some juggling the code in

PC Pinpad Smartcard reader

PC/SC Application note.

Version : Version 3

Last update : 05/26/2007

page 18 made my job easier.

 

Thanks for responding.

Cheers

0 Kudos
Message 3 of 7
(7,195 Views)

Hi again ;

I had a go at the code and got a 6E 00 response which I m not sure if its related to the *** SCardControl : Load GemPC Pinpad strings ***: Error status (0x1) error or not

 

SCardControl sample code with examples of PCSC V2 part 10 commands
0: FT SCR2000 0
1: FT SCR2000 1
2: OMNIKEY CardMan 3821 0
 Protocol: 0 on reader: OMNIKEY CardMan 3821 0
SCardConnect: OK

==> Get GemPC Firmware
 Firmware: ..... (length 256 bytes)
SCardControl: Error status (0x1)
==> Get Feature Request
 TLV length = (18) sizeof(PCSC_TLV_STRUCTURE) = 6: 06 04 00 31 30 0C 07 04 00 31
 30 10 0A 04 00 31 30 08
FEATURE_VERIFY_PIN_DIRECT implemented in the reader
FEATURE_MODIFY_PIN_DIRECT implemented in the reader
SCardControl: OK

==> Load strings in the Pinpad memory
*** SCardControl : Load GemPC Pinpad strings ***: Error status (0x1)
==> Get card status
 Reader: OMNIKEY CardMan 3821 0 (length 24 bytes)
 State: 0x5
 Prot: 0
 ATR (length 23 bytes): 3B FD 18 00 00 80 31 FE 45 73 66 74 65 2D 63 64 30 38 30
 2D 6E 66 DC
SCardStatus: OK

 Protocol: 2
SCardReconnect: OK

==> Secure verify PIN
 command: 1E 00 82 04 00 08 04 02 01 04 09 00 00 00 00 0D 00 00 00 A0 20 00 01 0
8 FF FF FF FF FF FF FF FF
Enter your PIN in the Pinpad reader keypad...
 card response: 6E 00

 

Any idea?

0 Kudos
Message 4 of 7
(7,193 Views)

Hi Badmullah,

 

Are you using Measurement Studio? What kinds of National Instruments Products are you using?

 

Regards,

 

Michael Miracle

NI Americas | AE

0 Kudos
Message 5 of 7
(7,185 Views)

Using Micorsoft Visual C++ ver 6.0

OMNIKEY CardMan 3821

0 Kudos
Message 6 of 7
(7,183 Views)

Hi Badmullah,

 

I found some general questions related to the OMNIKEY Readers (http://www.hidglobal.com/faqs.php?techCat=19).

There’s some example code under specific programming questions for interacting with the cards.

It sounds like they will answer questions via email (support@OMNIKEY.COM). I didn’t find anything too useful from searching their knowledgebases.

 

You might have more luck on a Visual C++ forum perhaps (http://social.msdn.microsoft.com/forums/en-US/category/visualc/)?

Hopefully this is helpful.

 

Regards,

Michael Miracle

NI Americas | AE

0 Kudos
Message 7 of 7
(7,178 Views)