Java Card API

service

2017-05-22 17:29:03 M&W SmartCard 0

javacard.framework.service

Interface Service

All Known Subinterfaces: RemoteService , SecurityService

All Known Implementing Classes: BasicService , RMIService


This is the base interface for the service framework on the Java Card platform. A Service is an object that is able to perform partial or complete processing on a set of incoming commands encapsulated in an APDU.

Services collaborate in pre-processing, command processing and

post-processing of incoming APDU commands. They share the same APDU object by using the communication framework and the Common Service Format (CSF) defined in BasicService. An application is built by combining pre-built and newly defined Services within a Dispatcher object.

Version:

1.0

See Also:BasicService


Method Summary
 boolean processCommand (APDU  apdu)          Processes the command in the APDU object.
 boolean processDataIn (APDU  apdu)          Pre-processes the input data for the command in the APDU object.
 boolean processDataOut (APDU  apdu)          Post-processes the output data for the command in the APDU object.

 

Method Detail

processDataIn

boolean processDataIn(APDU  apdu)

Pre-processes the input data for the command in the APDU object. When invoked, the APDU object should either be in STATE_INITIAL with the APDU buffer in the Init format or in STATE_FULL_INCOMING with the APDU buffer in the Input Ready format defined in BasicService. The method must return true if no more pre-processing should be performed, and false otherwise. In particular, it must return false if it has not performed any processing on the command.

After normal completion, the APDU object is usually in STATE_FULL_INCOMING with the APDU buffer in the Input Ready format defined in BasicService. However, in some cases if the Service processes the command entirely, the APDU object may be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService.

Parameters:apdu - the APDU object containing the command being processed

Returns:true if input processing is finished, false otherwise


processCommand

boolean processCommand(APDU  apdu)

Processes the command in the APDU object. When invoked, the APDU object should normally be in STATE_INITIAL with the APDU buffer in the Init format or in STATE_FULL_INCOMING with the APDU buffer in the Input Ready format defined in BasicService. However, in some cases, if a pre-processing service has processed the command entirely, the APDU object may be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService. The method must return true if no more command processing is required, and false otherwise. In particular, it should return false if it has not performed any processing on the command.

After normal completion, the APDU object must be in STATE_OUTGOING and the output response must be in the APDU buffer in the Output Ready format defined in BasicService.

Parameters:apdu - the APDU object containing the command being processed

Returns:true if the command has been processed, false otherwise


processDataOut

boolean processDataOut(APDU  apdu)

Post-processes the output data for the command in the APDU object. When invoked, the APDU object should be in STATE_OUTGOING with the APDU buffer in the Output Ready format defined in BasicService. The method should return true if no more post-processing is required, and false otherwise. In particular, it should return false if it has not performed any processing on the command.

After normal completion, the APDU object should must be in STATE_OUTGOING and the output response must be in the APDU buffer in the Output Ready format defined in BasicService.

Parameters:apdu - the APDU object containing the command being processed

Returns:true if output processing is finished, false otherwise 


Home
Product
News
Contact us