CNA member Keyple extension to manage contactless memory ticket solutions


For a long time, the Calypso card product range was limited to ‘Calypso Prime’, in order to cater for season ticket holders and regular travellers. But to manage ‘occasional’ travelers with single or limited-use card products, many ticketing systems used contactless memory ticketing solutions (such as Mifare UltraLight, CT512, ST25) in addition to Calypso cards. Since then, the Calypso card range has been expanded with the Calypso Light and Calypso Basic solutions. Pending migration to support Light and Basic products, many ticketing systems still require their terminals to handle Calypso cards alongside contactless memory ticket solutions.

To assist CNA members and facilitate the management of contactless memory tickets on Calypso terminals based on the Keyple middleware: CNA offers its members the privilege of benefiting from libraries enabling them to process contactless memory tickets on Keyple-based terminal.

  • 🌍 All the APIs needed to support memory tickets are open source and hosted by the Keypop and Keyple projects.
  • 🌍 CNA also offers open source examples of contactless memory ticket processing.
  • 🚫 Only CNA members can benefit from CNA libraries supporting contactless memory ticket processing.

This is the first solution to easily operate proprietary contactless memory ticket solutions on a Keyple terminal. It is possible that it may lack useful features for your needs: if this is the case, don’t hesitate to report it to CNA (potentially through issues on the CNA StorageCard API definition repository).

Involved software components

In addition to the Keyple global component dependency guide, the diagram below focuses on the components involved in handling contactless memory tickets.

Terminal Interface to drive a transaction with contactless memory tickets

In order to facilitate the design of ticketing processing on a terminal interacting with contactless memory tickets, CNA has defined a dedicated universal interface: the Storage Card API.

Keypop API to drive a transaction with contactless memory tickets

An open source Java translation of the Storage Card API definition has been released within the Eclipse Keypop project.

CNA Library to process contactless memory tickets

In order to assist CNA members who need to combine Calypso card processing with contactless memory ticket processing on their Keyple-based ticketing terminals, CNA provides its members with a dedicated card extension: the CNA Storage Card Lib.

Reader support for contactless memory tickets

To integrate smart card reader solutions with the Keyple middleware in a generic way, until now the Keyple project offered a simple plugin interface

Proprietary contactless ticket solutions do not support the level 4 of the ISO 14443 standard: these solutions are therefore not compatible with the “APDU command” envelope format defined by the ISO 7816-4 standard. Communication with contactless tickets therefore relies on exchanges of non-standardized “byte blocks”: specific processing by reader solutions is required to handle memory tickets.

Native support of contactless memory tickets by PC/SC readers

The PC/SC standard has defined an APDU ‘Storage Card’ envelope format to standardize the way data blocks are exchanged with contactless memory tickets. This envelope format is used by the Storage Card library proposed by CNA. Thus, the PC/SC plugin proposed by the Keyple project is natively compliant to support communication with contactless memory tickets.

Keyple interface for extending a plugin to manage memory ticket command wrapping

To support contactless memory tickets on Keyple terminals using reader solutions other than PC/SC, the reader plugin needs to manage the APDU wrapping of command blocks specific to contactless ticket solutions. To facilitate and factorize the integration of APDU wrapping for plugins for reader solutions other than PC/SC, the Keyple project offers an additional API: the ‘Plugin Storage Card API’.

A reader plugin that uses this API can then be extended to support contactless memory tickets if it is interfaced with a library implementing this API.

  • In the Keyple project, the Android NFC plugin has been updated to use this interface, enabling an NFC reader to integrate support for Mifare UltraLight tickets (as CT512 or ST25 products are not part of the NFC standard). (feature currently available in the ‘storage-card-api’ branch, integration in progress in the main branch)
  • Among the Keyple ‘add-ons’ offered by CNA, the open source plugin for Bluebird readers has also evolved to use this API and thus support Mifare UL, CT512, and ST25 tickets (feature currently available in the ‘storagecard’ branch, integration in progress in the main branch)

CNA Library to add contactless memory ticket command wrapping to Keyple plugins

To assist CNA members needing to integrate contactless memory ticket processing on a Keyple-based terminal with readers other than PC/SC: CNA provides a members-only library that enables APDU wrapping of ticket commands to be integrated into a Keyple plugin: the Plugin Storage Card library.

Examples of contactless memory ticket processing in a terminal application

Among the basic examples of Keyple implementation supplemented by CNA, one is dedicated to the processing of contactless memory tickets on a PC terminal equipped with PC/SC readers:

All the applications of the CNA advanced ticketing demonstrator are currently being updated to integrate the processing of contactless ticketing solutions in addition to Calypso cards.