|
||||||||||||
This whitepaper intends to give an overview of the goals and purpose of OpenCard Framework (OCF). As detailed descriptions of the OCF functionalities and architecture can be found in many documents, we will first detail why we think the smart card industry needs a framework approach and a standardized open source middleware. Available on-line information about the OpenCard Framework includes:
So before describing the OpenCard architecture, we will describe what we should expect from a middleware designed for smartcard-aware applications (types of components, requirements, etc.) and present the framework approach.
1.1 Smart Card ApplicationsApplications that are using smart cards are in two parts: one part is running in a card, and the other one on a terminal or a server. These applications are usually very difficult and complex to program. Most of the time, control codes of the card reader are proprietary and card commands too. They are also usually using some very low-level OS-dependent serial APIs. At last, the smart card commands and communication protocols (T=0, T=1) are low-level. For all these reasons of complexity and proprietary nature, the learning curve for application developers is steep! 1.2 Smart Card StandardsThis section provides a very brief overview of standards related to smart cards. Standardization has been very important for the growth of the smart card industry. Like in other industries (e.g., telecoms), precise definitions of dimensions, protocols, commands, etc... have contributed to the wide acceptance of smart cards among many different vendors (card providers, reader providers, application developers, client developers, etc.). From time to time, well accepted standards need to be updated, extended, or redesigned as technology evolves, requirements also, and they are not sufficient enough anymore for the new requirements to be fulfilled. Hence, if strong standards at low levels of protocols are necessary to ensure a first interoperability and launch a new industry (e.g., OSI model, TCP/IP), they are at one point not sufficient anymore for solving needs, because they are not flexible at all (i.e., something that has been forgotten cannot be added without great difficulty). Some more dynamic models (e.g., ODP model, see [6], CORBA, see [7]) that allow both interoperability and flexibility become necessary. They are usually based on techniques such as gateways (or proxy objects), meta data, or preprocessors. In the smart card world, we obviously are still in the OSI model phase, as each new domain-dedicated standard defines new named protocol packets (APDUs) as new strongly-standardized commands. We can divide smart card standards in three categories:
Note that ISO has not yet standardized any access API: this is not necessary as soon as protocols are well defined: any application, written in any language, conforming to the ISO7816 protocols will be able to interoperate with a smart card! The problem is that communications with smart card readers is not yet standardized, leading to specific application code or waste of time in portability. In fact, a smartcard-access environment is not fully necessary, it would however save time and money: this is why frameworks are interesting. In many other situations a framework can help the smartcard-aware application developer, e.g., when he/she wants to write an application that can interoperate with different smart cards offering the same functionality, but that have different proprietary APIs. The next sections will describe what is an Object-Oriented Framework, what model of framework we can suggest for smart card middleware, and what are the requirements for this type of software. 1.3 A Framework ApproachIn this section, we introduce the Frameworks technology and draw a draft of smart card framework model. 1.3.1 What is a framework?In [3], Booch gives a good definition of Frameworks: ``` A framework is a microarchitecture denoting a collection of classes and mechanisms that together provide a set of services for a particular domain, which clients can use as well as adapt. We distinguish a framework from a simple class library by the fact that frameworks generally have control mechanisms that the framework calls client operations. In a class library, it's usually the reverse: Clients mainly invoke operations from the library. Thus, a framework is a kind of pattern that provides reuse in the large.'' As we can see, frameworks (see also [1], [2]) are like templates: they save time by providing some already existing classes or interfaces, thus enabling application programmers to develop more quickly by either using or extending the framework and following its guidelines and coding/naming patterns. 1.3.2 A Smart Card Framework ModelThis paragraph describes a simple layer model for smart card frameworks. It is somewhat inspired by the ODP model, although a lot simpler! First, we can define three different interworking levels, each of them being based on a different paradigm (objects, language, and communication), each of them addressing different needs, and manipulating different entities. Figure 1 shows how some components (e.g., C1, C2, C3) of our system will use the three levels.
Decreasing levels of abstractions, represented by the three layers, can be defined. These levels are: the Object Layer, the Programming Layer, and the Communication or Transport Layer.
Based on this very simple model, we can see several functions that a smart card framework could provide:
As a consequence, the framework needs to define clear interworking interfaces for its components:
1.4 Requirements for the FrameworkWe now list here some generic requirements that we would like to be fullfilled by a standard smart card framework. Most are inspired by the Taligent whitepapers on Frameworks [1] and [2]. 1.4.1 SimplicityOne can always choose not to use any framework to develop a card-aware application: to study ISO standards (protocols and standard commands), reader manufacturer documentation (control commands), and smart card manufacturer documentation (proprietary commands), and then to write a (big) piece of C code to do whatever is needed. Then, the first requirement for a good framework is not that it does exactly what is needed (it could be extended) or that it covers everything, but instead its simplicity. It must be:
In order to achieve the second point, we could add that its code should be readable enough for at least appropriate people to be able to understant it! (and this crowd could rapidly grow in the future...). Also, it should include well defined extension APIs (see below), and be well documented from a programmer's point of view (i.e., Javadocs-generated HTML is not enough!). We should also provide requirements, global design principles, explanations or pointers to patterns/coding choices, etc. 1.4.2 ExtensibilityAs we have seen in the framework definition (see paragraph 1.3.1), a good framework is a set of classes that is usable, but more importantly that can be adapted! It should be possible to:
1.4.3 ApplicabilityEven if the framework intuitiveness is more important, in my opinion, than the functions it provides, as soon as it can be extended, it should nonetheless save some time by providing already implemented features and layers of abstraction! It should at least be based on the current card standards of the first type (see section 1.2), i.e., be applicable to:
1.4.4 ConsistencyThis is a corollary requirement from the first one (simplicity). In order to get users to gradually climb the framework learning curve and to efficiently capitalize when using it, the framework should provide consistent conventions and guidelines and enforce them with:
For more on design patterns, see the ``Gang of Four'' bible book: ``Design Patterns - Elements of Reusable Object-Oriented software.'' [5]. 1.4.5 Code ReuseWhenever possible, the framework should provide some reference classes, default implementations for the most standard cases, etc. Also, in order to allow for code reuse, we need a notion of modularity, i.e., a module should be able to use the services of a generic one. This is not so simple in the smart card world as it implies a precise management of critical sections (see below for more details). 1.4.6 PortabilityEven if it is not a fundamental requirement from the user's point of view (his/her smartcard-aware application might never be ported to another platform), it is an important one for the framework implementors because they do not have to spend too much time porting it, and so they can focus on more useful work. Thus, it is also important for users because wherever they run their applications, they can benefit from the framework, i.e., from the base classes and also from contributions or extensions that have been made available! (in a similar way, we could also state that the environment should be ``Free Software'', or at least ``Open Source'', which enforces its use and user-contributions). To take an example, if a very nice development GUI is made available under Windows, people using different platforms cannot benefit from it because it uses a non-portable toolkit (the same example can be taken with the Unix Motif toolkit!), as if this tool were developped in Tk or Java/Swing, it would have been automatically portable and so useful for more people. For this reason we believe that general requirements for the framework should include:
1.4.7 EfficiencyThe design of the framework should be done in such a way to maximize speed and minimize resources comsumptions. More specifically, we should try to minimize the framework core and components sizes. 1.4.8 StandardizedAlthough we have already emphasized the importance of standards, it is interesting to note that such a framework can have two major goals: 1) being useful for card-aware applications developers (hence the requirements above) and 2) being promoting a smart card open market (hence this last requirement). The goal of an open market is to allow systems to include elements from different suppliers. Several suppliers may have offerings for the same card reader, or the same type of smart card. For instance, a Gemplus GPK card could compete with a card offering equivalent functionalities. Even if open markets do not seem to be good for suppliers at the beginning, they appear to dramatically widen the market size! 1.5 OpenCard to the Rescue...The answer to these requirements for the members of the OpenCard consortium is OCF, the OpenCard Framework: it is an open standard providing an architecture and a set of APIs that enable application developers and service providers to build and deploy smartcard-aware solutions. OCF APIs are pure Java classes and interfaces. They are also quite complete, as not only a communication layer exists, but also the other needed functionalities as described in paragraph 1.3.2: OS layer, Services, etc. Besides the main motivations previously described, the choice of a state-of-the art framework technology would allow more requirements to be fullfiled. We would like the framework:
Finally, as explained in details in the first part of this whitepaper, we have chosen to go for the framework technology, as we believe that the information technology world is going to be increasingly complex and dynamic, requiring more and more smart card security functions. We also believe that we will need some very open and flexible software middleware and tools to adapt to this situation (see [12] for more on this issue).
2.1 OpenCard ConsortiumThe OpenCard Consortium Purpose is to:
In 1997, a few companies started to work on a Java Framework dedicated to using smart cards: they were Bull, Gemplus, IBM, Schlumberger, SCM Microsystems, Sun, and Visa. IBM was the technical leader of the group. The first stable version of OCF (1.0) was demonstrated in spring 1998. At the same time, those companies plus Dallas Semiconductor, First Access, Liberate Technologies (formely NC), and Ubiq formed the OpenCard Consortium in order to promote together OCF and accelerate its developments. In 1998 3-G, Intellect, Newcom Technologies, and Siemens joined the group, followed by American Express in 1999. 2.2 Consortium OrganizationThe consortium is a non-profit US-based corporation with formal bylaws and organization. The Consortium has:
2.3 OpenCard Technical CommitteeThe Technical Committee acts on behalf of the Management Board in order to manage the evolutions of OCF. What is interesting is that at the beginning of 1999, we started to elaborate a formal Process of Work that was voted in March 1999 by the technical committee members and backed by the consortium Management Board. This process has been inspired by other open processes of work of very well known organizations such as the IETF (Internet Engineering Task Force), the OMG (Object Management Group), or the W3C (World Wide Web consortium). It is based on the submissions, discussions, and votes of RFPs and RFCs. 2.4 Process of WorkThe OpenCard Consortium Technical Committee process is based on two major steps:
For each of these steps, a review process is proposed in order to reach as quickly as possible a community consensus.
Intent of RFPsThe intent of a Request for Proposals (RFP) is to propose a new improvement for the OCF. It can be a change, an enhancement, an extension or an addition. RFPs are concerned with a "what" description.
Example:
The rules for formatting an RFP are defined in RFC 2. The format of RFPs is actually described to be similar to the RFC format. To summarize, an RFP is soliciting proposals from the different partners in the OpenCard Consortium TC on a particular issue related to OCF.
Intent of RFCsThe intent of a Request For Comments (RFC) is to propose a solution for a particular RFP. RFCs are concerned with a "how" description.
Example:
Each distinct version of an OCF standards-related specification is published as part of the "Request for Comments" (RFC) document series. This archival series is the official publication channel for OCF standards documents. After an RFC has been approved by the technical committee and by the OCC management board, the proposed features or changes are integrated into the main tree of OCF versions. This is how version 1.1.1 and 1.2 have been developed, they include all the RFCs that have been voted as accepted respectively from January 99 to May 99 for version 1.1.1, and from May 99 to January 2000 for version 1.2.
Web PageAn overview of the process and the complete list of RFPs/RFCs that have been voted or are currently debated is available at the following URL: Already voted RFPs and RFCs are public while the ones that are still in their active period (20 days for RFPs and 40 days for RFCs) are restricted to the OCC members. 2.5 OpenCard Framework vs other FrameworksIn this section, we give a short overview of how the OpenCard architecture relates to PC/SC. 2.5.1 PC/SC, a PC-only FrameworkPC/SC is the standard framework for enabling smart cards interoperability in the Windows95/98/NT world. It includes a C or C++ API. Any type of application language is usable through the DCOM software bus. For an overview of the PC/SC architecture, see [20] and [21]. Recently, a group called M.U.S.C.L.E (i.e., Movement for the Use Of Smart Cards in a Linux Environment), lead by David Corcoran, University of Purdue, has developed from scratch a PC/SC resource manager for Linux (and other Unixes) that is compliant with the public PC/SC API specifications. For a presentation of this Linux port, see [22]. PC/SC is an important contribution to provide developers with a standard transport API and a transparent reader management through a ``provider'' architecture. However, we believe that OCF brings supplementary features to the application developers for two reasons:
2.5.2 Dedicated FrameworksThere are other frameworks that are currently in design/development stage. We can ask ourselves why: the issue is an adequation of the solution to the most important requirements. For example, OCF's major goal, among those listed in this paper, has probably been the flexibility requirement, perhaps in its first versions at the expanse of simplicity and size, which was fine for an environment that is supposed to run on PCs, workstations, or NCs. Now, for other type of platforms like small devices (payment terminals, payphones, set-top boxes, etc.) that want, at one time or another, to make a smart card transaction, the goals are different: we might accept less flexibility for the API in order to reduce its size. For these platforms, it might be necessary to design a different framework that will fulfill different needs! Or, if the works that are currently undergone in the OpenCard Consortium Technical Committee succeed, we might have only one a-la-carte framework where not only we could leave aside some components that are not needed, but also some framework mechanisms if they are not needed! An update of this works is the newly release of TOCF (Tiny OCF) a version specially designed for embedded devices. See [17].
As stated in the introduction, many documents are already available covering the technical details of OCF. We will here describe its general architecture, the major classes of its two layers, and how a smooth integration with other Java services (through Java frameworks or APIs) can be achieved. 3.1 ArchitectureIn OCF, there is a clear separation between mandatory packages that are part of the core of the framework (such as opencard.core.terminal, .events, .service, and .util), and packages that are optional: they then lie in the optional part starting with opencard.opt. In this optional part, other packages related to terminal, services, security APIs, management etc. reside. The OCF architecture is based on a layer model. The most upper layer is the ``Smartcard-aware Application'', it uses some components named CardServices that know about the Card application and/or OS and/or application management possibilities (selection, installation, etc.). These components in turns use some other components named CardTerminals that allow to communicate with the card through a reader. If you remember that we would like the different parts of a smartcard-aware applications to be independent from each other, then the two major layers of abstraction of OCF are geared toward this purpose, i.e.,
Figure 2 summarizes this architecture.
So the two main Java packages of the OpenCard Framework are (we will describe into more details these two packages in the next sections):
Some Highlights of this architecture are:
3.2 Details on the CardTerminal layerIn this section, we study the CardTerminal layer of OCF. The CardTerminal layer encapsulates all classes that allow access to a smart card terminal or reader. The main classes of the card terminal layer are in the packages: opencard.core.terminal (mandatory classes and interfaces) and opencard.opt.terminal (optional classes and interfaces) These classes are:
3.3 Details on the CardService layerIn this section, we study the CardService layer of OCF. The CardService layer provide APIs that will be used either by smartcard-aware applications, or by other CardServices (we have here a notion of modularity that is barely found in other smart card access middleware). This second layer (CardService) is probably the most interesting one for the application developers as they can consider it as a "toolbox" for developing their application:
The main classes of the card service layer are in the packages: opencard.core.service (mandatory classes and interfaces) and opencard.opt.service (optional classes and interfaces) These classes are:
In conclusion, although the CardService layer could be misunderstood as a simple layer providing translations of high-level API functions into APDU packets, it is much more than that: it provides a framework architecture also in the upper layers of OCF , which is then not restricted to card readers management! However, this CardService framework architecture has to be enhanced constantly with new APIs, new mechanisms, bridges to other frameworks etc. (see for example [18] and [19]). 3.4 Integration with other FrameworksAs explained above, when OCF is connected through some ``software bridge'' to an already existing Java framework, the application developer or user doesn't even have to know about OCF, except for specifying somewhere that a card will be used (!). Some examples of this include:
In the future, we intend to experiment with the connections between the OCF framework and non-Java framework. Some experiments involving the newly distributed Linux PC/SC [22] that is entirely based on CORBA offers some interesting perspectives.
We have tried to give a rapid overview of all middleware requirements, techniques, and initiatives that exist arround the smartcard-access function. As we have seen, we are just at the beginning of a new area where software bricks and flexible architectures will allow application developers to develop much more efficiently. We believe that OCF is a good start for such Java Framework, and that everybody (the smart card industry, but also application developers interested in using smart cards), has to contribute in order to enhance this base. Many references are given, both in the introduction section, below for web sites, and in the bibliography section, in order to allow the reader to read further and adopt the framework technology. We know, however, that the learning curve for such complex systems is not completely flat!, but the investment is certainly worth.
TaligentA very good source of information for understanding the technology of Object-Oriented Frameworks is the set of Taligent white papers that have been published on their web site and are now hosted at IBM web site. http://www.ibm.com/java/education/oobuilding/ SunGeneral information, APIs, and Reference implementations for the Java Language can be found at the Java Technology Home Page: (Note: be sure to download the Java Communication API in order to be able to use pure java CardTerminal drivers; see PRODUCTS & APIS). OpencardThe distributed version of OCF 1.2 is available from the OpenCard Consortium official web site. (For downloading the complete package see DOWNLOAD). GemplusGemplus components, both for the CardTerminal and the CardService layers are available from the Gemplus Developers' web site. http://www.gemplus.com/techno/opencard/
Frameworks, Design Patterns, Distributed Applications Models
About this document ...OpenCard Introduction & Overviewa Framework Approach to Smart Cards Services CTST 2000 This document was generated using the LaTeX2HTML translator Version 99.1 release (March 30, 1999)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
The command line arguments were: The translation was initiated by on 2000-03-07 2000-03-07 |
||||||||||||