没有合适的资源?快使用搜索试试~ 我知道了~
首页OpenCard Framework
资源详情
资源评论
资源推荐

OpenCard Framework 1.2 Programmer's Guide
OpenCard Framework 1.2
Programmer's Guide
Document Number BOEB-OCFP-00
OpenCard Framework 1.2 -- Programmer's Guide
Fourth Edition
December, 1999
Copyright OpenCard Consortium.
This book provides information about the OpenCard Framework.
Order publications through your IBM representative or the IBM branch office serving your locality. Publications are not
stocked at the address below.
IBM welcomes your comments. A form for readers' comments may be provided at the back of this publication, or you may
address your comments or questions to the following address:
IBM Deutschland Entwicklung GmbH
Information Development, Dept. 3248
Schoenaicher Strasse 220
71032 Boeblingen
Germany
FAX (Germany): 07031 16 3456
FAX (Other Countries): (+49) 7031 16 3456
IBM Mail Exchange: DEIBMBM9 at IBMMAIL
Internet e-mail: idepubs@vnet.ibm.com
World Wide Web: www.opencard.org
If you would like a reply, be sure to include your name, address, telephone number, or FAX number.
Make sure to include the following in your comment or note:
Title and order number of this book
Page number or topic related to your comment
When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it
believes appropriate without incurring any obligation to you.
Trademarks and service marks
These terms are trademarks or service marks of the IBM Corporation in the United States or other countries:
IBM
CT
These terms are trademarks of other companies:
Term Owner
Internet Explorer Microsoft Corporation
JDK (Java Developer's Kit) Sun Microsystems, Inc.

Netscape Navigator (Communicator) Netscape Communications Corp.
OCFOpenCard Consortium
OpenCard OpenCard Consortium
Solaris Sun Microsystems, Inc.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Incorporated, in
the United States and/or other countries.
Windows, Windows NT, and Windows 95 are registered trademarks of Microsoft Corporation in the United States and/or
other countries.
Other company, product, and service names may be trademarks or service marks of others.
Table of Contents
Trademarks and service marks
Figures
Preface
About this manual
How to use this manual
Assumptions
Where you can get OpenCard Framework
Font conventions used in this manual
Related documents
Feedback
Introduction
Developing smart card applications
Developing applications using OpenCard Framework
Getting started
Preparing the system
Writing your first sample application
Writing your second sample application
OCF architectural concepts
Architecture overview
The CardTerminal layer
The CardService layer
FileAccessCardService
SignatureCardService
AppletAccessCardService and AppletManagerCardService
Programming with OCF
Configuring the OpenCard Framework
Configuring the registries
Configuring tracing output
OpenCardPropertyFileLoader
Loading properties with your own mechanism
Initializing the OpenCard Framework

Waiting for a smart card
Obtaining a card service
Handling exceptions
Listing applications
Working with files
FileAccessCardService
The CardFilePath class
The CardFileInput/OutputStream classes
The CardRandomRecordAccess class
Signature generation and verification
Generating signatures
Verifying signatures
Importing keys
Generating keys
Advanced programming with OCF
Working with OpenCard events
CardTerminalEvent
Locking a CardTerminal
TracerEvents
Using optional CardTerminal functions
Getting a smart card via event-notification
Obtaining a smart card from a particular card terminal
Gaining exclusive access to the smart card
Referencing files
Working with credentials
Performing cardholder verification
Using the trace utility
Using the OpenCard Framework in applets
Usage scenario
The security model of the Java Platform 1.1
The security model of the Java Platform 1.2
The Java Plug-In
Writing secure applets with OCF and the Java Plug-In
Differences in the procedure between Java Platform 1.1 and 1.2
Writing secure applets with OCF for Java Platform 1.1
Using secure applets with OCF for the Java Platform 1.1
Writing secure applets with OCF for the Java Platform 1.2
Using secure applets with OCF for the Java Platform 1.2
Native Browser support
The opencard.core.util.SystemAccess class
Writing secure applets with OpenCard and Netscape Communicator
Writing secure applets with OpenCard and Microsoft Explorer
Writing a CardTerminal
Implementing a CardTerminal
The interface layer
The function layer
The communication layer
Implementing the Lockable interface
Implementation of a CardTerminalFactory
Writing a card service

CardService environment -- overview
Application interfaces
Using standard CardService interfaces
Standard application interfaces
Defining your own interface
Interface standardization
Framework interfaces
CardService methods for implementation use
CardService methods for application use
CardServiceInterface
Subclassing CardService
CardChannel
CardServiceFactory
Support for JavaCards and other Multi Application Cards
State Objects
Selection
Proxy Base Classes
Support for SCQL Database Smart Cards
Package features
Interface Details
Example of use
Acknowledgements
Glossary
Bibliography
Figures
Main parts of the OpenCard Framework architecture
Classes of the CardTerminal package
The CardTerminal layer
Preface
By convention, a preface contains meta-information about a book describing its structure and how the reader can best make
use of it. We recommend to read this preface to understand how this manual is organized, what typesetting conventions are
used, where to get sample code, where to find additional information, etc.
About this manual
This manual describes the OpenCard Framework, a smart card1 middleware implemented in the Java programming language.
The OpenCard Framework sits between a smart card-aware application or applet written in Java and the card reader (also
known as Card Acceptance Device (CAD) or Interface Device (IFD)). The framework enables programmers to write smart
card applications against a high-level programming interface that hides the complexities of interacting with cards and card
readers from different vendors. Thus, applications developed on top of the OpenCard Framework are readily usable on all
platforms supporting the Java environment and provide the interoperability across card and reader vendors that is required to
deploy applications written as applets in an Internet environment.
How to use this manual
This manual is intended for developers and programmers who want to learn the basics of using the OpenCard Framework to
develop smart card aware applications and applets in the Java programming language.
The manual is also intended for OpenCard component developers who implement pluggable framework components for card
terminals or cards.

Throughout this manual, we've provided sample code to illustrate programming with the OpenCard Framework reference
implementation. Notice that the code is incomplete and thus would not compile. For the sake of brevity, we've shown only
those code snippets relevant to illustrate some point and haven't always shown how some instance variables were initialized.
However, we have tried to include sufficient comments and variable declarations to make the code illustrations self-
explanatory.
Assumptions
We assume that the reader is already familiar with the Java programming language and development environment.
However, the reader may need some help in familiarizing himself with smart card technology and the terminology used in this
field in order to better understand the concepts presented in this document.
Where you can get OpenCard Framework
The OpenCard Consortium maintains a web-site at http://www.opencard.org/ which includes a download section from which
you can obtain documentation, binaries, class files, and source code.
You can access sample code for the Java Developer at http://www.javaworld.com/jw-10-1998/javadev/javadev.zip.
Font conventions used in this manual
Italics are used for
new terms, when they are defined;
the titles of documents, papers, and books appearing in references.
Typewriter font is used for
anything (in particular source code) that would be typed verbatim.
Smallcaps are used for
names (such as company names, product names, registered trademarks, etc.).
Related documents
OpenCard Framework 1.0 - White Paper. This paper provides a gentle introduction to the OpenCard Framework, describing
its objectives, the architecture, and the reference implementation.
Feedback
Please help us improve the quality of this manual by telling us about any flaws you can spot or by making suggestions as to
how you think the material could be presented better.
Send any corrections, amendments, suggestions, or comments to this e-mail address:
opencard-info@opencard.org
Introduction
This chapter prepares the stage for OCF. We'll briefly talk about the fundamentals of smart card application development in
general and show how the OpenCard Framework comes in and simplifies the task. Everyone should read this chapter, though
readers familiar with developing smart card applications may want to skip the first section.
Developing smart card applications
Smart card applications consist of a card-external application interacting with a card-resident component. The card-external
application comprises the program code running on some computing platform such as a personal computer, a network
computer, an ATM (automatic-teller machine), or a personal digital assistant. The card-resident component comprises data
and functions in the smart card itself2 .
Let's take a closer look at what's involved when the application interacts with the smart card. Don't be worried by the
technical details presented here, because the OpenCard Framework will hide most of the complexity from you. The intent
here is to provide some background and understanding of what is happening so that the need for and the usefulness of OCF
can be appreciated.
Interactions with the smart card occur by exchanging pairs of APDUs (application protocol data units) and are initiated by the
external application. Communication with the smart card is accomplished via the card reader, an I/O device attached to the
剩余63页未读,继续阅读







安全验证
文档复制为VIP权益,开通VIP直接复制

评论3