Hi Chris,

I'd suggest following opencard.properties:
---------------
OpenCard.services = smartcard.OCF.factory.YourCardServiceFactory
OpenCard.terminals = 
com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
OpenCard.trace = opencard:8 \
   opencard.core.service.CardServiceRegistry:8 \
   com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory:8
   smartcard.OCF.factory.YourCardServiceFactory:8 \
   smartcard.OCF.service.YourCardService:8 \
---------------

Where YourCardServiceFactory.java might look like:
---------------
package smartcard.OCF.factory;
import smartcard.OCF.service.YourCardService;
public class  YourServiceFactory extends CardServiceFactory {
   private static Vector services = new Vector();
   private final static int YOURCARD = 0x10;
   private static byte yourATR[] =    {(byte)0x3B,
                                                ...};
   private CardID yourCID;
   static {
         services.addElement(YourCardService.class);
   }
   public YourCardServiceFactory() {
         try {
             yourCID = new CardID ( yourATR );
         } catch ( Exception e ) {
             ctracer.error("CardLoaderFactory()", e.toString());
         }

  }

  protected CardType getCardType(CardID cid,
                                    CardServiceScheduler scheduler) {
         if ( cid.equals(yourCID)) {
             ctracer.debug("getCardType", "known card type " + 
cid.toString());
             return new CardType(YOURCARD);
         } else
             return CardType.UNSUPPORTED;
     }

     protected Enumeration getClasses(CardType type) {
         ctracer.debug("getClasses", "card type is " + type.getType());
         switch (type.getType()) {
         case YOURCARD:
             return cardServiceClasses(yourCID);
         default:
             ctracer.debug("cardServiceClasses", "no classes - 
strange!");
         }
         return null;
     }
     protected Enumeration cardServiceClasses(CardID cid)
     {
       if ( cid.equals(yourCID)) {
         return services.elements();
       } else {
         return null;
       }
     }
}
---------------

And YourCardService should start like:
---------------
package smartcard.OCF.service;
import opencard.opt.applet.*;
public class YourCardService extends AppletProxy  {
  static final yourAID = "yourAID";
  protected void initialize(CardServiceScheduler scheduler, SmartCard 
card, boolean blocking) throws CardServiceException {
        super.initialize(new AppletID(yourAID), scheduler, card, blocking);
}
....
---------------


A nice tutorial can be found at 
http://www.javaworld.com/javaworld/jw-10-1998/jw-10-javadev.html.
It's from 1998!!!

HTH, good luck.

Chris Malan wrote:
> Hi Martin,
> 
> Thanks for yor response.  I have to specify a card service factory location 
> in the opencard.properties file.  This card service factory has to be able to 
> create card services of the required kind -  BasicAppletCardService in this 
> case.  Which card service factory should I specify in the opencard.properties 
> file?  The computer complains that BasicAppletCardService can't be 
> istantiated.  PassThruCardService works fine as I know which factory to put 
> in the opencard.properties file.
> 
> Thanks again,
> 
> Chris
> 
> On Thursday 12 September 2002 18:20, Martin B�chler wrote:
> 
>>Chris Malan wrote:
>>
>>>Hi All,
>>>
>>>Which card service factory implements a BasicAppletCardService?
>>
>>*Your* card service gets usually created by *your* factory ;)
> 
> 


-- 
Martin Buechler . Sen. IT-Developer Systems & Technology
Pixelpark AG  .  http://www.pixelpark.com
Rotherstr. 8 .  10245 Berlin  .  Germany
phone: +49 30 5058 - 1891  fax: - 1600


---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/

! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
!                           [EMAIL PROTECTED]
! containing the word
!                           unsubscribe 
! in the body.

Reply via email to