Contents Previous Next Index

Package

com.sun.javacard.ocfrmiclientimpl

Description

Provides implementation of classes and interfaces defined in com.sun.javacard.javax.smartcard.rmiclient.
This implementation depends on the OCF1.2 as the client framework.

Class Summary
Classes
An instance of this class is used by the OCFCardAccessorFactory to denote that the smart card currently being accessed may be Java Card-compliant.
Processes the data returned from the card in the format defined for Java Card RMI.
Processes the data returned from the card in the format defined for Java Card RMI.
Represents a reference to a card object.
Passes APDUs between client program and CardTerminal.
The OCFCardAccessorFactory class creates the OCFCardAccessor instance which is used by terminal client applications to initiate and conduct a Java Card RMI based dialogue with the smart card.

com.sun.javacard.ocfrmiclientimpl
JavaCardType

Declaration

public class JavaCardType extends opencard.core.service.CardType 
  
java.lang.Object 
  | 
  +--opencard.core.service.CardType 
        | 
        +--com.sun.javacard.ocfrmiclientimpl.JavaCardType 

Description

An instance of this class is used by the OCFCardAccessorFactory to denote that the smart card currently being accessed may be Java Card technology-compliant.

Member Summary
Constructors
 
Creates new JavaCardType

Inherited Member Summary
Fields inherited from class CardType
UNSUPPORTED
Methods inherited from class CardType
getInfo(), getType(), setInfo(Object) 
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

JavaCardType()

public JavaCardType()
Creates new JavaCardType
com.sun.javacard.ocfrmiclientimpl
JCCardObjectFactory

Declaration

public class JCCardObjectFactory extends com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory 
  
java.lang.Object 
  | 
  +--com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory 
        | 
        +--com.sun.javacard.ocfrmiclientimpl.JCCardObjectFactory 

Description

Processes the data returned from the card in the format defined for Java Card RMI. Object references must contain class names. Extends CardObjectFactory.

Member Summary
Constructors
 
The constructor.
Methods
protected java.rmi.Remote
Creates the stub instance for object reference returned from the card, assuming the card returned a reference with class name.
byte
Returns constant REF_FORMAT_CLASS defined in class com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory .

Inherited Member Summary
Fields inherited from class CardObjectFactory
REF_FORMAT_CLASS, REF_FORMAT_INTERFACES, REF_FORMAT_NONE, cardAccessor
Methods inherited from class CardObjectFactory
getINSByte(), getObject(byte[], int, Class), setINSByte(byte) 
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

JCCardObjectFactory(CardAccessor)

public JCCardObjectFactory(com.sun.javacard.javax.smartcard.rmiclient.CardAccessor ca)
The constructor.
Parameters:
ca - The CardAccessor of the current card session. It is passed to the Stubs/Proxies created by the Factory.

Methods

getRemoteObject(byte[], int)

protected java.rmi.Remote getRemoteObject(byte[] buffer, int tagOffset)throws Exception
Creates the stub instance for object reference returned from the card, assuming the card returned a reference with class name.
Overrides:
getRemoteObject in class CardObjectFactory
Parameters:
buffer - APDU buffer
tagOffset - Offset to tag
Returns:
The resulting stub.
Throws:
java.lang.Exception - Failed to instantiate a stub

getRemoteRefFormat()

public byte getRemoteRefFormat()
Returns constant REF_FORMAT_CLASS defined in class com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory .
Overrides:
getRemoteRefFormat in class CardObjectFactory
Returns:
REF_FORMAT_CLASS value defined above
com.sun.javacard.ocfrmiclientimpl
JCCardProxyFactory

Declaration

public class JCCardProxyFactory extends com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory 
  
java.lang.Object 
  | 
  +--com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory 
        | 
        +--com.sun.javacard.ocfrmiclientimpl.JCCardProxyFactory 

Description

Processes the data returned from the card in the format defined for Java Card RMI. Object references must contain lists of interface names. Extends CardObjectFactory.

Member Summary
Constructors
 
Constructor for the factory.
Methods
protected java.rmi.Remote
Creates the stub instance for object reference returned from the card, assuming the card returned a reference with list of interface names.
byte
Returns constant REF_FORMAT_INTERFACES defined in class com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory .

Inherited Member Summary
Fields inherited from class CardObjectFactory
REF_FORMAT_CLASS, REF_FORMAT_INTERFACES, REF_FORMAT_NONE, cardAccessor
Methods inherited from class CardObjectFactory
getINSByte(), getObject(byte[], int, Class), setINSByte(byte) 
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

JCCardProxyFactory(CardAccessor)

public JCCardProxyFactory(com.sun.javacard.javax.smartcard.rmiclient.CardAccessor ca)
Constructor for the factory.
Parameters:
ca - CardAccessor for the current session.

Methods

getRemoteRefFormat()

public byte getRemoteRefFormat()
Returns constant REF_FORMAT_INTERFACES defined in class com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory .
Overrides:
getRemoteRefFormat in class CardObjectFactory
Returns:
The format constant.

getRemoteObject(byte[], int)

protected java.rmi.Remote getRemoteObject(byte[] buffer, int tagOffset)throws Exception
Creates the stub instance for object reference returned from the card, assuming the card returned a reference with list of interface names.
Overrides:
getRemoteObject in class CardObjectFactory
Parameters:
buffer - APDU buffer.
tagOffset - Offset to tag.
Returns:
The instance of the proxy.
Throws:
java.lang.Exception - Thrown if the proxy instance cannot be instantiated
com.sun.javacard.ocfrmiclientimpl
JCRemoteRefImpl

Declaration

public class JCRemoteRefImpl implements java.rmi.server.RemoteRef, java.lang.reflect.InvocationHandler 
  
java.lang.Object 
  | 
  +--com.sun.javacard.ocfrmiclientimpl.JCRemoteRefImpl 
All Implemented Interfaces:

java.io.Externalizable, java.lang.reflect.InvocationHandler, java.rmi.server.RemoteRef, java.io.Serializable

Description

Represents a reference to a card object. This class is a Java Card RMI implementation of the RemoteRef interface. It is used in conjunction with Java RMIC generated stubs or dynamically generated proxies for Java Card RMI method invocations.

Member Summary
Constructors
 
Creates new JCRemoteRefImpl
Methods
void
Deprecated and not implemented
java.lang.String
Unsupported operation.
java.lang.Object
This method is used by dynamically generated proxies.
void
Deprecated and not implemented
java.lang.Object
This method is used by rmic-generated stubs.
java.rmi.server.RemoteCall
Deprecated and not implemented
void
Unsupported operation.
boolean
Compares two remote objects for being identical.
int
Unsupported operation.
java.lang.String
String representation of remote object.
void
Unsupported operation.

Inherited Member Summary
Fields inherited from interface RemoteRef
packagePrefix, serialVersionUID
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

JCRemoteRefImpl(short, String, CardAccessor, CardObjectFactory)

public JCRemoteRefImpl(short objID, java.lang.String a_string, com.sun.javacard.javax.smartcard.rmiclient.CardAccessor cA, com.sun.javacard.javax.smartcard.rmiclient.CardObjectFactory cOF)
Creates new JCRemoteRefImpl
Parameters:
objID - 2 byte Object ID from card remote reference descriptor
a_string - Anticollision string for the class of the remote object
cA - CardAccessor
cOF - CardObjectFactory

Methods

getRefClass(ObjectOutput)

public java.lang.String getRefClass(java.io.ObjectOutput objectOutput)
Unsupported operation.
Specified By:
getRefClass in interface RemoteRef
Parameters:

invoke(Remote, Method, Object[], long)

public java.lang.Object invoke(java.rmi.Remote remote, java.lang.reflect.Method method, java.lang.Object[] params, long unused)throws IOException, RemoteException, Exception
This method is used by rmic-generated stubs.
Specified By:
invoke in interface RemoteRef
Parameters:
remote - Reference to the stub - not used.
method - java.reflect.Method object containing information about the method to be invoked.
params - Array of parameters. Primitives are wrapped.
unused - rmic-generated hash of the method. Not used.
Returns:
The result returned from the card.
Throws:
java.io.IOException - If a communication error occurred.
java.rmi.RemoteException - If an RMI error occurred.
java.lang.Exception - Exception corresponding to the one that was thrown on the card.

remoteHashCode()

public int remoteHashCode()
Unsupported operation.
Specified By:
remoteHashCode in interface RemoteRef
Returns:
A number which is the same for all objects.

remoteToString()

public java.lang.String remoteToString()
String representation of remote object.
Specified By:
remoteToString in interface RemoteRef
Returns:
A String representation of the remote object.

readExternal(ObjectInput)

public void readExternal(java.io.ObjectInput objectInput)throws IOException, ClassNotFoundException
Unsupported operation.
Specified By:
readExternal in interface Externalizable
Parameters:
Throws:
java.io.IOException, java.lang.ClassNotFoundException

writeExternal(ObjectOutput)

public void writeExternal(java.io.ObjectOutput objectOutput)throws IOException
Unsupported operation.
Specified By:
writeExternal in interface Externalizable
Parameters:
Throws:
java.io.IOException

newCall(RemoteObject, Operation[], int, long)

public java.rmi.server.RemoteCall newCall(java.rmi.server.RemoteObject remoteObject, java.rmi.server.Operation[] operation, int param, long param3)throws RemoteException
Deprecated.
Deprecated and not implemented
Specified By:
newCall in interface RemoteRef
Parameters:
Throws:
java.rmi.RemoteException

invoke(RemoteCall)

public void invoke(java.rmi.server.RemoteCall remoteCall)throws Exception
Deprecated.
Deprecated and not implemented
Specified By:
invoke in interface RemoteRef
Parameters:
Throws:
java.lang.Exception

remoteEquals(RemoteRef)

public boolean remoteEquals(java.rmi.server.RemoteRef remoteRef)
Compares two remote objects for being identical.
Specified By:
remoteEquals in interface RemoteRef
Parameters:
remoteRef - RemoteRef to the other remote object.
Returns:
true if corresponding remote objects are identical.

done(RemoteCall)

public void done(java.rmi.server.RemoteCall remoteCall)throws RemoteException
Deprecated.
Deprecated and not implemented
Specified By:
done in interface RemoteRef
Parameters:
Throws:
java.rmi.RemoteException

invoke(Object, Method, Object[])

public java.lang.Object invoke(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] params)throws IOException, RemoteException, Throwable
This method is used by dynamically generated proxies.
Specified By:
invoke in interface InvocationHandler
Parameters:
obj - The reference to the Proxy - not used.
method - Method object containing information about the method.
params - Array of parameters for the method.
Returns:
The result returned from the card.
Throws:
java.io.IOException - If a communication error occurred.
java.rmi.RemoteException - If an RMI error occurred.
java.lang.Throwable - Exception corresponding to the one that was thrown on the card.
com.sun.javacard.ocfrmiclientimpl
OCFCardAccessor

Declaration

public class OCFCardAccessor extends opencard.core.service.CardService implements com.sun.javacard.javax.smartcard.rmiclient.CardAccessor 
  
java.lang.Object 
  | 
  +--opencard.core.service.CardService 
        | 
        +--com.sun.javacard.ocfrmiclientimpl.OCFCardAccessor 
All Implemented Interfaces:

com.sun.javacard.javax.smartcard.rmiclient.CardAccessor

Description

Passes APDUs between client program and CardTerminal. Client programs usually supply their own CardAccessor extending this class and performing additional transformations and checks of the data. Implements the CardAccessor interface.

Member Summary
Constructors
 
Creates new OCFCardAccessor
Methods
byte[]
Exchanges APDU with the card.
short
A number identifying the current session.

Inherited Member Summary
Methods inherited from class CardService
allocateCardChannel(), getCHVDialog(), getCard(), getCardChannel(), initialize(CardServiceScheduler, SmartCard, boolean), releaseCardChannel(), setCHVDialog(CHVDialog), setCardChannel(CardChannel) 
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

OCFCardAccessor()

public OCFCardAccessor()
Creates new OCFCardAccessor

Methods

exchangeAPDU(byte[])

public byte[] exchangeAPDU(byte[] sendData)throws IOException
Exchanges APDU with the card.
Specified By:
exchangeAPDU in interface CardAccessor
Parameters:
sendData - The outgoing APDU
Returns:
The response APDU
Throws:
IOException - if a communication error occurs.
java.io.IOException

getSessionIdentifier()

public short getSessionIdentifier()
A number identifying the current session.
Specified By:
getSessionIdentifier in interface CardAccessor
Returns:
session ID.
com.sun.javacard.ocfrmiclientimpl
OCFCardAccessorFactory

Declaration

public class OCFCardAccessorFactory extends opencard.core.service.CardServiceFactory 
  
java.lang.Object 
  | 
  +--opencard.core.service.CardServiceFactory 
        | 
        +--com.sun.javacard.ocfrmiclientimpl.OCFCardAccessorFactory 

Description

The OCFCardAccessorFactory class creates the OCFCardAccessor instance which is used by terminal client applications to initiate and conduct a Java Card RMI based dialogue with the smart card. The methods in this class are intended to be invoked by the OCF CardServiceRegistry class. Java Card RMI Client applications should access the SmartCard class to obtain instances of OCFCardAccessor.

See Also:

OCFCardAccessor

Member Summary
Constructors
 
Creates new OCFCardAccessorFactory
Methods
protected opencard.core.service.CardType
This method examines the CardID object (containing the ATR returned by the Card) and checks if the card could be Java Card technology-compliant. If so, this method returns a JavaCardType object.
protected java.util.Enumeration
If the input parameter is a JavaCardType object, this method returns an enumeration object with the OCFCardAccessor object listed.

Inherited Member Summary
Methods inherited from class CardServiceFactory
getCardServiceInstance(Class, CardType, CardServiceScheduler, SmartCard, boolean), getClassFor(Class, CardType), newCardServiceInstance(Class, CardType, CardServiceScheduler, SmartCard, boolean) 
Methods inherited from class Object
clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(), wait()

Constructors

OCFCardAccessorFactory()

public OCFCardAccessorFactory()
Creates new OCFCardAccessorFactory

Methods

getCardType(CardID, CardServiceScheduler)

protected opencard.core.service.CardType getCardType(opencard.core.terminal.CardID cid, opencard.core.service.CardServiceScheduler scheduler)
This method examines the CardID object (containing the ATR returned by the Card) and checks if the card could be Java Card technology-compliant. If so, this method returns a JavaCardType object.
Overrides:
getCardType in class CardServiceFactory
Parameters:
cid - CardID received from a Card Slot.
scheduler - CardServiceScheduler that can be used to communicate with the card to determine its type.
Returns:
A JavaCardType if the factory can instantiate services for this card. CardType.UNSUPPORTED if the factory does not know the card.

getClasses(CardType)

protected java.util.Enumeration getClasses(opencard.core.service.CardType type)
If the input parameter is a JavaCardType object, this method returns an enumeration object with the OCFCardAccessor object listed. Subclasses of this class may add subclasses of OCFCardAccessor to this list by using the add method.
Overrides:
getClasses in class CardServiceFactory
Parameters:
type - The CardType of the smart card for which the enumeration is requested.
Returns:
An Enumeration of OCFCardAccessor class objects

 


Contents Previous Next Index Development Kit User's Guide for the Binary Release with Cryptography Extensions
Java Card Platform, Version 2.2.1