If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > SmartCard access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-03, 03:18
SunitaGoswami SunitaGoswami is offline
Registered User
 
Join Date: Oct 2003
Posts: 5
Lightbulb SmartCard access

Hi,
Currently I am facing problem regarding the Smart Card transmit function
I am programming using winscard.dll in VB.
I am able to perform the operations like ScardConnect, ScardEstablishContext, ScardListReaders successfully
But when I am Transmitting bytes(APDU) to the reader, I am getting return bytes 6D 00 as status bytes (Sw1, sw2) as opposed to 90 00
I am using Reader: Gemplus PC 410-SL on Windows 2000 Professional

Please guide me on following Sample Code snippet regarding, where am lacking.

Function: SCardTransmit

Dim byReadBuffer As BytArray
Dim bytCommand As BytArray

bytCommand.byBytes(0) = &H0
bytCommand.byBytes(1) = &HA4
bytCommand.byBytes(2) = &H1
bytCommand.byBytes(3) = &H0
bytCommand.byBytes(4) = &H5

Dim leng As Long

leng = 255
lResult = SCardTransmit(hCard, 0, bytCommand, 7, 0, byReadBuffer, leng)

If lResult <> SCARD_S_SUCCESS Then ' It returns Success
MsgBox "Select File Failed", vbInformation
Exit Sub
End If

szMessage = "MessageRead: " + DecimalToString(byReadBuffer, leng, True)
Message.Text = szMessage ' Gives status bytes as 6D 00

Regards ,
Sunita
Reply With Quote
  #2 (permalink)  
Old 10-30-03, 04:35
ptc ptc is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
Re: SmartCard access

Quote:
Originally posted by SunitaGoswami
Hi,
Currently I am facing problem regarding the Smart Card transmit function
I am programming using winscard.dll in VB.
I am able to perform the operations like ScardConnect, ScardEstablishContext, ScardListReaders successfully
But when I am Transmitting bytes(APDU) to the reader, I am getting return bytes 6D 00 as status bytes (Sw1, sw2) as opposed to 90 00
I am using Reader: Gemplus PC 410-SL on Windows 2000 Professional

Please guide me on following Sample Code snippet regarding, where am lacking.

Function: SCardTransmit

Dim byReadBuffer As BytArray
Dim bytCommand As BytArray

bytCommand.byBytes(0) = &H0
bytCommand.byBytes(1) = &HA4
bytCommand.byBytes(2) = &H1
bytCommand.byBytes(3) = &H0
bytCommand.byBytes(4) = &H5

Dim leng As Long

leng = 255
lResult = SCardTransmit(hCard, 0, bytCommand, 7, 0, byReadBuffer, leng)

If lResult <> SCARD_S_SUCCESS Then ' It returns Success
MsgBox "Select File Failed", vbInformation
Exit Sub
End If

szMessage = "MessageRead: " + DecimalToString(byReadBuffer, leng, True)
Message.Text = szMessage ' Gives status bytes as 6D 00

Regards ,
Sunita
Hi Sunita

After i checked your program i think you have a error in your apdu exchange protocol, what i meen is the result canīt foud your CLAss parameter.
Please access this link and see the error http://smartcard.caret.cam.ac.uk/MFC-APDU.html
check this and send me your results.
Best regards
Reply With Quote
  #3 (permalink)  
Old 12-14-03, 23:35
Photon Photon is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Help

I am programming Smart Card by using winscard.dll in VB. I know for the dBForums that you know how to perform the operations like ScardConnect, ScardEstablishContext, ScardListReaders. Could you please send some code for my reference?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On