OCF APDU

Hi,
I am using a Multos card/ PCSC reader / com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal
The pcsc wrapper alone is replaced in OCF1.2 from the following location:
http://www.gemplus.com/techno/opencard/cardterminals/pcsc/doc/README-PCSCWrapper.html
Following is the APDU I am trying to send. It means "Get Manufacturer Data command"
80 02 00 00 00 00 16But I get an error as ,
opencard.core.terminal.CardTerminalException: Did not recognize the APDU command
     at com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.internalSendAPDU(Pcsc10CardTerminal.java:807)
     at opencard.core.terminal.CardTerminal.sendAPDU(CardTerminal.java:494)
     at opencard.core.terminal.SlotChannel.sendAPDU(SlotChannel.java:115)I know this may not be the right place to post, but there are no other popular places to discuss about cards.
Hope to hear from you,
Thanks,
Rajesh

Thanks a lot!
I had filled the empty with 0x00.
This APDU works fine.
80 02 00 00 16   Rajesh

Similar Messages

  • OCF or Javacard.Framework

    OCF or Javacard.Framework? which one is better? I'm alittle confused with these concepts..
    as I told in my last post my pc application is written in Delphi language and I installed my applet into card which delphi app send data to this applet via APDU..
    now the question is Which one could be better to use in my applet? OCF or Javacard.Framework??
    regards

    From my understanding OCF is an off-card API for communicating with cards and readers with Java. The card you have should have the org.globalplatform package and won't have OCF. If you want your applet to be portable across different cards, you should probably stick with javacard.framework.
    JCOP Tools should also help with this. It will only allow you to build against standard libraries. If you have vendor specific libraries for the target card you are using, you will need to get the Jar files to build against from them.
    Cheers,
    Shane

  • Return code = 00000057 using a gem pc twin reader with OCF

    Hello, i really need help.
    I'm having the famous return code = 00000057 when i try to send an APDU command, I'm using a applet proxy, so it send an select APDU inside the OCF framework, and the result is success, so i'm able to send an select Applet, but when i try to send the following apdu:
    allocateCardChannel();
    // Set up the command APDU and send it to the card.
    getBalanceAPDU.setLength(0);
    getBalanceAPDU.append(MyAPPLET_CLA); // Class
    getBalanceAPDU.append(VERIFY_INS); // Instr'n
    getBalanceAPDU.append((byte) 0x00); // P1
    getBalanceAPDU.append((byte) 0x00); // P2
    getBalanceAPDU.append((byte) 0x00); // Lc
    getBalanceAPDU.append((byte) 0x05); // Le
    // Send command APDU and check the response.
    ResponseAPDU response;
    //response = new ResponseAPDU(07);
    response = sendCommandAPDU(getCardChannel(), MY_CARD_AID,
    getBalanceAPDU);
    i got that error. I pasted, all the debug message below. I already updated the pcsc-wrapper-2.0.jar file, but i'm still having this error, as i said i'm using an gem pc twin cardreader with gemxpresso card. My opencard.properties file:
    # Card service configuration #
    OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory \
    opencard.opt.util.PassThruCardServiceFactory \
    br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    #OpenCard.services = br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    # Card terminal configuration #
    #OpenCard.terminals = GemplusCardTerminalFactory
    OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    #OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
    #OpenCard.terminals=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|myGEMPlus|GEM430PC|SHARED
    # Trace configuration #
    OpenCard.trace = opencard:9
    ----- the debug----
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.terminal.CardTerminal.<init>
    --- message (Gemplus USB Smart Card Reader 0, PCSC10, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.terminal.CardTerminal
    [DEBUG    ] opencard.core.event.EventGenerator.updateTerminals
    --- message new pollable Terminal = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.cardInserted
    --- message slotID 0, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.event.EventGenerator.updateCards
    --- message card inserted slotID = 0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory opencard.opt.util.PassThruCardServiceFactory br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.opt.service.OCF11CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.service.OCF11CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message opencard.opt.util.PassThruCardServiceFactory@94cc7
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message [email protected]fa0f0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    [DEBUG    ] opencard.core.service.SmartCard.<start>
    --- message finished
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message CTEvent opencard.core.event.CardTerminalEvent[source=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr ]
    ---source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    ---id 1
    card inserted in slot 0
    terminal com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message for slot #0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message new SlotChannel is opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.service.CardServiceRegistry.allocateCardServiceScheduler
    --- message instantiating CardServiceScheduler
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.<init>
    --- message slotChannel opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceScheduler
    [DEBUG    ] opencard.core.service.CardChannel.<init>
    --- message (opencard.core.terminal.SlotChannel@182815a
    + state open)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardChannel
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message using CardServiceScheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.createSmartCard
    --- message creating SmartCard
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.SmartCard.<init>
    --- message scheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive, cid opencard.core.terminal.CardID@1a5ba75 ATR: 3B 7D 94 00 00 80 31 80 65 B0 83 01 02 90 83 00
    90 00
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.SmartCard.getCardService
    --- message (class br.com.neac.petrobras.medidorgas.process.NastekCardProxy)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.SmartCard@fb7efa
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message for class br.com.neac.petrobras.medidorgas.process.NastekCardProxy from opencard.core.service.SmartCard@fb7efa
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message checking [email protected]c68b6f
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardService.<init>
    --- message default constructor of br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardService
    [DEBUG    ] opencard.opt.applet.AppletProxy.<init>
    --- message (A0 00 00 00 62 03 01 0C 02,opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.AppletProxy
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.initialize
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.<init>
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    BasicAppletCardService - allocated CardChannel()
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message factory [email protected]c68b6f produced br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.sendCommandAPDU(channel,...)
    --- message sending opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    to <A0 00 00 00 62 03 01 0C 02>
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d206f0
    0000: 00 A4 04 00 09 A0 00 00 00 62 03 01 0C 02 00 .........b.....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.core.service.CardChannel.response:
    --- message opencard.core.terminal.ResponseAPDU@1f23f8b
    0000: 90 00 ..
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message Selection response sw = 0x9000
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC Exception in method SCardTransmit: error occurred with SCardTransmit
    return code = 00000057
    at com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.translatePcscException(Pcsc10CardTerminal.java:502)

    Hello, i really need help.
    I'm having the famous return code = 00000057 when i try to send an APDU command, I'm using a applet proxy, so it send an select APDU inside the OCF framework, and the result is success, so i'm able to send an select Applet, but when i try to send the following apdu:
    allocateCardChannel();
    // Set up the command APDU and send it to the card.
    getBalanceAPDU.setLength(0);
    getBalanceAPDU.append(MyAPPLET_CLA); // Class
    getBalanceAPDU.append(VERIFY_INS); // Instr'n
    getBalanceAPDU.append((byte) 0x00); // P1
    getBalanceAPDU.append((byte) 0x00); // P2
    getBalanceAPDU.append((byte) 0x00); // Lc
    getBalanceAPDU.append((byte) 0x05); // Le
    // Send command APDU and check the response.
    ResponseAPDU response;
    //response = new ResponseAPDU(07);
    response = sendCommandAPDU(getCardChannel(), MY_CARD_AID,
    getBalanceAPDU);
    i got that error. I pasted, all the debug message below. I already updated the pcsc-wrapper-2.0.jar file, but i'm still having this error, as i said i'm using an gem pc twin cardreader with gemxpresso card. My opencard.properties file:
    # Card service configuration #
    OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory \
    opencard.opt.util.PassThruCardServiceFactory \
    br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    #OpenCard.services = br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    # Card terminal configuration #
    #OpenCard.terminals = GemplusCardTerminalFactory
    OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    #OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
    #OpenCard.terminals=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|myGEMPlus|GEM430PC|SHARED
    # Trace configuration #
    OpenCard.trace = opencard:9
    ----- the debug----
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory|Autodetect|*|SHARED
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.terminal.CardTerminal.<init>
    --- message (Gemplus USB Smart Card Reader 0, PCSC10, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.terminal.CardTerminal
    [DEBUG    ] opencard.core.event.EventGenerator.updateTerminals
    --- message new pollable Terminal = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.cardInserted
    --- message slotID 0, )
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.event.EventGenerator.updateCards
    --- message card inserted slotID = 0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.event.EventGenerator
    [DEBUG    ] opencard.core.service.SmartCard.getRegistryEntry
    --- message tag OpenCard.services = com.ibm.opencard.factory.MFCCardServiceFactory opencard.opt.util.PassThruCardServiceFactory br.com.neac.petrobras.medidorgas.process.NastekCardProxyFactory
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.opt.service.OCF11CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.service.OCF11CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message opencard.opt.util.PassThruCardServiceFactory@94cc7
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    [DEBUG    ] opencard.core.service.CardServiceFactory.<init>
    --- message instantiating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceFactory
    [DEBUG    ] opencard.core.service.CardServiceRegistry.add
    --- message [email protected]fa0f0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    [DEBUG    ] opencard.core.service.SmartCard.<start>
    --- message finished
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message CTEvent opencard.core.event.CardTerminalEvent[source=com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr ]
    ---source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    ---id 1
    card inserted in slot 0
    terminal com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message for slot #0
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.openSlotChannel
    --- message new SlotChannel is opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal@1e1df6e
    + name Gemplus USB Smart Card Reader 0
    + type PCSC10
    + addr
    [DEBUG    ] opencard.core.service.CardServiceRegistry.allocateCardServiceScheduler
    --- message instantiating CardServiceScheduler
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.<init>
    --- message slotChannel opencard.core.terminal.SlotChannel@182815a
    + state open
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardServiceScheduler
    [DEBUG    ] opencard.core.service.CardChannel.<init>
    --- message (opencard.core.terminal.SlotChannel@182815a
    + state open)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardChannel
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getSmartCard
    --- message using CardServiceScheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceScheduler.createSmartCard
    --- message creating SmartCard
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.SmartCard.<init>
    --- message scheduler opencard.core.service.CardServiceScheduler@4ab8b9, is alive, cid opencard.core.terminal.CardID@1a5ba75 ATR: 3B 7D 94 00 00 80 31 80 65 B0 83 01 02 90 83 00
    90 00
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.SmartCard
    [DEBUG    ] opencard.core.service.SmartCard.getCardService
    --- message (class br.com.neac.petrobras.medidorgas.process.NastekCardProxy)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.SmartCard@fb7efa
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message for class br.com.neac.petrobras.medidorgas.process.NastekCardProxy from opencard.core.service.SmartCard@fb7efa
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message checking [email protected]c68b6f
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] opencard.core.service.CardService.<init>
    --- message default constructor of br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.core.service.CardService
    [DEBUG    ] opencard.opt.applet.AppletProxy.<init>
    --- message (A0 00 00 00 62 03 01 0C 02,opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.AppletProxy
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.initialize
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.<init>
    --- message (opencard.core.service.CardServiceScheduler@4ab8b9, is alive,opencard.core.service.SmartCard@fb7efa,true)
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    BasicAppletCardService - allocated CardChannel()
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.core.service.CardServiceRegistry.getCardServiceInstance
    --- message factory [email protected]c68b6f produced br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceRegistry@1f2ae62++ registered factory [email protected]c68b6f
    ++ registered factory com.ibm.opencard.factory.MFCCardServiceFactory@103368e
    ++ registered factory opencard.opt.util.PassThruCardServiceFactory@94cc7
    ++ registered factory [email protected]fa0f0
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.allocateCardChannel
    --- message allocating
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.allocateCardChannel
    --- message applicant br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    [DEBUG    ] opencard.core.service.CardChannel.open
    --- message opening CardChannel
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.sendCommandAPDU(channel,...)
    --- message sending opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    to <A0 00 00 00 62 03 01 0C 02>
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.BasicAppletCardService.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.BasicAppletCardService
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message selecting A0 00 00 00 62 03 01 0C 02
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d206f0
    0000: 00 A4 04 00 09 A0 00 00 00 62 03 01 0C 02 00 .........b.....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.core.service.CardChannel.response:
    --- message opencard.core.terminal.ResponseAPDU@1f23f8b
    0000: 90 00 ..
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] opencard.opt.applet.ISOAppletSelector.selectApplet
    --- message Selection response sw = 0x9000
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source class opencard.opt.applet.ISOAppletSelector
    [DEBUG    ] opencard.core.service.CardChannel.sendCommandAPDU
    --- message opencard.core.terminal.CommandAPDU@1d92803
    0000: 00 20 00 00 00 05 . ....
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, is open, not jammed
    [DEBUG    ] br.com.neac.petrobras.medidorgas.process.NastekCardProxy.releaseCardChannel
    --- message releasing
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source br.com.neac.petrobras.medidorgas.process.NastekCardProxy@8f57a
    [DEBUG    ] opencard.core.service.CardServiceScheduler.releaseCardChannel
    --- message releasing opencard.core.service.CardChannel@9bb457, is open, not jammed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardServiceScheduler@4ab8b9, is alive
    ++ channel is allocated
    [DEBUG    ] opencard.core.service.CardChannel.close
    --- message CardChannel closed
    --- thread Thread[AWT-EventQueue-0,6,main]
    --- source opencard.core.service.CardChannel@9bb457, not open, not jammed
    opencard.core.terminal.CardTerminalException: Pcsc10CardTerminal: PCSC Exception in method SCardTransmit: error occurred with SCardTransmit
    return code = 00000057
    at com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminal.translatePcscException(Pcsc10CardTerminal.java:502)

  • APDU reading mart card serial number PROBLEM !!!!!!!!

    Hi.
    I want to read serial number from smart card with help of OCF and reader.
    But I can not find solution?
    The next piece o code returns:
    sw1 = 6d +>>>>>>>> Card does not support instruction class+
    sw2 = 00
    data = null
    import opencard.core.event.CTListener;
    import opencard.core.event.CardTerminalEvent;
    import opencard.core.event.EventGenerator;
    import opencard.core.service.SmartCard;
    import opencard.core.terminal.CardTerminal;
    import opencard.core.terminal.CommandAPDU;
    import opencard.core.terminal.ResponseAPDU;
    import opencard.opt.util.PassThruCardService;
    public class Listener implements CTListener {
         private SmartCard smartcard = null;
         private CardTerminal terminal = null;
         private int slotID = 0;
         public void register() {
              EventGenerator.getGenerator().addCTListener(this);
              try {
                   EventGenerator.getGenerator().createEventsForPresentCards(this);
              } catch (Exception e) {
                   e.printStackTrace(System.err);
                   unregister();
         public void unregister()
              EventGenerator.getGenerator().removeCTListener(this);
         public void cardInserted(CardTerminalEvent event) {
              try {
                   smartcard = SmartCard.getSmartCard(event);
                   PassThruCardService ptcs = (PassThruCardService) smartcard
                             .getCardService(PassThruCardService.class, true);
                   PassThruCardService ptcs = (PassThruCardService) smartcard
                             .getCardService(PassThruCardService.class, true);
                   CommandAPDU  apdu = new CommandAPDU(0x0045);
                   ResponseAPDU res = ptcs.sendCommandAPDU(apdu);
                   System.out.print(apdu.toString() + res.toString());
                   System.out.printf("sw1 = %02x\n", res.sw1());
                   System.out.printf("sw2 = %02x\n", res.sw2());
                   System.out.println("data = " + res.data());
                   terminal = event.getCardTerminal();
                   slotID = event.getSlotID();
              } catch (Exception e) {
                   e.printStackTrace();
         public void cardRemoved(CardTerminalEvent event) {
    }Can anybody help me?
    Thank in advance

    Sebastien_Lorquet wrote:
    6D00 is not "bad CLA" but "bad INS".
    80 and 00 are ok for get data, the only difference is the presence of TLV encapsulation for 80 and not for 00 (AFAIR)This was to see if there was an interindestry standard GET DATA along with the proprietary GP GET DATA. Some cards may support a specific instruction with one CLA and not the other.
    As far as developing a client application without developing a card applet, it all depends on the card. For instance you can get a card that already supports the IOS7816 file system operations without writing any code, while other cards are blank and require to write all code before you can do anything with it.
    Cheers,
    Shane
    Edited by: safarmer on 3/11/2009 19:25

  • APDU generation

    Hi,
    I am new to JavaCard, I have some problems.
    1. If I send APDU as a Hex number through serial communication, will I get the desired result.
    2 .If not what encryption and MAC algorithm i need fallow so that I can execute the simple java applets ,with out using PC/SC and OCF.
    I will be very thankfull if anyone of you give some suggestion?

    thanks lexdabear,
    As you suggested I gone through GP 2.1 spec, but my doubt when we dont use Secure Messaging Protocol (ext-auth plain) then we should be able to send APDU's like,
    00 A4 04 00 07 A0 00 00 00 03 00 00 00; //Card command which will select card manager.
    through serial communication to the Java card, But I tried send this message but I am getting some other junk values.
    Can anyone help me in this regard.

  • OCF Question

    I have found the OCF very confusing and hope someone who have experience in OCF can guide me.
    I wondering how can we send and receive the APDU command to Java card using OCF. I have read through some tutorials and articles but still find some doubts.
    1) In order to communication with smart card through a reader (i am using towitoko reader) , we must develop a CardTerminal class and CardTerminalFactory class?
    2) how do i modify the opencard.properties file for Towitoko reader?
    Any simple example program can let me try. Thank you for your help!!

    What I don't like seeing is people getting hung up on java as the client because it's a Java Card. The majority of desktops out there are Windows, therefore they use PCSC for interfacing to the CAD. Of course that's native C. Naturally, everyone here wants to do Java as the client so they realize that they can't do it because there are only one Java terminals out there. So they turn to OCF->PCSC bridge which introduces problems. Debugging becomes difficult because you don't know where it is failing, such as in the bridge, OCF or PCSC. If the deployment isn't involving other platforms, then why not eliminate the bridge issue and use straight C/C++ and PCSC as the interface to the CAD? Eliminate the middleman.
    OCF is a framework. The design patterns would require you to write a Cardservice for the Java Card, which would include support for the GP. Also, because reader driver changes, the CardTerminal could fail. All reader manufactures focus on PCSC drivers and care less about OCF. Take a look at all the middleware vendors, you'll notice one thing, it's all done in native C/C++.
    Luckily someone wrote a hack for PCSC to work in Linux. IBM obviously embrassed that solution over OCF by putting out the JPCSC library. The difference between JPCSC and OCF is that JPCSC isn't a framework. It has quite a few classes to support the Javacard as well as extensions such as PKCS#15. OCF hasn't been updated or supported in a few years. There is a group that are trying to kick start it again and have it hosted it on Sourceforge.net. JPCSC is a bare bones integration. If you are truely going to deploy on Linux, and all you need are readers that support PCSC.
    I'm not saying OCF doesn't work, but the time it took me to get it up and running, only took me seconds under JPCSC. If I hadn't found an update on Gemplus site, I would have never gotten OCF to work for me on Win2K. The classes under JPCSC are easier to integrate to a solution than OCF. The bottom line is that OCF is very dated and old, but still could get the job done. JPCSC is truely written with Javacard & PCSC in mind, OCF requires you to tweak the property files, JPCSC leverages PCSC and let's PCSC do all the work.
    IBM JPCSC can be downloaded on JCOP site.
    My .02 cents

  • Java Card APDU's

    Hello,
    I'm new to Java Card and I'm having trouble getting started. I installed the Java Card plugin into Eclipse and I also set up Netbeans with the plugins as well. I know how to convert the java file into a .cap file and from there into a script. In Eclipse I'm successful in running the script with the CREF but I don't really know how to work with the output. When working with Java I can fix my programs by seeing what's happening but I can't do that with Java Card. In Netbeans I saw that you can send APDU commands to their Default Device. Is there somewhere I can go to find out what commands to send to it to interact with my applet?
    I want to understand how this works before putting a cap file on a smart card...or is that the only way to test it?

    You can also use OpenCard Framework (OCF) to communicate with the CREF emulator from a host application. You should be able to search the forum for related posts for details.
    It is a very good idea to test against an emulator when developing as it is faster and may allow you to debug your code as well. Just remember that the CREF and JCWDE emulators have limitations. These are described in the documentation that ships with the JCDK.
    Cheers
    Shane

  • OCF and javacard applets

    Will OCF enable me to write terminal end applications that will enable me to communicate with applets on cards from -Orga, Shlumberger, gemplus,IBM e.t.c. Can I convert whatever application I make into a DLL/API for intergration with another application lets say developed in delphi?
    I have an applet that I've managed to comile without errors. When I upload it on a JCOP10 card, it uploads though I get the error "6A86-reference data not found". What does this mean? Do I have to create files in the card? How do I do that?

    Are you kidding me ? Have you even bothered to read the specification at all ? You communicate with the APDU commands. If you converted an applet to a DLL, then how to you get it to work on the card ? Also, how would the user carry the dll with them to use at any reader ?
    What you use to comminicate to the reader is entirely up to you. OCF, PCSC, proprietary drivers, JPCSC.
    Search the forums. This has been answered a million times

  • OS Error in starting the OCFS Service on windows server 2008

    Hi,
    Installing the Oracle 11g R1 CRS on windows server 2008 operating system . It is displaying the folllowing error message
    ERROR : OS in Error in starting the OCFS Service
    Can any one please tell what could be the issue ..
    Thank You

    Solved this after some trawling through xml configuration files on the server.
    The file C:\Oracle\product\11.1.0\db_1\owb\j2ee\config\http-web-site.xml contains the reference to keystore.jks:
              <ssl-config keystore="*%ORACLE_HOME%*/owb/j2ee/config/keystore.jks" keystore-password="-&gt;keystoreadmin"/>
    changing this to:
              <ssl-config keystore="C:\Oracle\product\11.1.0\db_1/owb/j2ee/config/keystore.jks" keystore-password="-&gt;keystoreadmin"/>
    and the OC4J container starts successfully.
    Regards,
    -Haakon-

  • Installation Oracle10g Release - 2 RAC (2 Node) on HP-UX 11.23 using OCFS-2

    Hi All,
    I want to install Oracle 10g Release - 2 RAC (2 Node) on HP-UX 11.23 using OCFS-2. Please send me a link or docs which describes about step by step instruction of OCFS-2 and RAC on HP-UX 11.23.
    Thanks,
    Subhankar

    Subhankar,
    Check this link out
    http://download.oracle.com/docs/cd/B19306_01/install.102/b14202/toc.htm
    and make sure you have met all the pre-requisites (patches to install oracle on hp-ux 11- you can refer to oracle domentation for the required patches.
    Aslo, if you have access to metalink you can refer to this Doc ID: Note:182177.1 Step-By-Step Installation of RAC on HP-UX. Actually this was created for 9i but it will give you a general idea.

  • 10g RAC - should I use RAW, OCFS and/or ASM ?

    I am about to install 10G RAC on RHAS3. Options for sharing disk partitions are raw, OCFS and ASM. The OCR and voting files must be raw or OCFS, I would tend to go for OCFS in this case. For the Oracle datafiles, again, I would tend to go for OCFS simply for ease of management since ASM seems to add another layer of complexity, and raw lacks flexibility. OCFS however is also new technology and may still have some stability issues. I'm not yet sure of our disk configuration, but there will be HBA cards in each machine with one or two SAN partitions, so I don't expect some of the ASM features such as mirroring etc. will be required as this will be done in the hardware. Does anyone have any recommendations or experiences(good or bad) in which way to go ?
    Philip

    We're using raw partitions for some years now, (since oracle 8i, then 9i and now 10g). It is quite flexible, but you shouldn't use physical partitions but LVM. It's very stable.
    Now on 10g we're using ASM on some sites where mirroring is needed. It works, but not so stable as raw. we discover some bugs as well.
    We've never used OCFS. I don't like it. To much limits. I belive that special utilities are needed for managing files. I don't like linux system software produced by oracle.

  • 10g RAC with linux 3 AS+ocfs

    Hi:
    Is anyone install 10g RAC on linux 3AS with ocfs successfully?
    I am having problem with CRS installation where installer ask to run root.sh. My first node finished root.sh without any problem but not second node it give me "Failure at final check of Oracle CRS stack." error. Moreover, I found "ERROR: clssnmconnect: failed, rc = 3, node samurai (1), (ADDRESS=(PROTOCOL=tcp)(HOST=racs01-priv1)(PORT=49895))" error in ocssd2.log file. However, I can ping privet and public ip/hostname without any problem. Any input or suggestions are welcome!

    Did you ever get a responce to this?
    I'm having the very same issue, which I can not find a work around.
    Documents for the 10g install have been very few and far between, so any help would be the greatest!

  • Oracle 10g RAC design with ASM and OCFS

    Hi all,
    I have a question about a proposed Oracle 10g Release 2 RAC design for a 2 node cluster.
    ASM can store database files but not Oracle binaries nor OCR and voting disk. As such, OCFS version 1 does not support a shared Oracle Home. We plan to use OCFS version 2 with ASM version 2 on Red Hat Linux Enteprrise Server 4 with Oracle 10g Release 2 (10.2.0.1).
    For OCFS v2, a shared Oracle home and shared OCR and voting disk are supported. My question is does the following proposed architecture make sense for OCFS v2 with ASM v2 on Red Hat Linux 4?
    Oracle 10g Release 2 on Red Hat Enterprise Linux Server 4:
    OCFS V2:
    - shared Oracle home and binaries
    - shared OCR and vdisk files
    - CRS software shared OCFS v2 filesystem
    - spfile
    - controlfiles
    - tnsnames.ora
    ASM v2 with ASMLib v2:
    Proposed ASM disk groups:
    - data_dg for application data
    - backupdg for flashback and archivelogs
    - undo_rac1dg ASM diskgroup for undo tablespace for racnode1
    - undo_rac2dg ASM diskgroup for undo tablespace for racnode2
    - redo_rac1dg ASM diskgroup to hold redo logs for racnode1
    - redo_rac2dg ASM diskgroup to hold redo logs for racnode2
    - temp1dg temp tablespace for racnode1
    - temp2dg temp tablespace for racnode2
    Does this sound like a good initial design?
    Ben Prusinski, Senior DBA

    OK Tim, thanks for advices.
    I think Netbackup can be integrated with RMAN but I don't want to loose time on this (political).
    To summarize:
    ORACLE_HOME and CRS_HOME on each node (RAID1 and NTFS)
    Shared storage:
    Disk1 and disk 2: RAID1: - Raw partition 1 for OCR
    - Raw partition 2 for VotingDisk
    - OCFS for FLASH_RECOVERY_AREA
    Disk3, disk4 and disk5: RAID 0 - Raw with ASM redundancy normal 1 diskgroup for database files.
    This is a running project here, will start testing the design on VMware and then go for production setup.
    Regards

  • Sending command apdu with a byte array as CDATA

    Hi,
    I am learning java card as part of my final year project. So far I think I can do most of the basic things but I have got stuck at one particular point.
    I know that there are different constructors for creating a command apdu object and a number of these constructors take an array of bytes as CDATA values.
    My problem is, how to access this array of data in the card side because apdu.getBuffer() returns an array of integers (bytes)? And what is actually on apdu.getBuffer()[ISO7816.OFFSET_CDATA)] location when you send command apdu object using such a constuctor?
    regards
    Edited by: 992194 on 06-Mar-2013 06:12

    992194 wrote:
    (..) I should have mentioned earlier that my card use jc 2.2.1 version, and i have read from different places that this version does not support ExtendedLength facility.Indeed.
    Also I understand the semantics of apdu.getBuffer()[ISO7816.OFFSET_CDATA] that is the first byte of the command data. My question is, this command data was initially supplied as an array of bytes. Something like this:
    +new CommandAPDU(CLA, INS, P1, P2, DATA_ARRAY, Le)+
    So when you call:
    byte [] buffer = apdu.getBuffer()
    So does this mean that the byte values inside DATA_ARRAY automatically occupy locations +buffer[ISO7816.OFFSET_CDATA]+ onwards inside the buffer?Yes. The length would be<tt> (short)(buffer[ISO7816.OFFSET_LC]&0xFF) </tt>. Notice the<tt> &0xFF </tt> is a must above 127 bytes.
    Or their is a mechanism of extracting the DATA_ARRAY array itself?No.
    In fact, in the interest of performance and portability in environments with little memory, the usual coding style is to pass<tt> buffer </tt>, an offset within that, and the length; rather than making an object, which would require a copy. Welcome to the real world of Java Card.

  • How can I read Extended APDU input to the same buffer

    The following is the code I am currently using where inBuffer is an intermediate array of 1000 length. However, I do not want to allocate any buffers at all, and just want to send a command apdu of 1000 byte length and modify it in the code and return the modified buf in the response APDU.
    // Read extended APDU input
    byte[] buf = apdu.getBuffer();
    short bytesRead = apdu.setIncomingAndReceive();
    short dataOffset = apdu.getOffsetCdata();
    // store first chunk in our intermediate byte array <-- how do i get rid of the intermediate array
    Util.arrayCopyNonAtomic(buf, dataOffset, inBuffer, (short) 0, bytesRead);
    // what is the overall length?
    short overallLength = apdu.getIncomingLength();
    short messageOffset = bytesRead;
    if (bytesRead != overallLength){ // otherwise we're finished, all bytes received
         short received = 0;
         do{
                   received = apdu.receiveBytes((short)0);
                   Util.arrayCopyNonAtomic(buf, (short)0, inBuffer, messageOffset, received);
                   messageOffset  += received;
              } while(received != 0);
    * REST OF CODE IN PROCESS METHOD
    I have also tried replacing the above code with the following
    short bytesLeft = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);
    if (bytesLeft < (short)55) ISOException.throwIt( ISO7816.SW_WRONG_LENGTH );
    short readCount = apdu.setIncomingAndReceive();
    while ( bytesLeft > 0){
      // process bytes in buffer[5] to buffer[readCount+4];
      bytesLeft -= readCount;
      readCount = apdu.receiveBytes ( ISO7816.OFFSET_CDATA );
    as shown in the javadocs API, but it does not compile.
    This is my command APDU:
    /send 800100000003E8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003E8
    As you can see:
    CLA - 80
    INS - 01
    P1 & P2 - 00
    LC - 0003E8
    Data - 1000 0s
    LE - 03E8
    I am using JavaCard 3.0 with JCOP in Eclipse. How can I read the extended length apdu to the same buffer? I have no problem in returning an extended length response APDU. Thanks a lot for the help.

    You should not call the convenience method setIncomingAndReceive() in your first code. Please find out about the different APDU states. Furthermore, your Applet should implement the ExtendedLength tagging interface.

Maybe you are looking for

  • CS5.5 Master installation fails

    Hi, I've tried to install CS5.5 master LS4 (french) and it fails (only photoshop and indesign are installed): Exit Code: 6 -------------------------------------- Summary -------------------------------------- - 17 fatal error(s), 52 error(s), 33 warn

  • Need a new router

    Hello, My current Linksys has died and I need to replace it and have considered the Extreme (802.11N) but I have several concerns and feel that this may be the best place to get my questions answered. I have read about people having issues writing to

  • How am I supposed to open a new tab when the "+" icon has been removed?

    The icon I used to use to open new tabs has disappeared since the last Firefox update. I cannot find a menu, button, icon or anything to open a new tab anymore. How am I supposed to open a tab? p.s. If you want to change things people use regularly,

  • I have a red x showing in the connection box of ePrint - HP 8600 AIO N911n. Why?

    I have a red x showing in the connection box of ePrint - HP 8600 AIO N911n.  Why?

  • Content, Initial Content and IPcmBuilderObject, what are they?

    I am pretty sure a beginner who uses the lookup functions will eventually see IntialContent, Content and or IPcmBuilderObject objects.  If I call IPcmBuilder.lookup() function, what kind of information or adavantage that I can get that is different t