Java Card RMI Client-Side API
The two packages in the Java Card RMI client-side simulator demonstrate remote stub customization using the RMIC compiler generated stubs and card access for Java Card applets.
The package com.sun.javacard.rmiclientlib
implements Java Card RMI-specific functionality.
The package com.sun.javacard.clientlib
implements basic functionality to exchange APDUs with a smart card or a smart card simulator. This implementation of clientlib
requires that the ApduIO library is included in the CLASSPATH.
Package rmiclientlib
This package includes several classes.
-
class JCRMIConnect
—
The main class of the RMI framework that provides methods to select a card applet and to get an initial reference. -
class JCCardObjectFactory
—
An implementation of theCardObjectFactory
that processes the data returned from the card in the format defined in the Java Card Platform Runtime Environment Specification, Classic Edition, Version 3.1. Any object references must contain class names. -
class JCCardProxyFactory
—
TheJCCardProxyFactory
class is similar toJCCardObjectFactory
, but processes references containing lists of names.JCCardProxyFactory
uses the JDK 1.4.+ proxy mechanism to generate proxies dynamically. -
class JCRemoteRefImpl
—
An implementation of interfacejava.rmi.server.RemoteRef
. These remote references can work with stubs generated by the RMIC compiler with the-v1.2
option.The main method is:
public Object
invoke(Remote remote, Method method,
Object[] params, long unused) throws IOException, RemoteException, Exception
This method prepares the outgoing APDU, passes it to
CardAccessor
, and then usesCardObjectFactory
to parse the returned APDU and instantiate the returned object or throw an exception.
Package clientlib
This package includes an interface and a class.
-
interface CardAccessor
—
An interface defining methods to exchange APDUs with a card and to close connection to a card. -
class ApduIOCardAccessor
—
A simple implementation of the CardAccessor interface that passes the APDUs to a card or a card simulator using the ApduIO library. This class takes parameters to start the ApduIO from the filejcclient.properties
, which must be included in CLASSPATH.