Link and Contact
Website |
Support |
Copyright © Calypso Networks Association, https://calypsonet.org.
This specification is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0).
You are free to share — copy and redistribute this document in any medium or format for any purpose, even commercially — under the following terms:
-
Attribution — You MUST give appropriate credit to the Calypso Networks Association, provide a link to the license, and indicate if changes were made. You MAY do so in any reasonable manner, but not in any way that suggests the Calypso Networks Association endorses you or your use.
-
NoDerivatives — If you remix, transform, or build upon this document, you MAY NOT distribute the modified material.
No additional restrictions — You MAY NOT apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Implementation grant — The NoDerivatives condition above applies to this specification document only — its text, tables and diagrams. It does not restrict the use of the technical information the document contains. The Calypso Networks Association hereby grants everyone an irrevocable, worldwide, royalty-free permission to use the information contained in this specification to design, develop, and distribute software implementations of this API, in any programming language, under the license of their choice.
The full license text is available at https://creativecommons.org/licenses/by-nd/4.0/.
1. Abstract
This document is the official technical specification of the Terminal Calypso Card API standardised by the Calypso Networks Association (CNA). It defines, in a language-agnostic way, the interfaces, classes, enumerations, exceptions, structural relationships and behavioural requirements that any conforming implementation of the Terminal Calypso Card API MUST satisfy.
The Terminal Calypso Card API is the application-facing surface used by terminal applications to operate Calypso transit and ticketing cards. It builds on top of the Terminal Reader API (CNA-TR-API) and delegates every cryptographic operation to a symmetric (CNA-TCCS-API) or asymmetric (CNA-TCCA-API) crypto module.
Document Status
Reference |
YYMMDD-SP-CNATerminalAPI-CalypsoCard |
|---|---|
Short name |
CNA-TCC-API |
Version |
3.0.0-SNAPSHOT |
Revision date |
2026-07-20 |
Editor |
Calypso Networks Association |
Source repository |
https://github.com/calypsonet/calypsonet-terminal-calypso-card-uml-api |
Reference license |
Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0) |
| The present document specifies the 3.0.0-SNAPSHOT of the Terminal Calypso Card API. It defines a single, coherent baseline against which conforming implementations are evaluated; the Since column indicates the version in which each member was introduced. |
Revision List
|
This section lists the high-level changes per version. The complete, fine-grained
changelog is maintained in the |
| Version / Date | Modifications |
|---|---|
v3.0.0-SNAPSHOT |
Baseline. |
2. Introduction
2.1. Purpose
The Terminal Calypso Card API defines the public surface used by terminal applications to:
-
select a Calypso card through a CNA-TR-API selection scenario enriched with Calypso-specific commands;
-
operate read-only transactions without involving a crypto module (free transaction);
-
operate fully authenticated transactions using a symmetric crypto module (CNA-TCCS-API) — either in the regular mode (compatible with every Calypso product) or in the extended mode (additional features only available on Calypso Prime Extended);
-
operate fully authenticated transactions using an asymmetric crypto module (CNA-TCCA-API) in PKI mode;
-
expose a dynamic view of the card (
CalypsoCard) updated throughout the transaction.
2.2. Scope
This specification covers:
-
the factory used to instantiate the public types of the API (
CalypsoCardApiFactory); -
the data model of a Calypso card (
CalypsoCard,ElementaryFile,FileData,FileHeader,DirectoryHeader, Stored Value log records); -
the selection extension (
CalypsoCardSelectionExtension); -
the family of transaction managers (Free, Secure Regular, Secure Extended, Secure PKI);
-
the symmetric and asymmetric security setting carriers;
-
the Stored Value operations and Search Record Multiple support;
-
the SPIs implemented by crypto modules to plug into the secure transaction managers;
-
the family of exceptions raised during a Calypso transaction.
The following topics are out of scope:
-
the on-the-wire APDU dialog with the card (handled internally by the implementation);
-
the cryptographic algorithms themselves — only the SPI contract is normative;
-
the on-the-wire transport between the terminal and any remote ticketing system.
2.3. Conformance
A software product conforms to this specification if and only if:
-
it implements every interface and class defined in Chapter 5 with the operations and semantics prescribed in this document,
-
it raises exceptions exclusively of the types defined in Section 5.5 for the situations described,
-
it preserves the structural relationships described in Chapter 4.
Throughout this specification, the key words MUST, MUST NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be interpreted as described in RFC 2119 and RFC 8174 when, and only when, they appear in all capitals.
In conformance with RFC 2119, SHALL is equivalent to MUST; this specification uses MUST exclusively in order to avoid ambiguity.
2.4. Document Conventions
2.4.1. Naming
Type names follow UpperCamelCase; operation, parameter and enumeration-member names follow lowerCamelCase
except for enumeration values which use UPPER_SNAKE_CASE. Names defined by this specification are reproduced
as-is in the UML class diagram (Section 4.3).
2.4.2. Language-agnostic types
| Symbolic type | Description | Typical bindings |
|---|---|---|
|
Sequence of characters, UTF-8 encoded by default. |
|
|
Two-state truth value. |
|
|
Signed 8-bit value. |
|
|
Signed 16-bit integer. |
|
|
Signed 32-bit integer. |
|
|
Ordered sequence of octets. |
|
|
Ordered collection of |
|
|
Unordered collection of unique |
|
|
Associative array binding keys of type |
|
|
Associative array sorted by key. |
|
|
Nullable value: either a |
|
|
Indicates that an operation returns no value. |
|
2.4.3. Type tables
Each interface, class, enumeration and exception defined in this document is described by a table of the form:
Name |
The type’s normalized name. |
|---|---|
Kind |
The category of the type (interface, class, enumeration, exception, etc.). |
Namespace |
The namespace in which the type is defined. |
Generics |
The generic type parameter of this type, when applicable. |
Extends |
The type extended by this type, when applicable. |
Implements |
The interface implemented by this type, when applicable. |
Since |
The version of the API in which the type was introduced. |
Purpose |
A normative description of the type’s responsibility. |
See also |
Cross-references to related operations or types, each a hyperlink to the corresponding table. Present only when applicable. |
The Purpose row states, in one or two sentences, the responsibility of the type and the way an instance is obtained. It is meant to be scanned, not read: any content that requires structure or depth — rules, lists, notes, value tables or examples — is placed as prose below the table.
2.4.4. Operation tables
Each operation defined in this document is described by a table of the form:
Signature |
The operation’s language-agnostic signature. |
|---|---|
Since |
The version of the API in which the operation was introduced. |
Description |
A normative description of the operation’s behaviour. |
Parameters |
A description of each input parameter. |
Returns |
A description of the returned value, if any. |
Throws |
A list of exceptional conditions, each mapped to a specific exception type. |
See also |
Cross-references to related operations or types, each a hyperlink to the corresponding table. Present only when applicable. |
2.4.5. Operation contracts
To avoid repetition, the following rules apply to every operation table in Chapter 5 and are therefore not restated for each operation:
-
Non-
nullarguments. Unless explicitly stated otherwise, every input parameter MUST be non-null. An implementation MUST raiseIllegalArgumentExceptionif anullvalue is supplied. This implicitnullcheck is not repeated in the Throws row, which statesNone.when no other exception can occur. -
Non-
nullresults. Unless the return type is marked nullable (T?) or the Returns row states otherwise, an operation returns a non-nullvalue. -
Collections. Unless the return type is marked nullable (
T?), an operation whose return type is a collection (e.g.list,set,map) returns an empty collection rather thannull. -
Fluent composition. Builder-style operations return the current instance so that calls can be chained.
2.4.6. Concurrency
Unless explicitly stated otherwise, the stateful types defined by this specification are not thread-safe. A given instance MUST be accessed from a single thread at a time; concurrent use of the same instance without external synchronisation results in undefined behaviour. Distinct instances MAY be used concurrently.
2.5. References and Resources
2.5.1. Calypso References
References to CNA Terminal APIs designate the indicated major version; any later release within the same major is backward-compatible per that API’s evolution policy.
| Reference | Document |
|---|---|
CNA Terminal API — Reader (SP-CNATerminalAPI-Reader), version 3.0, Calypso Networks Association. |
|
CNA Terminal API — Calypso Crypto Symmetric (SP-CNATerminalAPI-CalypsoCryptoSymmetric), version 0.1, Calypso Networks Association. |
|
CNA Terminal API — Calypso Crypto Asymmetric (SP-CNATerminalAPI-CalypsoCryptoAsymmetric), version 0.2, Calypso Networks Association. |
2.5.2. Normative References
| Reference | Document |
|---|---|
Key words for use in RFCs to Indicate Requirement Levels, S. Bradner, March 1997. |
|
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words, B. Leiba, May 2017. |
|
2.5.3. External Resources
| Resource | Link |
|---|---|
Calypso Networks Association |
|
Terminal APIs website |
|
Terminal APIs documentation |
3. Glossary and Acronyms
3.1. Glossary
| Term | Definition |
|---|---|
Calypso Card |
Smart card compliant with the Calypso specifications. |
Secure Session |
Authenticated and integrity-protected exchange between the terminal and the card. |
Regular Mode |
Secure session mode compatible with every Calypso product. |
Extended Mode |
Secure session mode supporting additional features (early mutual authentication, encryption of session APDUs, larger sessions). Available on Calypso Prime Extended. |
PKI Mode |
Secure session mode using asymmetric cryptography (Calypso 3.3+). |
Stored Value (SV) |
Calypso feature exposing a card-resident monetary counter. |
Crypto Module |
Component implementing the SPI exposed by CNA-TCCS-API or CNA-TCCA-API. |
KIF / KVC |
Calypso Key Identifier / Key Version Code. |
HCE |
Host Card Emulation. |
3.2. Acronyms
| Abbreviation | Expansion |
|---|---|
AID |
Application IDentifier |
APDU |
Application Protocol Data Unit |
CNA |
Calypso Networks Association |
DF |
Dedicated File |
EF |
Elementary File |
FCI |
File Control Information |
FCP |
File Control Parameters |
HCE |
Host Card Emulation |
KIF |
Key Identifier |
KVC |
Key Version Code |
LID |
Long IDentifier (file id) |
MAC |
Message Authentication Code |
PIN |
Personal Identification Number |
PKI |
Public Key Infrastructure |
SAM |
Secure Application Module |
SFI |
Short File Identifier |
SPI |
Service Provider Interface |
SV |
Stored Value |
UML |
Unified Modelling Language |
4. Architectural Overview
4.1. Functional positioning
4.2. Logical namespaces
| Namespace | Role | Summary |
|---|---|---|
|
Public API |
Factory, properties, enumerations ( |
|
Public API |
Data model of a Calypso card: |
|
Public API |
Transaction managers (Free / Secure Regular / Secure Extended / Secure PKI), security setting carriers, |
|
SPI |
Marker interfaces implemented by crypto extensions ( |
4.3. UML class diagram
The following UML class diagram provides a visual representation of the types and relationships defined by this specification:
5. API Specification
5.1. Classes
5.1.1. Calypso Card API Properties
Name |
|
|---|---|
Kind |
Final class |
Namespace |
|
Since |
1.0 |
Purpose |
Exposes the immutable properties of the Terminal Calypso Card API. |
Constants
| Name | Type | Since | Description |
|---|---|---|---|
|
|
1.0 |
String representation of the API version (e.g. |
5.2. API Interfaces
5.2.1. Asymmetric Crypto Security Setting
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
2.1 |
Purpose |
Security setting carrier for PKI Calypso card transactions. An instance is obtained via |
Add CA Certificate
Signature |
|
|---|---|
Since |
2.1 |
Description |
Registers a CA certificate. The issuer’s certificate MUST be loaded first. Preloading a CA certificate avoids having to read it from the card. Various checks are performed to ensure the integrity and validity of the supplied CA certificate: verification of the certificate’s signature using the issuer’s public key, check of the validity period to ensure the certificate is neither expired nor prematurely valid, confirmation of the authenticity of the issuer and subject details, and compliance with any constraints or extensions required for CA certificates. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
Add CA Certificate Parser
Signature |
|
|---|---|
Since |
2.1 |
Description |
Registers a CA certificate parser, used when the CA certificate is not already available. The parser provides the means to build a CA certificate from the raw data read from the card. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Add Card Certificate Parser
Signature |
|
|---|---|
Since |
2.1 |
Description |
Registers a card certificate parser. The parser provides the means to build a card certificate from the raw data read from the card. Only one parser MAY be registered per certificate type. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Add PCA Certificate
Signature |
|
|---|---|
Since |
2.1 |
Description |
Registers a self-signed PCA certificate. Various checks are performed to ensure the integrity and validity of the supplied PCA certificate: verification of the certificate’s signature to ensure it is self-signed, check of the validity period to ensure the certificate is neither expired nor prematurely valid, confirmation of the authenticity of the issuer and subject details, and compliance with any constraints or extensions required for PCA certificates. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Assign Open Secure Session Max Duration (All DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of an open PKI secure session for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign Open Secure Session Max Duration (Per DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of an open PKI secure session for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.2. Calypso Card
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
1.0 |
Purpose |
Dynamic view of the card’s content, updated from selection to the end of the transaction. |
An instance of CalypsoCard is obtained by casting the IsoSmartCard object produced by the selection process
defined in CNA-TR-API.
A CalypsoCard carries: application identification (revision, class, DF name, serial number, ATR, issuer), the indication of optional features (Stored Value, PIN, Rev 3.2 mode, ratification management), the management information of the modification buffer, the invalidation status and the files / counters / SV data read or modified during the transaction.
The CalypsoCard instance bound to a transaction is a dynamic view of the card image, updated after every successful command.
Failed write commands do not update the in-memory image.
Get Application Serial Number
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the Application Serial Number, an 8-byte value uniquely identifying the card application. |
Returns |
A non-empty |
Throws |
None. |
Get Application Subtype
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the application subtype byte, which references the card’s file structure. |
Returns |
A |
Throws |
None. |
Get Application Type
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the application type byte, which encodes the product type together with its options. |
Returns |
A |
Throws |
None. |
Get CA Certificate
Signature |
|
|---|---|
Since |
2.1 |
Description |
CA certificate; empty if not available. |
Returns |
A |
Throws |
None. |
See also |
|
Get Card Certificate
Signature |
|
|---|---|
Since |
2.1 |
Description |
Card certificate; empty if not available. |
Returns |
A |
Throws |
None. |
See also |
|
Get Card Public Key
Signature |
|
|---|---|
Since |
2.1 |
Description |
Card public key; empty if not available. |
Returns |
A |
Throws |
None. |
See also |
|
Get DF Name
Signature |
|
|---|---|
Since |
1.0 |
Description |
DF name (5 to 16 bytes), as per ISO/IEC 7816-4. It also corresponds to the complete representation of the target covered by the AID value supplied in the selection command: the AID selects the application by specifying all or part of the targeted DF name (5 bytes minimum). |
Returns |
A non-empty |
Throws |
None. |
Get Directory Header
Signature |
|
|---|---|
Since |
1.0 |
Description |
Metadata of the current DF; |
Returns |
A |
Throws |
None. |
See also |
|
Get File By LID
Signature |
|
|---|---|
Since |
1.0 |
Description |
EF whose LID matches; Note that when a secure session is running, the returned object carries all in-session modifications, which are rolled back if the secure session fails. |
Parameters |
|
Returns |
An |
Throws |
None. |
Get File By SFI
Signature |
|
|---|---|
Since |
1.0 |
Description |
EF whose SFI matches; Note that when a secure session is running, the returned object carries all in-session modifications, which are rolled back if the secure session fails. |
Parameters |
|
Returns |
An |
Throws |
None. |
Get Files
Signature |
|
|---|---|
Since |
1.1 |
Description |
All known EFs of the current DF. During a secure session, this set reflects every in-session modification (which is rolled back on session failure). |
Returns |
A |
Throws |
None. |
Get PIN Attempt Remaining
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the number of PIN presentation attempts still remaining before the PIN becomes blocked. |
Returns |
An |
Throws |
|
See also |
|
Get Platform
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the platform identification byte, which references the card’s chip. |
Returns |
A |
Throws |
None. |
Get Product Type
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the card product type ( |
Returns |
A |
Throws |
None. |
Get Session Modification
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the session modification byte, which — depending on the card — caps either the number of bytes modifiable or the number of write commands allowed within a secure session. |
Returns |
A |
Throws |
None. |
Get Software Issuer
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the software issuer byte, identifying the issuer of the card’s embedded software. |
Returns |
A |
Throws |
None. |
Get Software Revision
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the software revision byte of the card’s embedded software. |
Returns |
A |
Throws |
None. |
Get Software Version
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the software version byte of the card’s embedded software. |
Returns |
A |
Throws |
None. |
Get Startup Info Raw Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the raw Calypso startup information block — the sequence of bytes from which the individual startup fields (platform, application type and subtype, software issuer, version and revision, etc.) are derived. |
Returns |
A non-empty |
Throws |
None. |
Get SV Balance
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the current Stored Value (SV) balance held by the card, expressed in its monetary unit. |
Returns |
An |
Throws |
|
See also |
|
Get SV Debit Log All Records
Signature |
|
|---|---|
Since |
1.0 |
Description |
All SV debit log records read from the card. |
Returns |
A |
Throws |
None. |
See also |
|
Get SV Debit Log Last Record
Signature |
|
|---|---|
Since |
1.0 |
Description |
Last SV debit log record; |
Returns |
A |
Throws |
None. |
See also |
|
Get SV Last T Num
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the number of the last Stored Value (SV) transaction recorded on the card. |
Returns |
An |
Throws |
|
See also |
|
Get SV Load Log Record
Signature |
|
|---|---|
Since |
1.0 |
Description |
Last SV load log record; |
Returns |
A |
Throws |
None. |
See also |
|
Get Traceability Information
Signature |
|
|---|---|
Since |
1.1 |
Description |
Traceability information (software issuer ID and discretionary data); empty if not available. |
Returns |
A |
Throws |
None. |
See also |
|
Get Transaction Counter
Signature |
|
|---|---|
Since |
1.2 |
Description |
Transaction counter from the output of the last successful Open Secure Session. Note: commands such as Change Key, Change/Verify PIN, SV Debit/Undebit/Reload decrement the card counter but do not update this returned value. |
Returns |
An |
Throws |
|
See also |
|
Is DF Invalidated
Signature |
|
|---|---|
Since |
1.0 |
Description |
Tells whether the current DF is invalidated. The invalidation status is determined either from the response to the Select Application command or from the response to a Select File (DF) command. For a |
Returns |
|
Throws |
None. |
Is DF Ratified
Signature |
|
|---|---|
Since |
1.0 |
Description |
Tells whether the last session has been ratified. |
Returns |
A |
Throws |
|
See also |
|
Is Extended Mode Supported
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether the Extended Mode is supported. This indication is initially interpreted from the Application Type byte, but MAY be updated once the secure session is opened: depending on the type of key used, the extended mode functionalities may not be available (for example with a non-AES key). |
Returns |
A |
Throws |
None. |
Is HCE
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether the card is a Calypso HCE. |
Returns |
A |
Throws |
None. |
Is PIN Blocked
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether the PIN is blocked. |
Returns |
A |
Throws |
|
See also |
|
Is PIN Feature Available
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether the Calypso PIN feature is available. This indication is interpreted from the Application Type byte. |
Returns |
|
Throws |
None. |
Is PKI Mode Supported
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether Public Key Authentication is supported. This indication is interpreted from the Application Type byte. |
Returns |
A |
Throws |
None. |
Is Ratification On Deselect Supported
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether ratification happens on deselect (ratification command not required). This indication is interpreted from the Application Type byte. |
Returns |
A |
Throws |
None. |
Is SV Feature Available
Signature |
|
|---|---|
Since |
1.0 |
Description |
Indicates whether the SV feature is available. This indication is interpreted from the Application Type byte. |
Returns |
|
Throws |
None. |
5.2.3. Calypso Card API Factory
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
2.0 |
Purpose |
Factory used to obtain instances of every public type provided by the API. |
Create Asymmetric Crypto Security Setting
Signature |
|
|---|---|
Since |
2.1 |
Description |
Creates the |
Parameters |
|
Returns |
|
Throws |
|
Create Calypso Card Selection Extension
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates a |
Returns |
|
Throws |
None. |
Create Free Transaction Manager
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates a |
Parameters |
|
Returns |
|
Throws |
None. |
Create Search Command Data
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Secure Extended Mode Transaction Manager
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates a |
Parameters |
|
Returns |
|
Throws |
None. |
Create Secure PKI Mode Transaction Manager
Signature |
|
|---|---|
Since |
2.1 |
Description |
Creates a |
Parameters |
|
Returns |
|
Throws |
|
Create Secure Regular Mode Transaction Manager
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates a |
Parameters |
|
Returns |
|
Throws |
None. |
Create Symmetric Crypto Security Setting
Signature |
|
|---|---|
Since |
2.0 |
Description |
Creates the |
Parameters |
|
Returns |
|
Throws |
|
5.2.4. Calypso Card Selection Extension
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
2.0 |
Purpose |
Enriches the CNA-TR-API selection scenario with Calypso-specific commands and pre-opening of a secure session. An instance is obtained via |
By default the selection rejects PRIME revision 3 cards that have been invalidated.
The application MUST call
acceptInvalidatedCard to stop ignoring them.
For earlier revisions, the application MAY have to handle invalidation itself (typically via a Select File on the DF).
For all prepare* operations, unless otherwise specified, the following parameter ranges apply:
| Parameter | Range |
|---|---|
SFI |
|
Record number |
|
Counter number |
|
Counter value |
|
Offset |
|
Input data length |
|
Accept Invalidated Card
Signature |
|
|---|---|
Since |
1.0 |
Description |
Requests to accept invalidated cards during the selection stage. Works only with cards that indicate their invalidation status at the time of selection (e.g., all PRIME Revision 3+ cards and certain PRIME Revision 2 cards). |
Returns |
The current instance ( |
Throws |
None. |
Prepare Get Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Get Data command for the supplied tag. This is the way to obtain FCI information when it is not supplied directly by Select Application (e.g. the OMAPI case). Caution: the resulting APDU command is compliant with PRIME revision 3 cards. It may therefore be rejected by some earlier revision cards. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Pre Open Secure Session
Signature |
|
|---|---|
Since |
1.7 |
Description |
Adds a specific Open Secure Session command attempting a pre-opening. Enables a future single-exchange session execution by anticipating the APDU responses. The objective of the pre-opening is to allow the grouping of all the commands of a secure session. It is only relevant for a distributed system where the ticketing processing is done remotely, so that a complete secure session can be carried out in a single exchange between the server and the terminal. To achieve that single exchange, all the data that will have to be read in session MUST first be read locally,
outside the session — otherwise additional exchanges take place. The remote ticketing processing then prepares
all the commands of the session, from opening to closing, before executing it: The mechanism is ineffective if:
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Binary
Signature |
|
|---|---|
Since |
1.7 |
Description |
Adds one or more Read Binary commands to read all or part of the supplied binary EF. Once processed, the
result is available in the Caution: the resulting APDU command is compliant with PRIME revision 3 cards. It may therefore be rejected by some earlier revision cards. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Counter
Signature |
|
|---|---|
Since |
1.7 |
Description |
Adds a Read Records command to read a part of a record of the supplied EF, which SHOULD be a counter file. The
record is read up to the supplied counter number, so all preceding counters are also read. Once processed, the
result is available in the Caution: the resulting APDU command is compliant with PRIME revision 3 cards. It may therefore be rejected by some earlier revision cards. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Record
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Read Records command for a single record of a linear or cyclic EF. Once processed, the result is
available in the Caution: the resulting APDU command is compliant with PRIME revision 3 cards. It may therefore be rejected by some earlier revision cards. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Select File (LID)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Select File command targeting an EF by its LID. Caution: PRIME 3 compatible only. The command fails if the selected file is not an EF. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Select File (Select Control)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Select File command using a navigation control ( Caution: the resulting APDU command is compliant with PRIME revision 3 cards. It may therefore be rejected by some earlier revision cards. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.5. Directory Header
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
Carries the metadata of a Calypso DF. |
Get Access Conditions
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns a reference to the access conditions. |
Returns |
A non-empty |
Throws |
None. |
Get DF Status
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the status byte of the DF (Dedicated File) described by this header. |
Returns |
A |
Throws |
None. |
Get Key Indexes
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns a reference to the keys indexes. |
Returns |
A non-empty |
Throws |
None. |
Get KIF
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the KIF associated with the supplied write access level. |
Parameters |
|
Returns |
A |
Throws |
None. |
Get KVC
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the KVC associated with the supplied write access level. |
Parameters |
|
Returns |
A |
Throws |
None. |
Get LID
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the LID, the 2-byte identifier of the associated file structure (DF or EF). |
Returns |
A |
Throws |
None. |
5.2.6. Elementary File
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
Calypso Elementary File. Carries an |
Get Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the |
Returns |
A |
Throws |
None. |
Get Header
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the file header, or |
Returns |
A |
Throws |
None. |
Get SFI
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the Short File Identifier (SFI) of this Elementary File. |
Returns |
A |
Throws |
None. |
5.2.7. File Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
Carries the content of a Calypso EF and exposes counter-oriented accessors. |
Get All Counters Value
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the values of all counters extracted from record #1. |
Returns |
A |
Throws |
None. |
Get All Records Content
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the known content of every record, keyed by record number. |
Returns |
A |
Throws |
None. |
Get Content (No Args)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the known content of record #1 (or the entire content for a binary file). |
Returns |
A |
Throws |
None. |
Get Content (Num Record)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the known content of the supplied record number. |
Parameters |
|
Returns |
A |
Throws |
None. |
Get Content (Num Record, Data Offset, Data Length)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns a copy of the known content subset of a record from |
Parameters |
|
Returns |
A |
Throws |
|
Get Content As Counter Value
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the value of counter |
Parameters |
|
Returns |
An |
Throws |
|
5.2.8. File Header
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
Carries the metadata of a Calypso EF. |
Get Access Conditions
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the access conditions; empty array if not available. |
Returns |
A |
Throws |
None. |
Get DF Status
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the DF status, or |
Returns |
A |
Throws |
None. |
Get EF Type
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the type of this Elementary File (EF), one of the |
Returns |
|
Throws |
None. |
Get Key Indexes
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the key indexes; empty array if not available. |
Returns |
A |
Throws |
None. |
Get LID
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the LID, the 2-byte identifier of the associated file structure (DF or EF). |
Returns |
A |
Throws |
None. |
Get Record Size
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the size of a record. For a counter file, this is the original size of record #1; the extra bytes — the remainder of the division of the file size by 3 — are not accessible. For a binary file, this is the size of the file. |
Returns |
An |
Throws |
None. |
Get Records Number
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the number of records. For a counter file the number of records is always |
Returns |
An |
Throws |
None. |
Get Shared Reference
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the non-zero unique identifier of the shared data when the file data is shared. Returns |
Returns |
A |
Throws |
None. |
5.2.9. Free Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
2.0 |
Purpose |
Transaction manager that does not require any cryptographic computation. An instance is obtained via |
FreeTransactionManager does not add any operation.
5.2.10. Search Command Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.1 |
Purpose |
Carries the input/output data of |
Enable Repeated Offset
Signature |
|
|---|---|
Since |
1.1 |
Description |
Analyse the data at the supplied offset, then repeatedly at each following offset until the end of the record. |
Returns |
The current instance ( |
Throws |
None. |
Fetch First Matching Result
Signature |
|
|---|---|
Since |
1.1 |
Description |
Requests to fetch the content of the first matching record into the |
Returns |
The current instance ( |
Throws |
None. |
Get Matching Record Numbers
Signature |
|
|---|---|
Since |
1.1 |
Description |
Returns the record numbers that matched. |
Returns |
A |
Throws |
None. |
Set Mask
Signature |
|
|---|---|
Since |
1.1 |
Description |
Sets the comparison mask. The mask length MUST be |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Offset
Signature |
|
|---|---|
Since |
1.1 |
Description |
Sets the offset (in bytes) at which the analysis starts within each record (default: 0). |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Search Data
Signature |
|
|---|---|
Since |
1.1 |
Description |
Sets the byte sequence to search for within the targeted record. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set SFI
Signature |
|
|---|---|
Since |
1.1 |
Description |
Sets the SFI of the EF in which the search is performed. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Start At Record
Signature |
|
|---|---|
Since |
1.1 |
Description |
Sets the record number at which the search begins (default: 1). |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.11. Secure Extended Mode Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
2.0 |
Purpose |
Symmetric-key transaction manager exposing additional operations only available on Calypso Prime Extended products. An instance is obtained via |
Prepare Activate Encryption
Signature |
|
|---|---|
Since |
2.0 |
Description |
Requests encryption for all following session commands. This ensures data confidentiality and prevents man-in-the-middle attacks. This command only makes sense in the context of a secure session. Encryption is resource intensive and increases transaction times: it is therefore RECOMMENDED to limit it to
the commands that require it. Furthermore, when early mutual authentication is also required, it is RECOMMENDED
for performance reasons to place the
|
Returns |
The current instance ( |
Throws |
|
See also |
|
Prepare Deactivate Encryption
Signature |
|
|---|---|
Since |
2.0 |
Description |
Requests to stop the encryption, which restores the exchanges with the card to their normal mode. This command only makes sense in the context of a secure session in which encryption of the commands has previously been requested. NOTE: |
Returns |
The current instance ( |
Throws |
|
See also |
|
Prepare Early Mutual Authentication
Signature |
|
|---|---|
Since |
2.0 |
Description |
Requests to mutually authenticate the card and the terminal before the secure session is closed. The use of this feature penalises the execution time of the secure session and SHOULD be used only when needed (e.g. before sending sensitive commands). |
Returns |
The current instance ( |
Throws |
|
See also |
|
5.2.12. Secure PKI Mode Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
2.1 |
Purpose |
Asymmetric-key transaction manager, compatible with Calypso cards in PKI mode. An instance is obtained via |
Prepare Open Secure Session
Signature |
|
|---|---|
Since |
2.1 |
Description |
Schedules an Open Secure Session command in PKI mode. If the next prepared command is a Read One Record or Read One Or More Counters, it will be merged with the session opening for optimisation. |
Returns |
The current instance ( |
Throws |
None. |
5.2.13. Secure Regular Mode Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
2.0 |
Purpose |
Symmetric-key transaction manager compatible with every Calypso product. An instance is obtained via |
No additional operation declared.
5.2.14. Secure Session Status
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
3.0 |
Purpose |
Immutable snapshot of the current secure session state, returned by |
A SecureSessionStatus is captured at the moment of the call and does not reflect subsequent changes to the session state.
To obtain a refreshed status, the caller MUST call getSecureSessionStatus() again.
Get Type
Signature |
|
|---|---|
Since |
3.0 |
Description |
Returns the cryptographic nature of the session (symmetric vs asymmetric). |
Returns |
|
Throws |
None. |
Get Write Access Level
Signature |
|
|---|---|
Since |
3.0 |
Description |
Returns the write access level requested at session opening. Returns |
Returns |
A |
Throws |
None. |
Is Open
Signature |
|
|---|---|
Since |
3.0 |
Description |
Indicates whether a secure session is open at the snapshot moment. |
Returns |
A |
Throws |
None. |
5.2.15. Secure Symmetric Crypto Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Extends |
|
Since |
2.0 |
Purpose |
Common operations for every transaction manager backed by symmetric cryptography. |
Prepare Change Key
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules a Change Key command. MUST be performed outside a secure session. All KIFs/KVCs MUST be available in the crypto module. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Invalidate
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an Invalidate command, which marks the card application as invalidated, blocking further use until
it is rehabilitated. This command is usually executed within a secure session with the |
Returns |
The current instance ( |
Throws |
|
Prepare Open Secure Session
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an Open Secure Session command. The secure session is opened with the supplied
If the next prepared command is a Read One Record or Read One Or More Counters, it is merged with the
session opening for optimisation, unless the pre-open mode is active or the read-merge optimisation has been
disabled. This mechanism may in some cases be incompatible with the security constraints; it can then be
disabled via
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
Prepare Rehabilitate
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules a Rehabilitate command, which clears the card application’s invalidation status, making it usable
again. This command is usually executed within a secure session with the |
Returns |
The current instance ( |
Throws |
|
Prepare SV Debit (Date)
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an SV Debit or SV Undebit command using the supplied additional data. It decreases the current SV
balance by the supplied amount, or cancels a previous debit, according to the operation type chosen when the
preceding SV Get command was called. Amount: The key used is the debit key. Once processed, the data is available in the
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare SV Debit (No Date)
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an SV Debit or SV Undebit command with the optional data fields set to zero. It decreases the
current SV balance by the supplied amount, or cancels a previous debit. The key used is the debit key. Once
processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare SV Get
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an SV Get command, which reads the Stored Value data (balance and logs) that MUST precede any SV
debit, undebit or reload. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare SV Reload (Date)
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an SV Reload command using the supplied additional data. Amount range: |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare SV Reload (No Date)
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules an SV Reload command with the optional data fields set to zero. The key used is the reload key.
Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.2.16. Secure Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Extends |
|
Since |
2.0 |
Purpose |
Common operations for every secure (cryptographically-backed) transaction manager. |
Get Crypto Extension
Signature |
|
|---|---|
Since |
2.0 |
Description |
Returns the associated |
Parameters |
|
Returns |
An |
Throws |
None. |
Prepare Cancel Secure Session
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules a special Close Secure Session command aborting the current secure session. Executed in safe mode — never raises exceptions. |
Returns |
The current instance ( |
Throws |
None. |
Prepare Close Secure Session
Signature |
|
|---|---|
Since |
2.0 |
Description |
Schedules a Close Secure Session command. The ratification mechanism is disabled by default but MAY be enabled
via |
Returns |
The current instance ( |
Throws |
|
5.2.17. SV Debit Log Record
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
One record of a Stored Value debit log. |
Get Amount
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the debit amount. |
Returns |
An |
Throws |
None. |
Get Balance
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SV balance after the debit. |
Returns |
An |
Throws |
None. |
Get Debit Date
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 2-byte debit date. |
Returns |
A non-empty |
Throws |
None. |
Get Debit Time
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 2-byte debit time. |
Returns |
A non-empty |
Throws |
None. |
Get KVC
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the KVC of the debit key. |
Returns |
A |
Throws |
None. |
Get Raw Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the raw bytes of the debit log record. |
Returns |
A non-empty |
Throws |
None. |
Get SAM ID
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 4-byte SAM ID. |
Returns |
A non-empty |
Throws |
None. |
Get SAM T Num
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SAM transaction number. |
Returns |
An |
Throws |
None. |
Get SV T Num
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SV transaction number. |
Returns |
An |
Throws |
None. |
5.2.18. SV Load Log Record
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
1.0 |
Purpose |
One record of a Stored Value load log. |
Get Amount
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the load amount. |
Returns |
An |
Throws |
None. |
Get Balance
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SV balance after the load. |
Returns |
An |
Throws |
None. |
Get Free Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 2-byte free data. |
Returns |
A non-empty |
Throws |
None. |
Get KVC
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the KVC of the load key. |
Returns |
A |
Throws |
None. |
Get Load Date
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 2-byte load date. |
Returns |
A non-empty |
Throws |
None. |
Get Load Time
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 2-byte load time. |
Returns |
A non-empty |
Throws |
None. |
Get Raw Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the raw bytes of the load log record. |
Returns |
A non-empty |
Throws |
None. |
Get SAM ID
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the 4-byte SAM ID. |
Returns |
A non-empty |
Throws |
None. |
Get SAM T Num
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SAM transaction number. |
Returns |
An |
Throws |
None. |
Get SV T Num
Signature |
|
|---|---|
Since |
1.0 |
Description |
Returns the SV transaction number. |
Returns |
An |
Throws |
None. |
5.2.19. Symmetric Crypto Security Setting
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
2.0 |
Purpose |
Security setting carrier for symmetric-key Calypso card transactions (e.g. SAM-backed). An instance is obtained via |
Add Authorized Session Key
Signature |
|
|---|---|
Since |
2.0 |
Description |
Adds an authorised session key. Default: every key accepted; once at least one key is added, only listed keys are accepted. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Add Authorized SV Key
Signature |
|
|---|---|
Since |
2.0 |
Description |
Adds an authorised Stored Value (SV) key, identified by its KIF/KVC. Default: every SV key accepted; once at least one key is added, only listed keys are accepted. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign Default KIF
Signature |
|
|---|---|
Since |
2.0 |
Description |
Defines the default KIF for a write access level. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign Default KVC
Signature |
|
|---|---|
Since |
2.0 |
Description |
Defines the default KVC for a write access level. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign KIF
Signature |
|
|---|---|
Since |
2.0 |
Description |
Defines, for a write access level, the KIF to use when the card only provides a KVC. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign Open Secure Session Max Duration (All DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of an open secure session for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign Open Secure Session Max Duration (Per DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of an open secure session for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign SV Operation Max Duration (All DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of a Stored Value operation for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Assign SV Operation Max Duration (Per DF)
Signature |
|
|---|---|
Since |
3.0 |
Description |
Sets the maximum duration (in milliseconds) of a Stored Value operation for cards whose CSN is >= |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Authorize SV Negative Balance
Signature |
|
|---|---|
Since |
2.0 |
Description |
Allows the SV balance to become negative. Default: disabled. |
Returns |
The current instance ( |
Throws |
None. |
Disable Read On Session Opening
Signature |
|
|---|---|
Since |
2.0 |
Description |
Disables the automatic merging of Open Secure Session with a possible Read Record command. By default, the optimisation is performed; it may however be incompatible with the security requirements in some cases. |
Returns |
The current instance ( |
Throws |
None. |
Enable Multiple Session
Signature |
|
|---|---|
Since |
2.0 |
Description |
Enables multiple-session mode to handle more changes than the session buffer allows. |
Returns |
The current instance ( |
Throws |
None. |
Enable PIN Plain Transmission
Signature |
|
|---|---|
Since |
2.0 |
Description |
Enables the PIN transmission in plain text. |
Returns |
The current instance ( |
Throws |
None. |
Enable Ratification Mechanism
Signature |
|
|---|---|
Since |
2.0 |
Description |
Enables the ratification mechanism to handle early card removal preventing reception of the closing ACK. |
Returns |
The current instance ( |
Throws |
None. |
Enable SV Load And Debit Log
Signature |
|
|---|---|
Since |
2.0 |
Description |
Enables retrieval of both load and debit log records. Default: disabled. |
Returns |
The current instance ( |
Throws |
None. |
Init Crypto Context For Next Transaction
Signature |
|
|---|---|
Since |
2.0 |
Description |
Prepares the crypto module for the next transaction by anticipating the security context configuration. This feature is only useful when the currently allocated cryptographic module will be used for the next transaction. It is particularly relevant to optimise the transaction time in a ticketing context of user card validation. For the optimisation to be effective, this operation MUST be called at the very end of the current transaction, that is, after the user has been notified of the access right (e.g. after opening the gate). |
Throws |
|
Set PIN Modification Ciphering Key
Signature |
|
|---|---|
Since |
2.0 |
Description |
Sets the KIF/KVC of the PIN modification ciphering key. Default: 0/0. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set PIN Verification Ciphering Key
Signature |
|
|---|---|
Since |
2.0 |
Description |
Sets the KIF/KVC of the PIN verification ciphering key. Default: 0/0. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
|
|
5.2.20. Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Extends |
|
Since |
2.0 |
Purpose |
Common operations for every Calypso card transaction. Prepare/process model. The stereotype on |
TransactionManager defines the full prepare command surface (file selection, reads, writes, counters, PIN, asymmetric key-pair generation).
The preparation step makes it possible to group commands together in order to minimise network data exchanges,
which is especially useful in a distributed architecture.
The bound CalypsoCard is updated after each successful APDU exchange, and parameter ranges are validated as documented in Section 5.2.4.
Processing of prepared commands is inherited from CardTransactionManager (CNA-TR-API) via the
IsoCardTransactionManager stereotype.
The Calypso TransactionManager does not redefine processCommands(); it relies on the inherited contract.
Multi-channel operations (processCommandsAndCloseChannel, closeChannel) are reached on demand through asMultichannelCardTransactionManager() of CNA-TR-API when the underlying card supports multi-channel.
Every write operation MAY raise SessionBufferOverflowException if the command would overflow the modification buffer and the multiple-session mode is not allowed.
|
Get Secure Session Status
Signature |
|
|---|---|
Since |
3.0 |
Description |
Returns a |
Returns |
|
Throws |
None. |
Get Transaction Audit Data
Signature |
|
|---|---|
Since |
1.2 |
Description |
Returns the audit data of the transaction (every APDU exchange with the card and the crypto module). |
Returns |
A |
Throws |
None. |
Prepare Append Record
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds an Append Record command: a new record is added, and the oldest record is deleted in a cyclic file. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Change PIN
Signature |
|
|---|---|
Since |
1.6 |
Description |
Adds a Change PIN command. It MUST be performed outside a secure session. If transmitted plain, the command
MUST be preceded by a successful Verify PIN. Once processed, the PIN status is available in the
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Check PIN Status
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Verify PIN command without PIN presentation, in order to read the attempt counter. Once processed, the
PIN status is available in the |
Returns |
The current instance ( |
Throws |
|
Prepare Decrease Counter
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Decrease command, which subtracts the supplied value from the designated counter of the selected EF.
If several counters of the same file have to be decremented at the same time of the transaction, it is
RECOMMENDED to use Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Decrease Counters
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Decrease Multiple command, or multiple Decrease commands. The decision to execute one or the other is made according to the type of card. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Generate Asymmetric Key Pair
Signature |
|
|---|---|
Since |
2.1 |
Description |
Adds a Generate Asymmetric Key Pair command. The public part can be retrieved via |
Returns |
The current instance ( |
Throws |
None. |
Prepare Get Data
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds one or more Get Data commands. Security warning: this command MUST NOT be used within a secure session, in both contact and contactless modes. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Increase Counter
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds an Increase command. If several counters of the same file have to be incremented at the same time of the
transaction, it is RECOMMENDED to use
Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Increase Counters
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds an Increase Multiple command, or multiple Increase commands. The decision to execute one or the other is made according to the type of card. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Put Data
Signature |
|
|---|---|
Since |
2.1 |
Description |
Adds one or more Put Data commands. MUST be called outside a secure session. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Binary
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds Read Binary commands. Depending on whether the command is placed inside a secure session, two behaviours apply. Outside a secure
session (best-effort mode), the following Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Counter
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Read Records command targeting the supplied counter. The record is read up to the counter location supplied as parameter, so all preceding counters are also read. Depending on whether the command is placed inside a secure session, two behaviours apply. Outside a secure
session (best-effort mode), the following Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Record
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Read Records command for a single record. Security warning: this command MUST NOT be used within a secure session, in both contact and contactless
modes. For the in-session case, use
Once processed, the data is available in the The following |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Records
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Read Records command for one or more records. Depending on whether the command is placed inside a secure session, two behaviours apply. Outside a secure
session (best-effort mode), the following Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read Records Partially
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds Read Record Multiple commands. Security warning: this command MUST NOT be used within a secure session, in both contact and contactless modes. The following Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Search Records
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Search Record Multiple command. The command searches whether the supplied data are present in the records of the file; an optional mask MAY be applied to specify precisely the bits to take into account in the comparison. It is only possible with a linear, cyclic, Counters or Simulated Counter EF. Security warning: this command MUST NOT be used within a secure session, in both contact and contactless modes. Once processed, the result is available in the supplied input/output
The following |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
Prepare Select File (LID)
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds a Select File command targeting an EF by LID. Caution: the command fails if the selected file is not an EF. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Select File (Select Control)
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Select File command using a navigation control. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Set Counter
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds either an Increase or a Decrease command to set the counter to the supplied value. The operation is selected according to whether the difference between the current value and the desired value is negative (Increase) or positive (Decrease). Two assumptions are made, and neither is checked by this operation: the counter value has been read beforehand, and the type of session — and its associated access rights — is consistent with the requested operation (a reload session if the counter is to be incremented, a debit session if it is to be decremented). An inconsistency is only detected when the session is closed. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare SV Read All Logs
Signature |
|
|---|---|
Since |
1.0 |
Description |
Schedules the reading of every Stored Value log, that is, both the load and the debit log records. This
operation requires the selected application to be of type Store Value (file structure The SV transaction logs are contained in two files with fixed identifiers: the file whose SFI is Once processed, the data is available in the |
Returns |
The current instance ( |
Throws |
|
Prepare Update Binary
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds one or more Update Binary commands. The data of the file before the offset and after the supplied data are left unchanged. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Update Record
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds an Update Record command. Bytes beyond Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Verify PIN
Signature |
|
|---|---|
Since |
1.6 |
Description |
Adds a Verify PIN command. This command MAY be performed both inside and outside a secure session. The PIN
code is transmitted in plain text or enciphered, according to the parameter set in the
Once processed, the PIN status is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Write Binary
Signature |
|
|---|---|
Since |
1.1 |
Description |
Adds one or more Write Binary commands, performing a binary OR with the existing data. The data of the file before the offset and after the supplied data are left unchanged. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Write Record
Signature |
|
|---|---|
Since |
1.0 |
Description |
Adds a Write Record command, performing a binary OR with the existing data. Once processed, the data is available in the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.3. SPI Interfaces
5.3.1. Asymmetric Crypto Card Transaction Manager Factory
Name |
|
|---|---|
Kind |
Marker interface (SPI) |
Namespace |
|
Since |
2.0 |
Purpose |
Marker provided by crypto extensions to secure Calypso card transactions with asymmetric keys (PKI). Declares no operation. |
5.3.2. Card Transaction Crypto Extension
Name |
|
|---|---|
Kind |
Marker interface (SPI) |
Namespace |
|
Since |
2.0 |
Purpose |
Marker enriching the card transaction command set with specific crypto commands (e.g. signature computation/verification). Declares no operation at the API level. |
5.3.3. PCA Certificate
Name |
|
|---|---|
Kind |
Marker interfaces (SPI) |
Namespace |
|
Since |
2.1 |
Purpose |
Markers for PCA, CA and card certificates exposed by CNA-TCCA-API extensions. |
PcaCertificate, CaCertificate and CardCertificate declare no operation at the API level.
Their concrete content is exposed through the CNA-TCCA-API extension that produced them.
5.3.4. PCA Certificate Parser
Name |
|
|---|---|
Kind |
Marker interfaces (SPI) |
Namespace |
|
Since |
2.1 |
Purpose |
Markers for CA and card certificate parsers exposed by CNA-TCCA-API extensions. Used by |
5.3.5. Symmetric Crypto Card Transaction Manager Factory
Name |
|
|---|---|
Kind |
Marker interface (SPI) |
Namespace |
|
Since |
2.0 |
Purpose |
Marker provided by crypto extensions to secure Calypso card transactions with symmetric keys (e.g. SAM). Declares no operation. |
5.4. Enumerations
5.4.1. Calypso Card Product Type
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Product type of a Calypso card. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
Calypso Prime revision 1.x. |
|
1.0 |
Calypso Prime revision 2.x. |
|
1.0 |
Calypso Prime revision 3.x. |
|
1.0 |
Calypso Light. |
|
1.0 |
Calypso Basic. |
|
1.0 |
Application Type is |
5.4.2. Elementary File Type
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Type of a Calypso Elementary File. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
Linear EF (1 to several records). |
|
1.0 |
Binary EF (single continuous sequence of data bytes). |
|
1.0 |
Cyclic EF (records organised in a cycle, from the most recent to the oldest). |
|
1.0 |
Counters EF (single record containing K counters of three bytes each). |
|
1.0 |
Simulated counter EF (linear file with a single record, kept for Calypso Rev 2 compatibility). |
5.4.3. Get Data Tag
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Output data tags retrievable through the Get Data command. MAY NOT be applicable to all products. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
FCP for the current file, as returned by Select File. |
|
1.0 |
FCI for the current DF, as returned by Select Application. |
|
1.1 |
List of EFs in the current DF. |
|
1.1 |
Product traceability information. |
|
2.1 |
Card public key. |
|
2.1 |
Card certificate. |
|
2.1 |
CA certificate. |
5.4.4. Put Data Tag
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
2.1 |
Purpose |
Input data tags injectable through the Put Data command. MAY NOT be applicable to all products. |
| Value | Since | Description |
|---|---|---|
|
2.1 |
Card key pair. |
|
2.1 |
Card certificate. |
|
2.1 |
CA certificate. |
5.4.5. Secure Session Type
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
3.0 |
Purpose |
Cryptographic nature of a Calypso secure session. |
| Value | Since | Description |
|---|---|---|
|
3.0 |
PSO/SAM sessions, Regular and Extended modes. |
|
3.0 |
PKI mode. |
This enumeration reflects the cryptographic nature of the session and not the application mode
(Regular / Extended).
Both symmetric modes share the same underlying cryptography and only differ in their configuration at the TransactionManager level; the integrator who needs to know the application mode obtains it directly via the sub-type of TransactionManager that has been instantiated.
|
5.4.6. Select File Control
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Expected behaviour of the Select File command (cf. ISO/IEC 7816-4 and Calypso specifications). |
| Value | Since | Description |
|---|---|---|
|
1.0 |
The first EF of the current Calypso DF. |
|
1.0 |
The next EF of the current Calypso DF. |
|
1.0 |
The current Calypso DF. |
5.4.7. SV Action
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Direction of an SV action. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
In a |
|
1.0 |
In a |
5.4.8. SV Operation
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Type of Stored Value operation. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
Increase the SV balance. |
|
1.0 |
Decrease the SV balance. |
5.4.9. Write Access Level
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
1.0 |
Purpose |
Write access level for a Calypso secure session. Each level induces the use of a different session-key role. |
| Value | Since | Description |
|---|---|---|
|
1.0 |
Personalisation, load and debit operations — uses the issuer key. |
|
1.0 |
Load and debit operations — uses the load key. |
|
1.0 |
Debit operations only — uses the debit key. |
5.5. Exceptions
5.5.1. Card Signature Not Verifiable Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.2 |
Purpose |
Indicates that the card has correctly closed the secure session but that the authenticity of the session cannot be verified because the crypto module is no longer available (timeout, network problem, etc.). |
5.5.2. Crypto Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
2.0 |
Purpose |
Indicates that an error occurred when computing a crypto operation. |
5.5.3. Crypto IO Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
2.0 |
Purpose |
Indicates a communication error with the crypto module. |
5.5.4. Inconsistent Data Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.2 |
Purpose |
Indicates the detection of inconsistent data. |
The inconsistency falls into one of the following cases:
-
a de-synchronisation of the APDU exchanges, that is, a number of APDU responses different from the number of APDU requests;
-
an inconsistency in the card data, which can happen for example when the data read outside the secure session differs from the data read inside it.
5.5.5. Invalid Card Signature Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.2 |
Purpose |
Indicates that the card signature is incorrect. For a transaction secured by symmetric cryptography (e.g. SAM), this indicates that the card has correctly
closed the secure session, but that the card session is not authentic because the MAC it produced is wrong.
This typically happens when the Digest Authenticate or SV Check status word is For a transaction secured by asymmetric cryptography (e.g. PKI), this indicates only that the card signature is incorrect. |
5.5.6. Invalid Certificate Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
2.1 |
Purpose |
Indicates that a certificate failed validation (signature, validity period, issuer or subject details, constraints, extensions, expiration, revocation). |
5.5.7. Invalid PIN Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
2.0 |
Purpose |
Indicates that the provided PIN is invalid. |
5.5.8. Select File Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.4 |
Purpose |
Indicates that file selection failed because the file was not found (status word |
5.5.9. Session Buffer Overflow Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.2 |
Purpose |
Indicates that the secure session cannot be performed atomically because the modification buffer capacity is insufficient. |
5.5.10. Unauthorized Key Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
1.0 |
Purpose |
Indicates that the card requires an unauthorised session key. |