The Service Layer
The OpenCard Framework service layer shields the application programmer from smart card details. This layer abstracts the smart card and on-card applications. Figure 10.1 shows the general structure of this layer.
- PDF / 24,831,902 Bytes
- 311 Pages / 439 x 666 pts Page_size
- 6 Downloads / 170 Views
Springer-V erlag Berlin Heidelberg GmbH
Uwe Hansmann Martin S. Nicklous Thomas Schack Achim Schneider Frank Seliger
Smart Card Application Development Using Java Second Edition With 98 Figures, 16 Tables and a Multi Function Smart Card
,
Springer
Uwe Hansmann Martin S. Nicklous Thomas Schăck Achim Schneider Frank Seliger IBM Deutschland Entwicklung GmbH SchonaicherstraBe 220 71032 Boblingen, Germany
Library of Congress Cataloging-in-Publication Data Smart card application development using Java: with 98 figures, 16 tables and a multi function smart card/Uwe Hansmann ... [et al.]. - 2. ed. p.cm. Includes bibliographical references and index. ISBN 978-3-540-43202-9 ISBN 978-3-642-55969-3 (eBook) DOI 10.1 007/978-3-642-55969-3 1. Java (computer program language) 2. Smart cards - Programming 1. Hansmann. Uwe,1970QA76.73.J38 S597 2002 005.13 '3---«) + olo.eO 1 + end Mute>() + goiC .,dIDO + goiC .,dServioe() + golSm.rtC.,le a bug or mismatch between CardService and smart card. CardServiceOperationFailedException Indicates that the CardService attempted an operation that could not be carried out by the card, such as deleting a DF that still contains files. CardServicelnabilityException Thrown when the CardService detects that it cannot carry out the required operation. This could come up when using secure messaging, which may be disabled due to US export restrictions.
Table 10.2: Checked CardService Exceptions
Exceptions stemming from CardServiceRuntimeException generally indicate an error in the application, such as a null reference passed as a required parameter. These are explained in Table 10.3.
10. 1 The CardService Layer Core Components
--
165
Table 10.3: CardService Runtime Exceptions
CardServiceRuntimeException Base class for all CardService runtime exceptions.
CardServiceUsageException Indicates that the application has used the CardService incorrectly.
InvalidCardChannelException Indicates that a CardChannel is not available. This could happen if the card is removed before it can be accessed.
CardServicelnvalidCredentialException Thrown when the credential used with secure messaging is invalid. This could mean that either the application supplied an invalid credential to the CardService, or that the smart card responded with an invalid credential. The latter case could arise if the MAC protecting a message is wrong, for example.
CardServicelnvalidParameterException Thrown if the application passes an invalid parameter to the CardService.
10.2
The CardService Optional Components
CardServiceInterface
Figure 10. 10: CardService Optional Classes
The opencard. opt. service package extends the CardService layer core functionality by providing additional classes and exceptions. We will begin by explaining the optional classes, which are shown in Figure 10.10. The CardServicelnterface is provided merely as a convenience to the CardService programmer. The two methods defined are those from the CardService base class that are frequently used by application programmers. «Interface» CardServicelnte