This document is the specification of the API dedicated to the integration of the PC/SC plugin in a Keyple Application.

Specific extensions

The plugin and readers have specific extensions defined in the PcscPlugin and PcscReader interfaces

So far, only the reader has specificities compared to the standard Keyple API.

Identification of the type of reader

The PC/SC plugin allows an application to use both contact and contactless PC/SC readers.

The PC/SC standard does not provide a simple way to know the type of reader, it must be deduced from the name assigned by its manufacturer.

Two methods are proposed to allow the application to assign a type to a reader discovered by the plugin:

  • when building the plugin by providing PcscPluginFactoryBuilder with regular expression based filters to deduce the type of the reader from its name.
  • once the reader is enumerated by the plugin by calling the setContactless() method of the specific reader API.

It is mandatory to use either of these two methods.

Note: the identification of the reader by its name may also be necessary to assign it a precise functional role, but this is the responsibility of the application.

Observability

The PC/SC plugin implements the Keyple observation pattern at the plugin (reader connection and disconnection) and reader (card insertion and removal) level, in this case it is imperative to cast the Plugin and Reader objects as ObservablePlugin and ObservableReader and to implement the interfaces defined for this purpose in the Keyple Service SPI package.

However, the use of these observation features is optional; it is possible to operate in a static mode on both the plugin and the reader side.

Card identification

It is sometimes necessary to identify the type of card detected by the reader even before sending it an APDU command. Here again PC/SC does not offer much facility and the only information available in a more or less standardized way is the ATR.

The PC/SC plugin It uses an extensible mechanism of regular expression based rules to determine a protocol type. A number of rules are defined by default for common card technology types, but it is possible to redefine or add rules using PcscPluginFactoryBuilder.

Packages 
Package Description
org.eclipse.keyple.plugin.pcsc
Contains the APIs needed to manage PC/SC readers in a Keyple-based application.