Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    5

    Lightbulb Unanswered: 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

  2. #2
    Join Date
    Oct 2003
    Posts
    1

    Re: SmartCard access

    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

  3. #3
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •