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 (using a notation inspired by the Kotlin language), the interfaces, classes, enumerations, errors, 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 |
261028-SP-CNATerminalAPI-CalypsoCryptoLegacySAM |
|---|---|
Short name |
CNA-TCCL-API |
Version |
2.0.0 |
Revision date |
2026-10-28 |
Editor |
Calypso Networks Association |
Source repository |
https://github.com/calypsonet/calypsonet-terminal-calypso-crypto-legacysam-api-spec |
Reference license |
Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0) |
| The present document specifies the 2.0.0 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 |
Initial edition of this document. |
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,KeyParameters); -
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 settings carrier and the card-transaction crypto extension;
-
the SPIs implemented by the application to provide unlock data and revocation information;
-
the errors 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 errors exclusively of the types defined in Section 5.6 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. Data types
The following type names, whose notation is inspired by the Kotlin language, are used in operation signatures and are mapped, in each binding, to the closest equivalent native type. Implementations MUST preserve the semantic intent rather than the syntactic form.
| 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. |
|
|
Value of any type, root of the type hierarchy. |
|
|
Nullable value: either a |
|
|
Absence of value, the alternative held by a nullable type. |
|
|
Own type of the receiver: a fluent operation returns the instance it was called on. |
|
|
Indicates that an operation returns no value. |
|
2.4.3. Type tables
Each interface, class, enumeration and error 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, error, etc.). |
Namespace |
The namespace in which the type is defined. |
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 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. |
Pre-conditions |
The conditions the caller MUST satisfy before invoking the operation, each prefixed by its nature. |
Errors |
A list of error conditions a correct caller must handle, each mapped to a specific error 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:
-
Pre-conditions. The Pre-conditions row states what the caller MUST guarantee before invoking the operation. Violating one is a contract error, never listed in the Errors row, which describes only the outcomes a correct caller must handle. Each entry is prefixed by its nature, which determines the error raised when the condition is not met:
-
Argument — an illegal argument error. Applies to any invalid argument, including values bounded by a card or SAM protocol.
-
Range — an index out of bounds error. Applies when the argument designates a position within a collection or memory image exposed by the API.
-
State — an illegal state error.
-
Capability — an unsupported operation error.
-
-
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 settings, traceability mode and errors. |
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. Constants
5.1.1. Legacy SAM API Properties
Name |
|
|---|---|
Kind |
Constants |
Namespace |
|
Since |
0.1 |
Purpose |
Exposes the immutable properties of the Terminal Calypso Crypto Legacy SAM API. |
| Name | Type | Since | Description |
|---|---|---|---|
|
|
0.1 |
String representation of the version of the API implemented by the conforming binding.
The value is a dotted decimal of the form |
5.2. Data
5.2.1. Basic Signature Computation Data
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Implements |
|
Since |
0.1 |
Purpose |
Criteria of a basic signature computation, performed by the Data Cipher command. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.1 |
Data to be signed. Non-empty. |
|
|
— |
0.1 |
KIF of the key used for the signature computation. |
|
|
— |
0.1 |
KVC of the key used for the signature computation. |
|
|
|
0.1 |
Expected signature size in bytes, in range |
|
|
|
0.1 |
Explicit 1-to-8-byte key diversifier. |
5.2.2. Basic Signature Verification Data
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Implements |
|
Since |
0.1 |
Purpose |
Criteria of a basic signature verification, performed by the Data Cipher command. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.1 |
Signed data. Non-empty. |
|
|
— |
0.1 |
Signature associated with the data. Non-empty. |
|
|
— |
0.1 |
KIF of the key used for the signature verification. |
|
|
— |
0.1 |
KVC of the key used for the signature verification. |
|
|
|
0.1 |
Explicit 1-to-8-byte key diversifier. |
5.2.3. Key Parameters
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Since |
0.7 |
Purpose |
Carries the parameters of a key managed by the SAM, system or work key. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.7 |
Key identifier (KIF). |
|
|
— |
0.7 |
Key version (KVC). |
|
|
— |
0.7 |
Key algorithm identifier byte. |
|
|
— |
0.7 |
Value of each parameter, indexed by parameter number. Contains one entry for every parameter number in range
|
5.2.4. Legacy Card Certificate Computation Data
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Since |
0.5 |
Purpose |
Criteria of a card certificate computation, performed by the PSO Compute Certificate command. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.5 |
64-byte public key of the target card, on the secp256r1 curve. |
|
|
— |
0.5 |
Date from which the certificate is valid. |
|
|
— |
0.5 |
Date after which the certificate is no longer valid. |
|
|
— |
0.5 |
AID of the autonomous PKI application of the target card, 5 to 16 bytes, not all zero. |
|
|
— |
0.5 |
8-byte serial number of the target card. |
|
|
— |
0.5 |
7-byte startup info to embed in the certificate. |
5.2.5. Legacy SAM Security Settings
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Since |
0.2 |
Purpose |
Security settings of a legacy-SAM transaction secured by a control SAM, built directly by the application. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.2 |
Reader through which the control SAM is accessed. |
|
— |
0.2 |
Control SAM used to secure the transaction. Its product type MUST NOT be |
5.2.6. Traceable Signature Computation Data
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Implements |
|
Since |
0.1 |
Purpose |
Criteria of a traceable signature computation, performed by the PSO Compute Signature command. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.1 |
Data to be signed. Non-empty. |
|
|
— |
0.1 |
KIF of the key used for the signature computation. |
|
|
— |
0.1 |
KVC of the key used for the signature computation. |
|
|
|
0.1 |
Expected signature size in bytes, in range |
|
|
|
0.1 |
Explicit 1-to-8-byte key diversifier. |
|
|
0.1 |
Traceability mode to apply. |
|
|
|
|
0.1 |
Bit offset at which the traceability information is inserted in the data to sign. Relevant only when
|
|
|
|
0.1 |
When true, the command is issued in Busy mode: after a failure the SAM rejects any further command of the same kind for a few seconds. Keeping it enabled is RECOMMENDED for security-sensitive flows. |
5.2.7. Traceable Signature Verification Data
Name |
|
|---|---|
Kind |
Data |
Namespace |
|
Implements |
|
Since |
0.1 |
Purpose |
Criteria of a traceable signature verification, performed by the PSO Verify Signature command. |
| Name | Type | Default | Since | Description |
|---|---|---|---|---|
|
|
— |
0.1 |
Signed data. Non-empty. |
|
|
— |
0.1 |
Signature associated with the data. Non-empty. |
|
|
— |
0.1 |
KIF of the key used for the signature verification. |
|
|
— |
0.1 |
KVC of the key used for the signature verification. |
|
|
|
0.1 |
Explicit 1-to-8-byte key diversifier. |
|
|
0.1 |
Traceability mode used when the signature was computed. |
|
|
|
|
0.1 |
Bit offset at which the traceability information is inserted in the data to sign. Relevant only when
|
|
|
0.1 |
Service used to check the revocation status of the signing SAM. |
|
|
|
|
0.1 |
When true, the command is issued in Busy mode: after a failure the SAM rejects any further command of the same kind for a few seconds. Keeping it enabled is RECOMMENDED for security-sensitive flows. |
5.3. API Interfaces
5.3.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 |
Pre-conditions |
None. |
Errors |
None. |
5.3.2. Async Transaction Executor Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
Extends |
|
Since |
0.2 |
Purpose |
Executes a command stream prepared by an |
See also |
5.3.3. 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 processed, the signature is available in the The signature serves many purposes, for example:
|
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
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 outcome is available in the |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
|
See also |
|
5.3.4. 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 |
Pre-conditions |
None. |
Errors |
None. |
Prepare Compute Card Certificate
Signature |
|
|---|---|
Since |
0.5 |
Description |
Schedules the execution of a PSO Compute Certificate command. Once processed, the certificate is
available in the |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Prepare Compute Signature
Signature |
|
|---|---|
Since |
0.1 |
Description |
Schedules the execution of a Data Cipher or PSO Compute Signature command. Once processed, the signature
is available in the The signature serves many purposes, for example:
|
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Prepare Generate Card Asymmetric Key Pair
Signature |
|
|---|---|
Since |
0.5 |
Description |
Schedules the execution of a Card Generate Asymmetric Key Pair command. Once processed, the key pair
is available in the |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Verify Signature
Signature |
|
|---|---|
Since |
0.1 |
Description |
Schedules the execution of a Data Cipher or PSO Verify Signature command. Once processed, the outcome
is available in the |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
|
See also |
|
5.3.5. 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 |
Pre-conditions |
None. |
Errors |
None. |
Get Application Type
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the application type byte. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
Get CA Certificate
Signature |
|
|---|---|
Since |
0.5 |
Description |
Returns the CA certificate retrieved from the SAM (384 bytes); |
Returns |
A non-empty |
Pre-conditions |
None. |
Errors |
None. |
See also |
|
Get Computed Card Certificate
Signature |
|
|---|---|
Since |
2.0 |
Description |
316-byte card certificate produced by the certificate computation prepared with this identifier. When several such commands share the same identifier, the value returned is that of the most recently processed one. |
Parameters |
|
Returns |
A non-empty |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Counter Ceilings
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the known ceiling values, keyed by ceiling number. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
See also |
Get Counter Increment Accesses
Signature |
|
|---|---|
Since |
2.0 |
Description |
Returns the known increment-access modes, keyed by counter number. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
See also |
Get Counters
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the values of the known counters, keyed by counter number. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
See also |
Get Key Pair
Signature |
|
|---|---|
Since |
2.0 |
Description |
96-byte key pair produced by the card asymmetric key pair generation prepared with this identifier. When several such commands share the same identifier, the value returned is that of the most recently processed one. |
Parameters |
|
Returns |
A non-empty |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Platform
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the platform identifier byte. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
Get Product Info
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns a textual description of the SAM. |
Returns |
A non-empty |
Pre-conditions |
None. |
Errors |
None. |
Get Product Type
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the SAM product type. Possible values: |
Returns |
|
Pre-conditions |
None. |
Errors |
None. |
Get SAM Parameters
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the raw data of the SAM parameters as a 29-byte array; |
Returns |
A non-empty |
Pre-conditions |
None. |
Errors |
None. |
See also |
Get Serial Number
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the SAM serial number. |
Returns |
A non-empty |
Pre-conditions |
None. |
Errors |
None. |
Get Signature
Signature |
|
|---|---|
Since |
2.0 |
Description |
Signature computed by the signature computation prepared with this identifier. When several such commands share the same identifier, the value returned is that of the most recently processed one. |
Parameters |
|
Returns |
A non-empty |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Signed Data
Signature |
|
|---|---|
Since |
2.0 |
Description |
Data actually signed by the traceable signature computation prepared with this identifier. When SAM traceability mode was enabled, it embeds the SAM traceability information. When several such commands share the same identifier, the value returned is that of the most recently processed one. |
Parameters |
|
Returns |
A non-empty |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Software Issuer
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software issuer identifier. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
Get Software Revision
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software revision number. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
Get Software Version
Signature |
|
|---|---|
Since |
0.1 |
Description |
Returns the software version number. |
Returns |
A |
Pre-conditions |
None. |
Errors |
None. |
Get System Key Parameters
Signature |
|
|---|---|
Since |
0.2 |
Description |
Returns the parameters of the supplied system key; |
Parameters |
|
Returns |
A |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Get System Key Parameters Raw Data
Signature |
|
|---|---|
Since |
2.0 |
Description |
Returns the raw parameters of the supplied system key: 13 bytes carrying KIF, KVC, algorithm and PAR1..PAR10; |
Parameters |
|
Returns |
The 13-byte raw key parameters, or |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Work Key Parameters By KIF KVC
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the parameters of the work key referenced by its KIF/KVC pair; |
Parameters |
|
Returns |
A |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Get Work Key Parameters By Record Number
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns the parameters of the work key at the supplied record number ( |
Parameters |
|
Returns |
A |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Get Work Key Parameters Raw Data By KIF KVC
Signature |
|
|---|---|
Since |
2.0 |
Description |
Returns the raw parameters of the work key referenced by its KIF/KVC pair: 13 bytes carrying KIF, KVC, algorithm and PAR1..PAR10; |
Parameters |
|
Returns |
The 13-byte raw key parameters, or |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Get Work Key Parameters Raw Data By Record Number
Signature |
|
|---|---|
Since |
2.0 |
Description |
Returns the raw parameters of the work key at the supplied record number ( |
Parameters |
|
Returns |
The 13-byte raw key parameters, or |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Is Signature Valid
Signature |
|
|---|---|
Since |
2.0 |
Description |
Outcome of the signature verification prepared with this identifier. When several such commands share the same identifier, the value returned is that of the most recently processed one. |
Parameters |
|
Returns |
A |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
5.3.6. 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 |
|
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Create Async Transaction Executor Manager
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Create Free Transaction Manager
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Create Legacy SAM Selection Extension
Signature |
|
|---|---|
Since |
0.3 |
Description |
Creates a |
Returns |
|
Pre-conditions |
None. |
Errors |
None. |
Create Secure Write Transaction Manager
Signature |
|
|---|---|
Since |
0.7 |
Description |
Returns a new |
Parameters |
|
Returns |
|
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Create Symmetric Crypto Card Transaction Manager Factory
Signature |
|
|---|---|
Since |
0.3 |
Description |
Returns a new factory of CNA-TCCS-API |
Parameters |
|
Returns |
A |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.3.7. 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 when using
setStaticUnlockDataProviderWithDeferredReader or setDynamicUnlockDataProviderWithDeferredReader (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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Read All Counters Status
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the reading of the status of every counter. |
Returns |
The current instance ( |
Pre-conditions |
None. |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
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 ( |
Pre-conditions |
None. |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Read Work Key Parameters By KIF KVC
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Read Work Key Parameters By 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Dynamic Unlock Data Provider
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Dynamic Unlock Data Provider With Deferred Reader
Signature |
|
|---|---|
Since |
0.4 |
Description |
Sets the dynamic-unlock-data provider. To be 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Static Unlock Data Provider
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Static Unlock Data Provider With Deferred 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Unlock Data
Signature |
|
|---|---|
Since |
0.3 |
Description |
Sets the unlock data (8 or 16 bytes, supplied as a 32-character hexadecimal |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Set Unlock Data For 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.3.8. Read Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
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, which make the same readings available during the
selection.
Prepare Read All Counters Status
Signature |
|
|---|---|
Since |
0.3 |
Description |
Schedules the reading of the status of every counter. |
Returns |
The current instance ( |
Pre-conditions |
None. |
Errors |
None. |
See also |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
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 ( |
Pre-conditions |
None. |
Errors |
None. |
See also |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
Prepare Read Work Key Parameters By KIF KVC
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
Prepare Read Work Key Parameters By 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
See also |
|
5.3.9. 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Transfer Work Key Diversified
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
Prepare Transfer Work Key Diversified With Specific 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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.3.10. Signature Computation Data
Name |
|
|---|---|
Kind |
Sealed interface |
Namespace |
|
Since |
0.1 |
Purpose |
Common supertype of the signature computation criteria. Carries no member; it exists to let an operation accept either form. |
Its permitted implementations are BasicSignatureComputationData and
TraceableSignatureComputationData, which carry the criteria of the two command families.
5.3.11. Signature Verification Data
Name |
|
|---|---|
Kind |
Sealed interface |
Namespace |
|
Since |
0.1 |
Purpose |
Common supertype of the signature verification criteria. Carries no member; it exists to let an operation accept either form. |
Its permitted implementations are BasicSignatureVerificationData and
TraceableSignatureVerificationData, which carry the criteria of the two command families.
5.3.12. 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 InvalidSignature (signature
verification failure) and InconsistentData (data inconsistency).
5.3.13. Write Transaction Manager
Name |
|
|---|---|
Kind |
Interface |
Namespace |
|
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 ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
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 error is raised when processing the commands. Warning: in the case of an asynchronous transaction, the content of the |
Parameters |
|
Returns |
The current instance ( |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.4. SPI Interfaces
5.4.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 |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.4.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
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 |
|
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.4.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 |
Pre-conditions |
Argument — every parameter is non- |
Errors |
None. |
5.5. Enumerations
5.5.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.5.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.5.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.5.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.5.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.6. Errors
Every error defined below carries two properties: message (String), which describes the condition, and
cause (Any?), the underlying error that triggered it, null when there is none. They are not
restated for each error.
5.6.1. Inconsistent Data
Name |
|
|---|---|
Kind |
Error |
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.6.2. Invalid Signature
Name |
|
|---|---|
Kind |
Error |
Namespace |
|
Since |
0.1 |
Purpose |
Indicates that a signature is invalid. |
5.6.3. SAM Revoked
Name |
|
|---|---|
Kind |
Error |
Namespace |
|
Since |
0.1 |
Purpose |
Indicates that the SAM is revoked. |