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 Crypto Legacy SAM 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 Crypto Legacy SAM API MUST satisfy.
The Terminal Calypso Crypto Legacy SAM API exposes the abstractions required to operate Calypso Legacy SAM products (SAM C1, HSM C1, S1E1, S1Dx). It is the symmetric counterpart of the Terminal Calypso Crypto Symmetric API (CNA-TCCS-API) for the specific case where the crypto module is a legacy Calypso SAM.
Document Status
Reference |
YYMMDD-SP-CNATerminalAPI-CalypsoCryptoLegacySAM |
|---|---|
Short name |
CNA-TCCL-API |
Version |
2.0.0-SNAPSHOT |
Revision date |
2026-07-20 |
Editor |
Calypso Networks Association |
Source repository |
https://github.com/calypsonet/calypsonet-terminal-calypso-crypto-legacysam-uml-api |
Reference license |
Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0) |
| The present document specifies the 2.0.0-SNAPSHOT of the Terminal Calypso Crypto Legacy SAM 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 |
|---|---|
v2.0.0-SNAPSHOT |
Baseline. |
2. Introduction
2.1. Purpose
The Terminal Calypso Crypto Legacy SAM API defines the public surface used by terminal applications and card-transaction managers to:
-
select, unlock and identify a Legacy SAM;
-
read SAM parameters, system keys, work keys and event counters;
-
write counter ceilings and configurations (with or without a control SAM);
-
compute and verify basic and traceable signatures using SAM keys;
-
perform PKI-related operations on the SAM: key-pair generation, card-certificate computation, lock-file transfer/write;
-
operate asynchronous write transactions through a create/execute split;
-
enrich a Calypso card transaction with SAM-backed crypto operations through a card-transaction extension.
The API spans three categories of transaction managers:
| Manager family | Purpose |
|---|---|
|
Operations on the SAM without involving a control SAM — the typical "read" workflow plus signature computation and verification. |
|
Synchronous write operations on the SAM, requiring a control SAM to authorise the key/lock transfers. |
|
Two-step asynchronous write workflow: the creator prepares the command stream using a control SAM, the executor replays it on the target SAM. |
2.2. Scope
This specification covers:
-
the SAM data model (
LegacySam,SamParameters,KeyParameter); -
the selection extension used to enrich a Calypso reader selection with SAM-specific commands;
-
the transaction managers, signature data carriers, key-pair and certificate computation data carriers;
-
the security setting carrier and the card-transaction crypto extension;
-
the SPIs implemented by the application to provide unlock data and revocation information;
-
the exceptions raised by the transaction managers.
The following topics are out of scope:
-
the on-the-wire APDU dialog with the SAM (handled internally by implementations),
-
the algorithms used by the SAM to derive keys or sign data,
-
the storage of certificates and key parameters outside the SAM.
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 32-bit integer. |
|
|
Ordered sequence of octets. |
|
|
Calendar date without a time-of-day or timezone. |
|
|
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 Card (SP-CNATerminalAPI-CalypsoCard), version 3.0, Calypso Networks Association. |
|
CNA Terminal API — Calypso Crypto Symmetric (SP-CNATerminalAPI-CalypsoCryptoSymmetric), version 0.1, 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 |
|---|---|
SAM |
Secure Application Module — a tamper-resistant cryptographic module used to perform Calypso operations. |
Legacy SAM |
A SAM compliant with the original Calypso SAM specifications (SAM C1, HSM C1, S1E1, S1Dx). |
Control SAM |
SAM used to authorise sensitive operations on a target SAM (e.g. key transfer). |
Target SAM |
SAM on which the operations are applied. |
System Key |
Key dedicated to the management of the SAM itself (personalisation, key management, reloading, authentication). |
Work Key |
Key used for application-level cryptographic operations. |
Event Counter |
Numeric counter managed by the SAM, typically used to track the usage of a work key. |
Counter Ceiling |
Maximum value an event counter is allowed to reach before being considered exhausted. |
Unlock Data |
Secret value required to unlock a locked SAM. Can be static or dynamic. |
Lock File |
SAM file controlling whether the SAM is locked or unlocked. |
SAM Traceability |
Mode in which the signature embeds the signing SAM serial number and the value of the counter associated with the signing key. |
Busy Mode |
Defensive mode that rate-limits repeated "PSO Verify Signature" attempts after a failure. |
3.2. Acronyms
| Abbreviation | Expansion |
|---|---|
AID |
Application IDentifier |
APDU |
Application Protocol Data Unit |
CA |
Certification Authority |
CNA |
Calypso Networks Association |
HSM |
Hardware Security Module |
KIF |
Key Identifier |
KVC |
Key Version Code |
PKI |
Public Key Infrastructure |
PSO |
Perform Security Operation (ISO/IEC 7816-8 command class) |
SAM |
Secure Application Module |
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 and shared enumerations (system key types, counter increment access, GetData tags). |
|
Public API |
SAM data model: |
|
SPI |
Application-implemented SPIs for unlock data computation and SAM revocation. |
|
Public API |
Transaction managers, signature/key/certificate data carriers, security setting, traceability mode and exceptions. |
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. Legacy SAM API Properties
Name |
|
|---|---|
Kind |
Final class |
Namespace |
|
Since |
0.1 |
Purpose |
Exposes the immutable properties of the Terminal Calypso Crypto Legacy SAM API. |
Constants
| Name | Type | Since | Description |
|---|---|---|---|
|
|
0.1 |
String representation of the version of the API (e.g. |
5.2. API Interfaces
5.2.1. Async Transaction Creator Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.2 |
Purpose |
Prepares write commands using a control SAM and exports them as a serialised stream for later replay by an |
See also |
Export Commands
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns a non-empty |
Returns |
A non-empty |
Throws |
None. |
5.2.2. Async Transaction Executor Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.2 |
Purpose |
Executes a command stream prepared by an |
See also |
5.2.3. Basic Signature Computation Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Specialisation for basic signature computation using the Data Cipher command. An instance is obtained via |
BasicSignatureComputationData declares no additional operation.
5.2.4. Basic Signature Verification Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Specialisation for basic signature verification using the Data Cipher command. An instance is obtained via |
BasicSignatureVerificationData declares no additional operation.
5.2.5. Card Transaction Legacy SAM Extension
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.3 |
Purpose |
Card-transaction crypto extension enriching the CNA-TCC-API command set with SAM-backed signature computation
and verification. Instances are obtained through |
Prepare Compute Signature
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the execution of a Data Cipher or PSO Compute Signature command in the context of a Calypso card
transaction. Once the command is processed, the result is available in the supplied input/output
The signature serves many purposes, for example:
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
|
Prepare Verify Signature
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the execution of a Data Cipher or PSO Verify Signature command in the context of a Calypso card
transaction. Once processed, the result is available in the supplied input/output
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
|
5.2.6. Free Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Transaction manager used when no control SAM is involved. An instance is obtained via |
Export Target SAM Context For Async Transaction
Signature |
|
|---|---|
Since |
0.2 |
Description |
Executes the commands required to obtain the security context of the target SAM. The returned |
Returns |
A non-empty |
Throws |
None. |
Prepare Compute Card Certificate
Signature |
|
|---|---|
Since |
0.5 |
Description |
Schedules the execution of a PSO Compute Certificate command. The result is written into the supplied data carrier. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
See also |
|
Prepare Compute Signature
Signature |
|
|---|---|
Since |
0.1 |
Description |
Schedules the execution of a Data Cipher or PSO Compute Signature command. Once the command is processed,
the result is available in the supplied input/output
The signature serves many purposes, for example:
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
|
Prepare Generate Card Asymmetric Key Pair
Signature |
|
|---|---|
Since |
0.5 |
Description |
Schedules the execution of a Card Generate Asymmetric Key Pair command. The result is written into the supplied container. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
See also |
Prepare Get Data
Signature |
|
|---|---|
Since |
0.5 |
Description |
Schedules the execution of a Get Data command for the supplied tag. Once processed, the data is accessible
through the dedicated getters of the |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Plain Write Lock
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules the execution of a Write Key command to set the lock file of the SAM. The lock value is transferred in plain text. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Verify Signature
Signature |
|
|---|---|
Since |
0.1 |
Description |
Schedules the execution of a Data Cipher or PSO Verify Signature command. Once processed, the result is
available in the supplied input/output
|
Parameters |
|
Returns |
The current instance ( |
Throws |
|
See also |
|
5.2.7. Key Pair Container
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.5 |
Purpose |
Carries the input/output data of |
Get Key Pair
Signature |
|
|---|---|
Since |
0.5 |
Description |
Returns the generated key pair as a 96-byte |
Returns |
A non-empty |
Throws |
None. |
5.2.8. Key Parameter
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.2 |
Purpose |
Carries the parameters of a key managed by the SAM (system or work key). |
Get Algorithm
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the key algorithm identifier byte. |
Returns |
A |
Throws |
None. |
Get KIF
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the key identifier (KIF). |
Returns |
A |
Throws |
None. |
Get KVC
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the key version (KVC). |
Returns |
A |
Throws |
None. |
Get Parameter Value
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the value of the parameter whose number is supplied. |
Parameters |
|
Returns |
A |
Throws |
|
Get Raw Data
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the raw key parameter data: 13 bytes carrying KIF, KVC, algorithm and PAR1..PAR10. |
Returns |
A non-empty |
Throws |
None. |
5.2.9. Legacy Card Certificate Computation Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.5 |
Purpose |
Carries the input/output data of |
Get Certificate
Signature |
|
|---|---|
Since |
0.5 |
Description |
Returns the 316-byte certificate generated by the SAM, or |
Returns |
A non-empty |
Throws |
None. |
Set Card AID
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the AID of the autonomous PKI application of the target card. The AID MUST be 5 to 16 bytes and MUST NOT contain only zero bytes. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Card Public Key
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the card public key (64 bytes, secp256r1 curve). This key is used for the verification of card signatures. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Card Serial Number
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the 8-byte card serial number. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Card Startup Info
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the 7-byte startup info to embed in the certificate. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set End Date
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the end of the validity period. The end date is optional: when it is not defined, the certificate is not subject to an end date constraint. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Start Date
Signature |
|
|---|---|
Since |
0.5 |
Description |
Sets the start of the validity period. The start date is optional: when it is not defined, the certificate is not subject to a start date constraint. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.10. Legacy SAM
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Dynamic view of a legacy SAM, updated from selection to the end of the transaction. |
A LegacySam instance is obtained by casting the CNA-TR-API SmartCard produced by the selection scenario
when the selection extension was a LegacySamSelectionExtension.
As a dynamic view of the SAM image, a LegacySam is updated after every successful command processed by a
synchronous transaction manager; asynchronous write managers do not update the local LegacySam.
Get Application Sub Type
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the application subtype byte. |
Returns |
A |
Throws |
None. |
Get Application Type
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the application type byte. |
Returns |
A |
Throws |
None. |
Get CA Certificate
Signature |
|
|---|---|
Since |
0.5 |
Description |
Returns the CA certificate retrieved from the SAM (384 bytes); |
Returns |
A non-empty |
Throws |
None. |
See also |
|
Get Counter
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the value of the supplied counter ( |
Parameters |
|
Returns |
An |
Throws |
None. |
See also |
Get Counter Ceiling
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the ceiling value of the supplied counter; |
Parameters |
|
Returns |
An |
Throws |
None. |
See also |
Get Counter Ceilings
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the known ceiling values, keyed by ceiling number. |
Returns |
A |
Throws |
None. |
See also |
Get Counter Increment Access
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the increment-access mode for the supplied counter; |
Parameters |
|
Returns |
A |
Throws |
None. |
See also |
Get Counters
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the values of the known counters, keyed by counter number. |
Returns |
A |
Throws |
None. |
See also |
Get Platform
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the platform identifier byte. |
Returns |
A |
Throws |
None. |
Get Product Info
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns a textual description of the SAM. |
Returns |
A non-empty |
Throws |
None. |
Get Product Type
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the SAM product type. Possible values: |
Returns |
A |
Throws |
None. |
Get SAM Parameters
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the SAM parameters; |
Returns |
A |
Throws |
None. |
See also |
Get Serial Number
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the SAM serial number. |
Returns |
A non-empty |
Throws |
None. |
Get Software Issuer
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software issuer identifier. |
Returns |
A |
Throws |
None. |
Get Software Revision
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software revision number. |
Returns |
A |
Throws |
None. |
Get Software Version
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software version number. |
Returns |
A |
Throws |
None. |
Get System Key Parameter
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the parameters of the supplied system key; |
Parameters |
|
Returns |
A |
Throws |
None. |
See also |
Get Work Key Parameter (KIF)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the parameters of the work key referenced by its KIF/KVC pair; |
Parameters |
|
Returns |
A |
Throws |
None. |
See also |
|
Get Work Key Parameter (Record Number)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the parameters of the work key at the supplied record number ( |
Parameters |
|
Returns |
A |
Throws |
|
See also |
|
5.2.11. Legacy SAM API Factory
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.3 |
Purpose |
Factory used by the application to obtain instances of every public type provided by the API. |
Create Async Transaction Creator Manager
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Throws |
|
Create Async Transaction Executor Manager
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Throws |
|
Create Basic Signature Computation Data
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Basic Signature Verification Data
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Free Transaction Manager
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Throws |
|
Create Key Pair Container
Signature |
|
|---|---|
Since |
0.5 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Legacy Card Certificate Computation Data
Signature |
|
|---|---|
Since |
0.5 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Legacy SAM Selection Extension
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates a |
Returns |
|
Throws |
None. |
Create Secure Write Transaction Manager
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Throws |
|
Create Security Setting
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates a |
Returns |
|
Throws |
None. |
Create Symmetric Crypto Card Transaction Manager Factory
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new factory of CNA-TCCS-API |
Parameters |
|
Returns |
A |
Throws |
|
Create Traceable Signature Computation Data
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
Create Traceable Signature Verification Data
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates an empty |
Returns |
|
Throws |
None. |
5.2.12. Legacy SAM Selection Extension
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.3 |
Purpose |
Enriches the CNA-TR-API selection scenario with SAM-specific commands (Unlock, Read Parameters, etc.). An instance is obtained via |
If the SAM is locked, three mutually exclusive unlocking strategies are offered:
-
The application supplies directly the 16-byte unlock value expected by the SAM (static mode) — see
setUnlockData. -
The application supplies a
LegacySamStaticUnlockDataProviderSpito compute the unlock value (possibly diversified with the SAM serial number). -
The application supplies a
LegacySamDynamicUnlockDataProviderSpito obtain the 8-byte value expected by the SAM in dynamic mode (computed by an origin SAM).
When the unlocking data is supplied by a provider, a CNA-TR-API CardReader is required for additional
exchanges. The reader MAY be provided either at selection-extension creation time, or later through the relevant
overload (e.g. dynamic SAM reader allocation).
Prepare Get Data
Signature |
|
|---|---|
Since |
0.6 |
Description |
Schedules the execution of a Get Data command for the supplied tag. The result is accessible via a dedicated getter (e.g. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Read All Counters Status
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the reading of the status of every counter. |
Returns |
The current instance ( |
Throws |
None. |
Prepare Read Counter Status
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the execution of Read Event Counter and Read Ceiling commands to read the status of the supplied
counter ( |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Read SAM Parameters
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules the execution of a Read Parameters command. The result is available via |
Returns |
The current instance ( |
Throws |
None. |
Prepare Read System Key Parameters
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the execution of a Read Key Parameters command for the supplied system key. The result is available via |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Read Work Key Parameters (KIF)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules the execution of a Read Key Parameters command for the work key referenced by its KIF/KVC pair.
Once processed, the result is accessible through
|
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Read Work Key Parameters (Record Number)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules the execution of a Read Key Parameters command for the work key at the supplied record number
( |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Dynamic Unlock Data Provider (No Target SAM Reader)
Signature |
|
|---|---|
Since |
0.4 |
Description |
Sets the dynamic-unlock-data provider. This overload is used when the card reader needed to communicate with the target SAM is supplied later in the workflow. The Unlock command is initiated after a successful filtering, followed by a request to the provider. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Dynamic Unlock Data Provider (Target SAM Reader)
Signature |
|
|---|---|
Since |
0.4 |
Description |
Sets the dynamic-unlock-data provider, with the target SAM reader supplied at creation time. The Unlock command is initiated after a successful filtering, followed by a request to the provider. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Static Unlock Data Provider (No Target SAM Reader)
Signature |
|
|---|---|
Since |
0.4 |
Description |
Sets the static-unlock-data provider. To be used when the SAM reader is supplied later in the workflow. The Unlock command is initiated after a successful filtering, followed by a request to the provider. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Static Unlock Data Provider (Target SAM Reader)
Signature |
|
|---|---|
Since |
0.4 |
Description |
Sets the static-unlock-data provider, with the target SAM reader supplied at creation time. The Unlock command is initiated after a successful filtering, followed by a request to the provider. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Unlock Data (No Product Type)
Signature |
|
|---|---|
Since |
0.3 |
Description |
Sets the unlock data (8 or 16 bytes, supplied as a 32-character hexadecimal |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Set Unlock Data (Product Type)
Signature |
|
|---|---|
Since |
0.3 |
Description |
Sets the unlock data (8 or 16 bytes, supplied as a 32-character hexadecimal |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.2.13. Read Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Extends |
|
Since |
0.1 |
Purpose |
Adds read-oriented operations to the common transaction manager: SAM parameters, system/work keys and counter status. |
The operations on this interface mirror their equivalents on
LegacySamSelectionExtension. prepareReadSamParameters,
prepareReadSystemKeyParameters, prepareReadWorkKeyParameters (both overloads), prepareReadCounterStatus and
prepareReadAllCountersStatus behaves identically.
5.2.14. SAM Parameters
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.7 |
Purpose |
Carries the parameters of the SAM as a single immutable record. |
Get Raw Data
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the raw data of the SAM parameters as a 29-byte array. |
Returns |
A non-empty |
Throws |
None. |
5.2.15. Secure Write Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.7 |
Purpose |
Synchronous write transaction manager that requires a control SAM. Used to write SAM parameters, transfer keys and transfer lock files. An instance is obtained via |
Prepare Plain Write Lock
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command to set the lock file with a plain-text 16-byte lock value. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Transfer Lock
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a lock file from the control SAM to the target SAM. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Transfer Lock Diversified
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a lock file from the control SAM to the target SAM, with diversification by the target SAM serial number. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Transfer System Key
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a system key from the control SAM to the target SAM. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Transfer System Key Diversified
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a system key from the control SAM to the target SAM, with the key first diversified with the target SAM serial number. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Transfer Work Key
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a work key from the control SAM to the target SAM. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Transfer Work Key Diversified (Diversifier)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a work key from the control SAM to the target SAM, with
diversification by the supplied 8-byte diversifier. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Transfer Work Key Diversified (No Diversifier)
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Key command transferring a work key from the control SAM to the target SAM, with
diversification by the target SAM serial number. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Prepare Write SAM Parameters
Signature |
|
|---|---|
Since |
0.7 |
Description |
Schedules a Write Parameters command. The supplied buffer MUST be 29 bytes long. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.2.16. Security Setting
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Since |
0.2 |
Purpose |
Security setting carrier for legacy-SAM transactions secured by a control SAM. An instance is obtained via |
Set Control SAM Resource
Signature |
|
|---|---|
Since |
0.2 |
Description |
Sets the control SAM and the reader through which it can be accessed. |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.2.17. Signature Computation Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Since |
0.1 |
Purpose |
Common base contract for the input/output data of a signature computation. |
Get Signature
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the computed signature (1 to 8 bytes). |
Returns |
A non-empty |
Throws |
|
Set Data
Signature |
|
|---|---|
Since |
0.1 |
Description |
Sets the data to sign and the KIF/KVC of the key. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Key Diversifier
Signature |
|
|---|---|
Since |
0.1 |
Description |
Sets an explicit 1-to-8-byte key diversifier. By default, the diversifier is the full serial number of the target card or SAM. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Signature Size
Signature |
|
|---|---|
Since |
0.1 |
Description |
Sets the expected signature size in bytes ( |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.18. Signature Verification Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Since |
0.1 |
Purpose |
Common base contract for the input/output data of a signature verification. |
Is Signature Valid
Signature |
|
|---|---|
Since |
0.1 |
Description |
Indicates whether the signature is valid. |
Returns |
A |
Throws |
|
Set Data
Signature |
|
|---|---|
Since |
0.1 |
Description |
Sets the signed data, the signature and the KIF/KVC of the verification key. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Set Key Diversifier
Signature |
|
|---|---|
Since |
0.1 |
Description |
Sets an explicit 1-to-8-byte key diversifier. Default: full serial number of the target card or SAM. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
5.2.19. Traceable Signature Computation Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Specialisation for traceable signature computation using the PSO Compute Signature command. An instance is obtained via |
Get Signed Data
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the data that was actually signed. If SAM traceability mode was enabled, the returned data embeds the SAM traceability information. |
Returns |
A non-empty |
Throws |
|
With SAM Traceability Mode
Signature |
|
|---|---|
Since |
0.1 |
Description |
Enables the SAM traceability mode. The SAM replaces the bits after the supplied offset by its serial number (3 or 4 bytes) followed by the new value (3 bytes) of the counter associated with the signing key. The mode is disabled by default. |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
Without Busy Mode
Signature |
|
|---|---|
Since |
0.1 |
Description |
Disables the Busy mode. The Busy mode (enabled by default) rejects repeated PSO Verify Signature attempts for a few seconds after a failure. Keeping the Busy mode enabled is RECOMMENDED for security-sensitive flows. |
Returns |
The current instance ( |
Throws |
None. |
5.2.20. Traceable Signature Verification Data
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Specialisation for verifications performed with the PSO Verify Signature command. An instance is obtained via |
With SAM Traceability Mode
Signature |
|
|---|---|
Since |
0.1 |
Description |
Indicates that the signature was computed in SAM traceability mode. When |
Parameters |
|
Returns |
The current instance ( |
Throws |
None. |
See also |
Without Busy Mode
Signature |
|
|---|---|
Since |
0.1 |
Description |
Indicates that the signature was not computed in Busy mode. By default the signature is assumed to have been computed in Busy mode. When Busy mode is enabled, after a PSO Verify Signature fails because of an incorrect signature, the SAM rejects any further PSO Verify Signature command issued in Busy mode for a few seconds, answering with the busy status word. In that case the application SHOULD repeat the command until the SAM is no longer busy — the busy window lasts a few seconds and never more than ten. Note that after a reset of the SAM, PSO Verify Signature commands issued in Busy mode keep failing with the busy status until the end of the busy period. |
Returns |
The current instance ( |
Throws |
None. |
See also |
5.2.21. Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.1 |
Purpose |
Common base of every legacy-SAM transaction manager. Provides command processing for the SAM. |
The Legacy SAM TransactionManager is not generic; processing of prepared commands is inherited from
CardTransactionManager (CNA-TR-API) via the processCommands() operation. The Legacy SAM
TransactionManager does not redefine processCommands(); it relies on the inherited contract. Additional
failure modes specific to the SAM dialog MAY be reported through InvalidSignatureException (signature
verification failure) and InconsistentDataException (data inconsistency).
5.2.22. Write Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Generics |
|
Extends |
|
Since |
0.2 |
Purpose |
Common base of every write transaction manager. Writes MAY be performed synchronously or asynchronously. |
Prepare Write Counter Ceiling
Signature |
|
|---|---|
Since |
0.2 |
Description |
Schedules a Write Ceilings command for a single counter. The ceiling value MUST be a positive integer less
than or equal to Warning: in an asynchronous transaction, the content of the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
Prepare Write Counter Configuration
Signature |
|
|---|---|
Since |
0.2 |
Description |
Schedules a Write Ceilings command for a counter ceiling and its free-incrementation configuration. Because the command writes a full record of nine counters, the application MUST have first read the status of the counters of that record (or have called this method for each of the other eight counters of the same record), otherwise an exception is raised when processing the commands. Warning: in the case of an asynchronous transaction, the content of the |
Parameters |
|
Returns |
The current instance ( |
Throws |
|
5.3. SPI Interfaces
5.3.1. Legacy SAM Dynamic Unlock Data Provider SPI
Name |
|
|---|---|
Kind |
Interface (SPI) |
Namespace |
|
Since |
0.4 |
Purpose |
Interface that the application MUST implement to compute the dynamic unlock data expected by the SAM. |
Get Unlock Data
Signature |
|
|---|---|
Since |
0.4 |
Description |
Returns the dynamic unlock data computed by an origin SAM. The serial number and the challenge are required to prepare the SAM Generate Unlock command. |
Parameters |
|
Returns |
An 8-byte |
Throws |
None. |
5.3.2. Legacy SAM Revocation Service SPI
Name |
|
|---|---|
Kind |
Interface (SPI) |
Namespace |
|
Since |
0.1 |
Purpose |
Interface that the application MUST implement to check dynamically whether a SAM is revoked. |
Is SAM Revoked (Counter Value)
Signature |
|
|---|---|
Since |
0.1 |
Description |
Checks if the SAM with the supplied serial number and counter value is revoked. The supplied serial number MAY be complete (4 bytes) or partial (the 3 least significant bytes). |
Parameters |
|
Returns |
|
Throws |
None. |
Is SAM Revoked (No Counter Value)
Signature |
|
|---|---|
Since |
0.1 |
Description |
Checks if the SAM with the supplied serial number is revoked. The serial number MAY be complete (4 bytes) or partial (3 LSBytes). |
Parameters |
|
Returns |
|
Throws |
None. |
5.3.3. Legacy SAM Static Unlock Data Provider SPI
Name |
|
|---|---|
Kind |
Interface (SPI) |
Namespace |
|
Since |
0.4 |
Purpose |
Interface that the application MUST implement to compute the static unlock data expected by the target SAM. |
Get Unlock Data
Signature |
|
|---|---|
Since |
0.4 |
Description |
Returns the static unlock data expected by the target SAM. The serial number MAY be used as a diversifier. |
Parameters |
|
Returns |
A 16-byte |
Throws |
None. |
5.4. Enumerations
5.4.1. Counter Increment Access
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
0.3 |
Purpose |
Possible access rights for incrementing event counters using the Increment Counter command. |
| Value | Since | Description |
|---|---|---|
|
0.3 |
Enables the use of Increment Counter on the targeted event counter. |
|
0.3 |
Forbids the use of Increment Counter on the targeted event counter. |
5.4.2. Get Data Tag
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
0.5 |
Purpose |
Output data tags retrievable through the Get Data command. MAY NOT be applicable to all products. |
| Value | Since | Description |
|---|---|---|
|
0.5 |
CA Certificate (CACert). MAY be unavailable. |
5.4.3. Legacy SAM Product Type
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
0.1 |
Purpose |
Product type of a legacy SAM. |
| Value | Since | Description |
|---|---|---|
|
0.1 |
SAM C1. |
|
0.1 |
SAM C1 HSM. |
|
0.1 |
SAM S1E1. |
|
0.1 |
SAM S1Dx. |
|
0.1 |
Unidentified SAM. |
5.4.4. SAM Traceability Mode
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
0.3 |
Purpose |
SAM traceability mode used with traceable signature operations. |
| Value | Since | Description |
|---|---|---|
|
0.3 |
Full SAM serial number (4 bytes). |
|
0.3 |
Truncated SAM serial number (3 LSBytes). |
5.4.5. System Key Type
Name |
|
|---|---|
Kind |
Enumeration |
Namespace |
|
Since |
0.2 |
Purpose |
System key types of a legacy SAM. Each type corresponds to a specific role. |
| Value | Since | Description |
|---|---|---|
|
0.2 |
Personalisation key — deciphers and authorises the writing of parameters and system keys. |
|
0.2 |
Work-file key — deciphers and authorises the writing of work keys. |
|
0.2 |
Reloading key — deciphers and authorises the writing of counter ceilings. |
|
0.2 |
Authentication key — generates the signature of data read from the SAM. |
5.5. Exceptions
5.5.1. Inconsistent Data Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
0.1 |
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.2. Invalid Signature Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
0.1 |
Purpose |
Indicates that a signature is invalid. |
5.5.3. SAM Revoked Exception
Name |
|
|---|---|
Kind |
Runtime exception |
Namespace |
|
Since |
0.1 |
Purpose |
Indicates that the SAM is revoked. |