Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
### Changed
- Switched to [Keyple Java BOM](https://github.com/eclipse-keyple/keyple-java-bom) `2025.10.24` for dependency
management, replacing individual Keyple component definitions.
- Add additional comments regarding the ratification mechanism.
- Restructured package names for better alignment with project conventions and clarity.

## [2025-07-21]
### Fixed
Expand Down
35 changes: 20 additions & 15 deletions Example_Card_Calypso/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ plugins {
dependencies {
// Begin Keyple configuration (generated by
// 'https://keyple.org/components/overview/configuration-wizard/')
implementation("org.eclipse.keypop:keypop-reader-java-api:2.0.1")
implementation("org.eclipse.keypop:keypop-calypso-card-java-api:2.1.2")
implementation("org.eclipse.keypop:keypop-calypso-crypto-legacysam-java-api:0.7.0")
implementation("org.eclipse.keyple:keyple-common-java-api:2.0.2")
implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.0")
implementation("org.eclipse.keyple:keyple-service-java-lib:3.3.5")
implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.0")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib:3.1.8")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-legacysam-java-lib:0.9.0")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-pki-java-lib:0.2.2")
implementation("org.eclipse.keyple:keyple-plugin-pcsc-java-lib:2.5.2")
implementation("org.eclipse.keyple:keyple-plugin-stub-java-lib:2.2.1")
implementation(platform("org.eclipse.keyple:keyple-java-bom:2025.10.24"))
implementation("org.eclipse.keypop:keypop-reader-java-api")
implementation("org.eclipse.keypop:keypop-calypso-card-java-api")
implementation("org.eclipse.keypop:keypop-calypso-crypto-legacysam-java-api")
implementation("org.eclipse.keyple:keyple-common-java-api")
implementation("org.eclipse.keyple:keyple-util-java-lib")
implementation("org.eclipse.keyple:keyple-service-java-lib")
implementation("org.eclipse.keyple:keyple-service-resource-java-lib")
implementation("org.eclipse.keyple:keyple-card-calypso-java-lib")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-legacysam-java-lib")
implementation("org.eclipse.keyple:keyple-card-calypso-crypto-pki-java-lib")
implementation("org.eclipse.keyple:keyple-plugin-pcsc-java-lib")
implementation("org.eclipse.keyple:keyple-plugin-stub-java-lib")
// End Keyple configuration

implementation("org.slf4j:slf4j-simple:1.7.32")
implementation("com.google.code.gson:gson:2.10.1")
}
Expand All @@ -47,7 +49,7 @@ tasks {
manifest {
attributes(
"Main-Class" to
"org.eclipse.keyple.card.calypso.example.UseCase10_SessionTrace_TN313.Main_SessionTrace_TN313_Pcsc",
"org.eclipse.keyple.example.card.calypso.UseCase10_SessionTrace_TN313.Main_SessionTrace_TN313_Pcsc",
"Created-By" to
"${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${
System.getProperty(
Expand All @@ -61,6 +63,7 @@ tasks {
"Bundle-Name" to project.name,
"Bundle-Description" to project.description)
}
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
from(
configurations.runtimeClasspath
.get()
Expand All @@ -76,7 +79,7 @@ tasks {
manifest {
attributes(
"Main-Class" to
"org.eclipse.keyple.card.calypso.example.UseCase12_PerformanceMeasurement_EmbeddedValidation.Main_PerformanceMeasurement_EmbeddedValidation_Pcsc",
"org.eclipse.keyple.example.card.calypso.UseCase12_PerformanceMeasurement_EmbeddedValidation.Main_PerformanceMeasurement_EmbeddedValidation_Pcsc",
"Created-By" to
"${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${
System.getProperty(
Expand All @@ -90,6 +93,7 @@ tasks {
"Bundle-Name" to project.name,
"Bundle-Description" to project.description)
}
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
from(
configurations.runtimeClasspath
.get()
Expand All @@ -105,7 +109,7 @@ tasks {
manifest {
attributes(
"Main-Class" to
"org.eclipse.keyple.card.calypso.example.UseCase13_PerformanceMeasurement_DistributedReloading.Main_PerformanceMeasurement_DistributedReloading_Pcsc",
"org.eclipse.keyple.example.card.calypso.UseCase13_PerformanceMeasurement_DistributedReloading.Main_PerformanceMeasurement_DistributedReloading_Pcsc",
"Created-By" to
"${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${
System.getProperty(
Expand All @@ -119,6 +123,7 @@ tasks {
"Bundle-Name" to project.name,
"Bundle-Description" to project.description)
}
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
from(
configurations.runtimeClasspath
.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase10_SessionTrace_TN313;
package org.eclipse.keyple.example.card.calypso.UseCase10_SessionTrace_TN313;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.DEBIT;
import static org.eclipse.keypop.reader.CardReaderEvent.Type.CARD_INSERTED;
Expand Down Expand Up @@ -108,12 +108,31 @@ public void onReaderEvent(CardReaderEvent event) {
cardReader, calypsoCard, cardSecuritySetting)
.prepareOpenSecureSession(DEBIT)
.prepareReadRecords(SFI_ENVIRONMENT_AND_HOLDER, 1, 1, RECORD_SIZE)
.prepareReadRecords(SFI_EVENT_LOG, 1, 1, RECORD_SIZE)
.prepareReadRecords(SFI_CONTRACT_LIST, 1, 1, RECORD_SIZE)
.processCommands(ChannelControl.KEEP_OPEN);

/*
Place for the analysis of the context and the list of contracts
Place for the analysis of the context
*/

cardTransactionManager
.prepareReadRecords(SFI_EVENT_LOG, 1, 1, RECORD_SIZE)
.processCommands(ChannelControl.KEEP_OPEN);

/*
Ratification and anti-passback management:
This section handles the scenario where a previous transaction occurred very recently:
- If the previous transaction has not been ratified, access is granted immediately.
The only required action is to close the session, which ensures the authenticity of the support.
- If the previous transaction has been ratified, access is denied according to the anti-passback rule,
preventing multiple successive illegal uses of the same support in a short time.
*/

cardTransactionManager
.prepareReadRecords(SFI_CONTRACT_LIST, 1, 1, RECORD_SIZE)
.processCommands(ChannelControl.KEEP_OPEN);

/*
Place for the analysis of the contract list
*/

// Read the elected contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase10_SessionTrace_TN313;
package org.eclipse.keyple.example.card.calypso.UseCase10_SessionTrace_TN313;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase11_DataSigning;
package org.eclipse.keyple.example.card.calypso.UseCase11_DataSigning;

import org.eclipse.keyple.card.calypso.crypto.legacysam.LegacySamExtensionService;
import org.eclipse.keyple.card.calypso.crypto.legacysam.LegacySamUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase12_PerformanceMeasurement_EmbeddedValidation;
package org.eclipse.keyple.example.card.calypso.UseCase12_PerformanceMeasurement_EmbeddedValidation;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.DEBIT;

Expand Down Expand Up @@ -169,15 +169,29 @@ public static void main(String[] args) throws IOException {
cardReader, calypsoCard, symmetricCryptoSecuritySetting)
.prepareOpenSecureSession(DEBIT)
.prepareReadRecords(SFI_ENVIRONMENT_AND_HOLDER, 1, 1, RECORD_SIZE)
.prepareReadRecords(SFI_EVENT_LOG, 1, 1, RECORD_SIZE)
.processCommands(ChannelControl.KEEP_OPEN);

byte[] environmentAndHolderData =
calypsoCard.getFileBySfi(SFI_ENVIRONMENT_AND_HOLDER).getData().getContent(1);

// TODO Place here the analysis of the context

// Read the last event record
cardTransactionManager
.prepareReadRecords(SFI_EVENT_LOG, 1, 1, RECORD_SIZE)
.processCommands(ChannelControl.KEEP_OPEN);

byte[] eventLogData = calypsoCard.getFileBySfi(SFI_EVENT_LOG).getData().getContent(1);

// TODO Place here the analysis of the context and the last event log
// TODO Place here the analysis of the last event log
// Ratification and anti-passback management:
// This section handles the scenario where a previous transaction occurred very recently:
// - If the previous transaction has not been ratified, access is granted immediately.
// The only required action is to close the session, which ensures the authenticity of
// the support.
// - If the previous transaction has been ratified, access is denied according to the
// anti-passback rule,
// preventing multiple successive illegal uses of the same support in a short time.

// Read the contract list
// Specifying expected response lengths in read commands serves as a protective measure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase13_PerformanceMeasurement_DistributedReloading;
package org.eclipse.keyple.example.card.calypso.UseCase13_PerformanceMeasurement_DistributedReloading;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.LOAD;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase14_ReadLegacySamCountersAndCeilings;
package org.eclipse.keyple.example.card.calypso.UseCase14_ReadLegacySamCountersAndCeilings;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase15_ExtendedModeSession;
package org.eclipse.keyple.example.card.calypso.UseCase15_ExtendedModeSession;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase16_PkiModeSession;
package org.eclipse.keyple.example.card.calypso.UseCase16_PkiModeSession;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase17_PkiPrePersonalization;
package org.eclipse.keyple.example.card.calypso.UseCase17_PkiPrePersonalization;

import java.io.IOException;
import java.time.LocalDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase17_PkiPrePersonalization;
package org.eclipse.keyple.example.card.calypso.UseCase17_PkiPrePersonalization;

import java.io.IOException;
import java.time.LocalDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase1_ExplicitSelectionAid;
package org.eclipse.keyple.example.card.calypso.UseCase1_ExplicitSelectionAid;

import java.io.IOException;
import java.text.ParseException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase1_ExplicitSelectionAid;
package org.eclipse.keyple.example.card.calypso.UseCase1_ExplicitSelectionAid;

import org.eclipse.keyple.card.calypso.CalypsoExtensionService;
import org.eclipse.keyple.card.calypso.example.common.StubSmartCardFactory;
import org.eclipse.keyple.core.service.*;
import org.eclipse.keyple.core.util.HexUtil;
import org.eclipse.keyple.example.card.calypso.common.StubSmartCardFactory;
import org.eclipse.keyple.plugin.stub.StubPluginFactoryBuilder;
import org.eclipse.keypop.calypso.card.CalypsoCardApiFactory;
import org.eclipse.keypop.calypso.card.card.CalypsoCard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase2_ScheduledSelection;
package org.eclipse.keyple.example.card.calypso.UseCase2_ScheduledSelection;

import static org.eclipse.keypop.reader.CardReaderEvent.Type.CARD_INSERTED;
import static org.eclipse.keypop.reader.CardReaderEvent.Type.CARD_MATCHED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase2_ScheduledSelection;
package org.eclipse.keyple.example.card.calypso.UseCase2_ScheduledSelection;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase2_ScheduledSelection;
package org.eclipse.keyple.example.card.calypso.UseCase2_ScheduledSelection;

import org.eclipse.keyple.card.calypso.CalypsoExtensionService;
import org.eclipse.keyple.card.calypso.example.common.StubSmartCardFactory;
import org.eclipse.keyple.core.service.*;
import org.eclipse.keyple.example.card.calypso.common.StubSmartCardFactory;
import org.eclipse.keyple.plugin.stub.StubPluginFactoryBuilder;
import org.eclipse.keypop.calypso.card.CalypsoCardApiFactory;
import org.eclipse.keypop.calypso.card.card.CalypsoCardSelectionExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase3_Rev1Selection;
package org.eclipse.keyple.example.card.calypso.UseCase3_Rev1Selection;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase4_CardAuthentication;
package org.eclipse.keyple.example.card.calypso.UseCase4_CardAuthentication;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase4_CardAuthentication;
package org.eclipse.keyple.example.card.calypso.UseCase4_CardAuthentication;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase4_CardAuthentication;
package org.eclipse.keyple.example.card.calypso.UseCase4_CardAuthentication;

import org.eclipse.keyple.card.calypso.CalypsoExtensionService;
import org.eclipse.keyple.card.calypso.crypto.legacysam.LegacySamExtensionService;
import org.eclipse.keyple.card.calypso.crypto.legacysam.LegacySamUtil;
import org.eclipse.keyple.card.calypso.example.common.StubSmartCardFactory;
import org.eclipse.keyple.core.service.Plugin;
import org.eclipse.keyple.core.service.SmartCardService;
import org.eclipse.keyple.core.service.SmartCardServiceProvider;
import org.eclipse.keyple.core.service.resource.*;
import org.eclipse.keyple.core.service.resource.spi.CardResourceProfileExtension;
import org.eclipse.keyple.core.service.resource.spi.ReaderConfiguratorSpi;
import org.eclipse.keyple.core.util.HexUtil;
import org.eclipse.keyple.example.card.calypso.common.StubSmartCardFactory;
import org.eclipse.keyple.plugin.stub.StubPluginFactoryBuilder;
import org.eclipse.keypop.calypso.card.CalypsoCardApiFactory;
import org.eclipse.keypop.calypso.card.WriteAccessLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase5_MultipleSession;
package org.eclipse.keyple.example.card.calypso.UseCase5_MultipleSession;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.DEBIT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase6_VerifyPin;
package org.eclipse.keyple.example.card.calypso.UseCase6_VerifyPin;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.DEBIT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase7_StoredValue_SimpleReloading;
package org.eclipse.keyple.example.card.calypso.UseCase7_StoredValue_SimpleReloading;

import java.io.IOException;
import java.util.Properties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* SPDX-License-Identifier: BSD-3-Clause
************************************************************************************** */
package org.eclipse.keyple.card.calypso.example.UseCase8_StoredValue_DebitInSession;
package org.eclipse.keyple.example.card.calypso.UseCase8_StoredValue_DebitInSession;

import static org.eclipse.keypop.calypso.card.WriteAccessLevel.DEBIT;

Expand Down
Loading