From 939e3a7ea9b00ff55a48f58bbf5704bd057b0252 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:25:57 +0100 Subject: [PATCH 01/14] Delete deprecated `keyple-card-generic-java-lib` API components. --- .../card/generic/CardTransactionManager.java | 129 ------------------ .../keyple/card/generic/ChannelControl.java | 38 ------ .../GenericCardSelectionExtension.java | 34 ----- .../card/generic/TransactionException.java | 43 ------ 4 files changed, 244 deletions(-) delete mode 100644 src/main/java/org/eclipse/keyple/card/generic/CardTransactionManager.java delete mode 100644 src/main/java/org/eclipse/keyple/card/generic/ChannelControl.java delete mode 100644 src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtension.java delete mode 100644 src/main/java/org/eclipse/keyple/card/generic/TransactionException.java diff --git a/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManager.java b/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManager.java deleted file mode 100644 index 05a58a3..0000000 --- a/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManager.java +++ /dev/null @@ -1,129 +0,0 @@ -/* ************************************************************************************** - * Copyright (c) 2021 Calypso Networks Association https://calypsonet.org/ - * - * See the NOTICE file(s) distributed with this work for additional information - * regarding copyright ownership. - * - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - ************************************************************************************** */ -package org.eclipse.keyple.card.generic; - -import java.util.List; - -/** Provides basic methods to prepare and process APDU exchange with a card. */ -public interface CardTransactionManager - extends org.eclipse.keypop.reader.transaction.spi.CardTransactionManager< - CardTransactionManager> { - - /** - * Prepares an APDU to be transmitted the next time {@link - * #processApdusToByteArrays(ChannelControl)} is invoked. - * - * @param apduCommand A not empty hexadecimal string containing a raw APDU command. - * @return This instance. - * @since 2.0.0 - */ - CardTransactionManager prepareApdu(String apduCommand); - - /** - * Prepares an APDU to be transmitted the next time {@link - * #processApdusToByteArrays(ChannelControl)} is invoked. - * - * @param apduCommand A not empty byte arrays containing raw APDU commands. - * @return This instance. - * @since 2.0.0 - */ - CardTransactionManager prepareApdu(byte[] apduCommand); - - /** - * Prepares an APDU to be transmitted the next time {@link - * #processApdusToByteArrays(ChannelControl)} is invoked. - * - * @param cla The class byte. - * @param ins The instruction byte. - * @param p1 The P1 parameter. - * @param p2 The P2 parameter. - * @param dataIn The APDU data, null if there is no data. - * @param le The expected output length, 0 if the output length is unspecified, null if no output - * data is expected. - * @return This instance. - * @since 2.0.0 - */ - CardTransactionManager prepareApdu(byte cla, byte ins, byte p1, byte p2, byte[] dataIn, Byte le); - - /** - * Transmits all prepared APDUs, closes the physical channel if required, and returns a list of - * responses to the APDUs in the form of list of of byte arrays. - * - *

If the prepared APDU list is empty an empty list is returned. - * - *

The prepared APDU list is cleared after this method has been invoked. - * - * @param channelControl Policy for managing the physical channel after executing commands to the - * card. - * @return A not null reference. - * @throws TransactionException If the communication with the card or the reader has failed. - * @since 2.0.0 - * @deprecated Use {@link #processCommands(org.eclipse.keypop.reader.ChannelControl)} and {@link - * #getResponsesAsByteArrays()} instead. - */ - @Deprecated - List processApdusToByteArrays(ChannelControl channelControl) throws TransactionException; - - /** - * Transmits all prepared APDUs, closes the physical channel if required, and returns a list of - * responses to the APDUs in the form of list of hexadecimal strings. - * - *

If the prepared APDU list is empty an empty list is returned. - * - *

The prepared APDU list is cleared after this method has been invoked. - * - * @param channelControl Policy for managing the physical channel after executing commands to the - * card. - * @return A not null reference. - * @throws TransactionException If the communication with the card or the reader has failed. - * @since 2.0.0 - * @deprecated Use {@link #processCommands(org.eclipse.keypop.reader.ChannelControl)} and {@link - * #getResponsesAsHexStrings()} instead. - */ - @Deprecated - List processApdusToHexStrings(ChannelControl channelControl) throws TransactionException; - - /** - * Returns the list of responses corresponding to the commands executed by the last call to {@link - * #processCommands(org.eclipse.keypop.reader.ChannelControl)}, represented as byte arrays. - * - *

Each element in the returned list represents the response of one command, in the same order - * as the commands were prepared. The returned list is never {@code null}.
- * This method does not alter the internal state of the manager: the list of responses remains - * available for later calls until {@link - * #processCommands(org.eclipse.keypop.reader.ChannelControl)} is invoked again, at which point it - * is replaced by the new set of responses. - * - * @return A not {@code null} list of byte arrays representing the command responses, in the same - * order as the commands were sent. - * @since 3.2.0 - */ - List getResponsesAsByteArrays(); - - /** - * Returns the list of responses corresponding to the commands executed by the last call to {@link - * #processCommands(org.eclipse.keypop.reader.ChannelControl)}, represented as hexadecimal - * strings. - * - *

Each element in the returned list represents the response of one command, in the same order - * as the commands were prepared. The returned list is never {@code null}.
- * This method does not alter the internal state of the manager: the list of responses remains - * available for later calls until {@link - * #processCommands(org.eclipse.keypop.reader.ChannelControl)} is invoked again, at which point it - * is replaced by the new set of responses. - * - * @return A not {@code null} list of hexadecimal strings representing the command responses, in - * the same order as the commands were sent. - * @since 3.2.0 - */ - List getResponsesAsHexStrings(); -} diff --git a/src/main/java/org/eclipse/keyple/card/generic/ChannelControl.java b/src/main/java/org/eclipse/keyple/card/generic/ChannelControl.java deleted file mode 100644 index 5f934cd..0000000 --- a/src/main/java/org/eclipse/keyple/card/generic/ChannelControl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* ************************************************************************************** - * Copyright (c) 2023 Calypso Networks Association https://calypsonet.org/ - * - * See the NOTICE file(s) distributed with this work for additional information - * regarding copyright ownership. - * - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - ************************************************************************************** */ -package org.eclipse.keyple.card.generic; - -/** - * Policy for managing the physical channel after a card request is executed. - * - * @since 3.0.0 - * @deprecated Will be removed in a future version. - */ -@Deprecated -public enum ChannelControl { - - /** - * Leaves the physical channel open. - * - * @since 3.0.0 - */ - KEEP_OPEN, - - /** - * Terminates communication with the card.
- * The physical channel closes instantly or a card removal sequence is initiated depending on the - * observation mode. - * - * @since 3.0.0 - */ - CLOSE_AFTER -} diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtension.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtension.java deleted file mode 100644 index 8aee252..0000000 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtension.java +++ /dev/null @@ -1,34 +0,0 @@ -/* ************************************************************************************** - * Copyright (c) 2023 Calypso Networks Association https://calypsonet.org/ - * - * See the NOTICE file(s) distributed with this work for additional information - * regarding copyright ownership. - * - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - ************************************************************************************** */ -package org.eclipse.keyple.card.generic; - -import org.eclipse.keypop.reader.selection.spi.CardSelectionExtension; - -/** - * Card specific {@link CardSelectionExtension} providing means to add successful status word. - * - * @since 3.0.0 - */ -public interface GenericCardSelectionExtension extends CardSelectionExtension { - - /** - * Adds a status word to the list of those that should be considered successful for the Select - * Application APDU. - * - *

Note: initially, the list contains the standard successful status word {@code 9000h}. - * - * @param statusWord A positive int ≤ {@code FFFFh}. - * @return The current instance. - * @since 2.0.0 - */ - GenericCardSelectionExtension addSuccessfulStatusWord(int statusWord); -} diff --git a/src/main/java/org/eclipse/keyple/card/generic/TransactionException.java b/src/main/java/org/eclipse/keyple/card/generic/TransactionException.java deleted file mode 100644 index 1a3567b..0000000 --- a/src/main/java/org/eclipse/keyple/card/generic/TransactionException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* ************************************************************************************** - * Copyright (c) 2021 Calypso Networks Association https://calypsonet.org/ - * - * See the NOTICE file(s) distributed with this work for additional information - * regarding copyright ownership. - * - * This program and the accompanying materials are made available under the terms of the - * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - ************************************************************************************** */ -package org.eclipse.keyple.card.generic; - -/** - * Exception when an error or a communication failure with the card or the reader occurs. - * - * @since 2.0.0 - * @deprecated Will be removed in a future version. - */ -@Deprecated -public class TransactionException extends RuntimeException { - - /** - * Builds a new exception. - * - * @param message Message to identify the exception context. - * @since 2.0.0 - */ - public TransactionException(String message) { - super(message); - } - - /** - * Builds a new exception with the originating exception. - * - * @param message Message to identify the exception context. - * @param cause The cause - * @since 2.0.0 - */ - public TransactionException(String message, Throwable cause) { - super(message, cause); - } -} From 9f9e31a3a9487174c6fedbf9f8775bea08762b8c Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:26:36 +0100 Subject: [PATCH 02/14] Update `api_class_diagram.svg` to reflect API version 4.0+ changes. --- src/main/uml/api_class_diagram.puml | 36 ++++------------------------- src/main/uml/api_class_diagram.svg | 2 +- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/main/uml/api_class_diagram.puml b/src/main/uml/api_class_diagram.puml index 75f79c3..83d6a1e 100644 --- a/src/main/uml/api_class_diagram.puml +++ b/src/main/uml/api_class_diagram.puml @@ -1,6 +1,6 @@ @startuml title - Keyple - keyple-card-generic-java-lib - 3.2.+ (2025-11-10) + Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11) end title ' == THEME == @@ -58,6 +58,7 @@ legend top ** **keypop-reader-java-api** ** **keyple-common-java-api** ** **keyple-service-resource-java-lib** + ** **keypop-genericcard-jvm-api** end legend package "org.eclipse.keyple.card.generic" as generic { @@ -65,49 +66,20 @@ package "org.eclipse.keyple.card.generic" as generic { -- +{static} GenericExtensionService getInstance () - +GenericCardSelectionExtension createGenericCardSelectionExtension () - +CardResourceProfileExtension createCardResourceProfileExtension (IsoCardSelector cardSelector, GenericCardSelectionExtension genericCardSelectionExtension) - +CardTransactionManager createCardTransaction (CardReader cardReader, SmartCard card) + +GenericCardApiFactory createGenericCardApiFactory() + +CardResourceProfileExtension createCardResourceProfileExtension (IsoCardSelector cardSelector, GenericCardSelectionExtension genericCardSelectionExtension) -- **KeypleCardExtension** -- +String getCommonApiVersion () +String getReaderApiVersion () +String getCardApiVersion () } - +interface "<<CardSelectionExtension>>\nGenericCardSelectionExtension" as GenericCardSelectionExtension { - +GenericCardSelectionExtension addSuccessfulStatusWord (int statusWord) - } - +interface "<<CardTransactionManager>>\nCardTransactionManager" as CardTransactionManager { - +CardTransactionManager prepareApdu (String apduCommand) - +CardTransactionManager prepareApdu (byte[] apduCommand) - +CardTransactionManager prepareApdu (byte cla, byte ins, byte p1, byte p2, byte[] dataIn, Byte le) - - +List processApdusToByteArrays (ChannelControl channelControl) throws TransactionException - +List processApdusToHexStrings (ChannelControl channelControl) throws TransactionException - - +List getResponsesAsByteArrays () - +List getResponsesAsHexStrings () - } - +enum "ChannelControl" as ChannelControl <> { - KEEP_OPEN - CLOSE_AFTER - } - +class "<>\n**final** TransactionException" as TransactionException <> { - +TransactionException (String message) - +TransactionException (String message, Throwable cause) - } } ' Associations ' == LAYOUT == -GenericExtensionService ..> GenericCardSelectionExtension #C_LINK : create > -GenericExtensionService ..> CardTransactionManager #C_LINK : create > - -CardTransactionManager ..> ChannelControl #C_USE : use > -CardTransactionManager ..> TransactionException #C_THROW : throw > - ' == STYLE == package generic #C_GREY1 {} diff --git a/src/main/uml/api_class_diagram.svg b/src/main/uml/api_class_diagram.svg index e61adbd..d95050a 100644 --- a/src/main/uml/api_class_diagram.svg +++ b/src/main/uml/api_class_diagram.svg @@ -1 +1 @@ -Keyple - keyple-card-generic-java-lib - 3.2.+ (2025-11-10)Keyple - keyple-card-generic-java-lib - 3.2.+ (2025-11-10)Colors legend:External API references:keypop-reader-java-apikeyple-common-java-apikeyple-service-resource-java-liborg.eclipse.keyple.card.generic<<KeypleCardExtension>>finalGenericExtensionServiceGenericExtensionService getInstance () GenericCardSelectionExtension createGenericCardSelectionExtension ()CardResourceProfileExtensioncreateCardResourceProfileExtension (IsoCardSelector cardSelector, GenericCardSelectionExtension genericCardSelectionExtension)CardTransactionManager createCardTransaction (CardReadercardReader,SmartCardcard) String getCommonApiVersion ()String getReaderApiVersion ()String getCardApiVersion ()KeypleCardExtension<<CardSelectionExtension>>GenericCardSelectionExtensionGenericCardSelectionExtension addSuccessfulStatusWord (int statusWord)<<CardTransactionManager>>CardTransactionManagerCardTransactionManager prepareApdu (String apduCommand)CardTransactionManager prepareApdu (byte[] apduCommand)CardTransactionManager prepareApdu (byte cla, byte ins, byte p1, byte p2, byte[] dataIn, Byte le) List<byte[]> processApdusToByteArrays (ChannelControl channelControl) throws TransactionExceptionList<String> processApdusToHexStrings (ChannelControl channelControl) throws TransactionException List<byte[]> getResponsesAsByteArrays ()List<String> getResponsesAsHexStrings ()ChannelControlKEEP_OPENCLOSE_AFTER«RuntimeException»finalTransactionExceptionTransactionException (String message)TransactionException (String message, Throwable cause)createcreateusethrow \ No newline at end of file +Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Colors legend:External API references:keypop-reader-java-apikeyple-common-java-apikeyple-service-resource-java-libkeypop-genericcard-jvm-apiorg.eclipse.keyple.card.generic<<KeypleCardExtension>>finalGenericExtensionServiceGenericExtensionService getInstance () GenericCardFactoryApicreateGenericCardApiFactory()CardResourceProfileExtensioncreateCardResourceProfileExtension (IsoCardSelectorcardSelector,GenericCardSelectionExtensiongenericCardSelectionExtension) String getCommonApiVersion ()String getReaderApiVersion ()String getCardApiVersion ()KeypleCardExtension \ No newline at end of file From 65d9ce9bc8b07247385a4b6bfda15a73913a18ed Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:26:46 +0100 Subject: [PATCH 03/14] Add `keypop-genericcard-jvm-api` dependency --- build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle.kts b/build.gradle.kts index b33221b..2d497a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,6 +19,7 @@ dependencies { implementation("org.eclipse.keyple:keyple-common-java-api:2.0.2") implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.1") implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.1") + implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") compileOnly("org.slf4j:slf4j-api:1.7.36") testImplementation(platform("org.junit:junit-bom:5.10.2")) From 5e33e88f83d2f1e6c37b5c76b2dd4c9c777b187b Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:27:25 +0100 Subject: [PATCH 04/14] Delete deprecated methods and update references to `keypop-genericcard` API components. --- .../CardTransactionManagerAdapter.java | 55 +------------------ ...icCardResourceProfileExtensionAdapter.java | 3 +- .../GenericCardSelectionExtensionAdapter.java | 1 + .../card/generic/GenericExtensionService.java | 22 ++------ 4 files changed, 10 insertions(+), 71 deletions(-) diff --git a/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManagerAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManagerAdapter.java index adf196a..a8f9d5e 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManagerAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/CardTransactionManagerAdapter.java @@ -18,6 +18,7 @@ import org.eclipse.keyple.core.util.HexUtil; import org.eclipse.keypop.card.*; import org.eclipse.keypop.card.spi.ApduRequestSpi; +import org.eclipse.keypop.genericcard.CardTransactionManager; import org.eclipse.keypop.reader.CardCommunicationException; import org.eclipse.keypop.reader.CardReader; import org.eclipse.keypop.reader.InvalidCardResponseException; @@ -94,60 +95,6 @@ public CardTransactionManager prepareApdu( return this; } - /** - * {@inheritDoc} - * - * @since 2.0.0 - */ - @Override - @Deprecated - public List processApdusToByteArrays(ChannelControl channelControl) - throws TransactionException { - CardResponseApi cardResponse; - if (apduRequests.isEmpty()) { - return new ArrayList<>(0); - } - try { - cardResponse = - ((ProxyReaderApi) reader) - .transmitCardRequest( - new CardRequestAdapter(apduRequests, false), - channelControl == ChannelControl.CLOSE_AFTER - ? org.eclipse.keypop.card.ChannelControl.CLOSE_AFTER - : org.eclipse.keypop.card.ChannelControl.KEEP_OPEN); - } catch (ReaderBrokenCommunicationException e) { - throw new TransactionException("Reader communication error", e); - } catch (CardBrokenCommunicationException e) { - throw new TransactionException("Card communication error", e); - } catch (UnexpectedStatusWordException e) { - throw new TransactionException("APDU error", e); - } finally { - apduRequests.clear(); - } - List apduResponsesBytes = new ArrayList<>(); - for (ApduResponseApi apduResponse : cardResponse.getApduResponses()) { - apduResponsesBytes.add(apduResponse.getApdu()); - } - return apduResponsesBytes; - } - - /** - * {@inheritDoc} - * - * @since 2.0.0 - */ - @Override - @Deprecated - public List processApdusToHexStrings(ChannelControl channelControl) - throws TransactionException { - List apduResponsesBytes = processApdusToByteArrays(channelControl); - List apduResponsesHex = new ArrayList<>(); - for (byte[] bytes : apduResponsesBytes) { - apduResponsesHex.add(HexUtil.toHex(bytes)); - } - return apduResponsesHex; - } - /** * {@inheritDoc} * diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java index 09fe4a9..ff783f8 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java @@ -13,6 +13,7 @@ import org.eclipse.keyple.core.service.resource.spi.CardResourceProfileExtension; import org.eclipse.keyple.core.util.Assert; +import org.eclipse.keypop.genericcard.GenericCardSelectionExtension; import org.eclipse.keypop.reader.CardReader; import org.eclipse.keypop.reader.ReaderApiFactory; import org.eclipse.keypop.reader.selection.CardSelectionManager; @@ -24,7 +25,7 @@ import org.slf4j.LoggerFactory; /** - * Implementation of {@link CardResourceProfileExtension} that provides the capability to filter + * Implementation of {@link CardResourceProfileExtension} that provides the ability to filter * cards of any type. * * @since 2.0.0 diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtensionAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtensionAdapter.java index b09bcad..97db432 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtensionAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardSelectionExtensionAdapter.java @@ -15,6 +15,7 @@ import java.util.Set; import org.eclipse.keypop.card.CardSelectionResponseApi; import org.eclipse.keypop.card.spi.*; +import org.eclipse.keypop.genericcard.GenericCardSelectionExtension; /** * Implementation of {@link GenericCardSelectionExtension}. diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java index 613d122..73097a0 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java @@ -15,6 +15,9 @@ import org.eclipse.keyple.core.common.KeypleCardExtension; import org.eclipse.keyple.core.service.resource.spi.CardResourceProfileExtension; import org.eclipse.keypop.card.CardApiProperties; +import org.eclipse.keypop.genericcard.CardTransactionManager; +import org.eclipse.keypop.genericcard.GenericCardApiFactory; +import org.eclipse.keypop.genericcard.GenericCardSelectionExtension; import org.eclipse.keypop.reader.CardReader; import org.eclipse.keypop.reader.ReaderApiProperties; import org.eclipse.keypop.reader.selection.IsoCardSelector; @@ -43,25 +46,12 @@ public static GenericExtensionService getInstance() { } /** - * Creates an instance of {@link CardSelectionExtension}. * * @return A not null reference. - * @since 2.0.0 - */ - public GenericCardSelectionExtension createGenericCardSelectionExtension() { - return new GenericCardSelectionExtensionAdapter(); - } - - /** - * Creates an instance of {@link CardTransactionManager}. - * - * @param reader The reader through which the card communicates. - * @param card The initial card data provided by the selection process. - * @return A not null reference. - * @since 2.0.0 + * @since 4.0.0 */ - public CardTransactionManager createCardTransaction(CardReader reader, SmartCard card) { - return new CardTransactionManagerAdapter(reader, card); + public GenericCardApiFactory createGenericCardApiFactory() { + return new GenericCardApiFactoryAdapter(); } /** From f06327d4a445ad9cdbbf92153edc24dd1af83246 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:27:59 +0100 Subject: [PATCH 05/14] Introduce `GenericCardApiFactoryAdapter` to integrate `keypop-genericcard` API. --- .../generic/GenericCardApiFactoryAdapter.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java new file mode 100644 index 0000000..1238bec --- /dev/null +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java @@ -0,0 +1,20 @@ +package org.eclipse.keyple.card.generic; + +import org.eclipse.keypop.genericcard.CardTransactionManager; +import org.eclipse.keypop.genericcard.GenericCardApiFactory; +import org.eclipse.keypop.genericcard.GenericCardSelectionExtension; +import org.eclipse.keypop.reader.CardReader; +import org.eclipse.keypop.reader.selection.spi.SmartCard; + +public class GenericCardApiFactoryAdapter implements GenericCardApiFactory { + + @Override + public GenericCardSelectionExtension createGenericCardSelectionExtension() { + return new GenericCardSelectionExtensionAdapter(); + } + + @Override + public CardTransactionManager createCardTransaction(CardReader cardReader, SmartCard card) { + return new CardTransactionManagerAdapter(cardReader, card); + } +} From ed4b7e0dfa751aead4a99eaa3fbf9dc8bca9675d Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:29:58 +0100 Subject: [PATCH 06/14] Format code and update copyright header. --- .../generic/GenericCardApiFactoryAdapter.java | 27 +++++++++++++------ ...icCardResourceProfileExtensionAdapter.java | 4 +-- .../card/generic/GenericExtensionService.java | 5 ---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java index 1238bec..c8cdfd2 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java @@ -1,3 +1,14 @@ +/* ************************************************************************************** + * Copyright (c) 2026 Calypso Networks Association https://calypsonet.org/ + * + * See the NOTICE file(s) distributed with this work for additional information + * regarding copyright ownership. + * + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + ************************************************************************************** */ package org.eclipse.keyple.card.generic; import org.eclipse.keypop.genericcard.CardTransactionManager; @@ -8,13 +19,13 @@ public class GenericCardApiFactoryAdapter implements GenericCardApiFactory { - @Override - public GenericCardSelectionExtension createGenericCardSelectionExtension() { - return new GenericCardSelectionExtensionAdapter(); - } + @Override + public GenericCardSelectionExtension createGenericCardSelectionExtension() { + return new GenericCardSelectionExtensionAdapter(); + } - @Override - public CardTransactionManager createCardTransaction(CardReader cardReader, SmartCard card) { - return new CardTransactionManagerAdapter(cardReader, card); - } + @Override + public CardTransactionManager createCardTransaction(CardReader cardReader, SmartCard card) { + return new CardTransactionManagerAdapter(cardReader, card); + } } diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java index ff783f8..8e8b6b0 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardResourceProfileExtensionAdapter.java @@ -25,8 +25,8 @@ import org.slf4j.LoggerFactory; /** - * Implementation of {@link CardResourceProfileExtension} that provides the ability to filter - * cards of any type. + * Implementation of {@link CardResourceProfileExtension} that provides the ability to filter cards + * of any type. * * @since 2.0.0 */ diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java index 73097a0..895ecc9 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java @@ -15,14 +15,10 @@ import org.eclipse.keyple.core.common.KeypleCardExtension; import org.eclipse.keyple.core.service.resource.spi.CardResourceProfileExtension; import org.eclipse.keypop.card.CardApiProperties; -import org.eclipse.keypop.genericcard.CardTransactionManager; import org.eclipse.keypop.genericcard.GenericCardApiFactory; import org.eclipse.keypop.genericcard.GenericCardSelectionExtension; -import org.eclipse.keypop.reader.CardReader; import org.eclipse.keypop.reader.ReaderApiProperties; import org.eclipse.keypop.reader.selection.IsoCardSelector; -import org.eclipse.keypop.reader.selection.spi.CardSelectionExtension; -import org.eclipse.keypop.reader.selection.spi.SmartCard; /** * Card extension service providing basic access to APDU exchange functions with a card. @@ -46,7 +42,6 @@ public static GenericExtensionService getInstance() { } /** - * * @return A not null reference. * @since 4.0.0 */ From d76fa79e14ceaf5400ea98ef4a8517e4b5d18492 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Wed, 11 Mar 2026 17:38:51 +0100 Subject: [PATCH 07/14] Mark `keypop-genericcard-jvm-api` dependency as changing. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2d497a6..870d4e2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ dependencies { implementation("org.eclipse.keyple:keyple-common-java-api:2.0.2") implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.1") implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.1") - implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") + implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") { isChanging = true} compileOnly("org.slf4j:slf4j-api:1.7.36") testImplementation(platform("org.junit:junit-bom:5.10.2")) From 030eb4f4a0d4fd4c2f5f45ebafbe6594e97ac6d5 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:07:51 +0100 Subject: [PATCH 08/14] Rename `createGenericCardApiFactory` to `getGenericCardApiFactory` and update UML diagram to reflect changes. --- build.gradle.kts | 2 +- .../eclipse/keyple/card/generic/GenericExtensionService.java | 2 +- src/main/uml/api_class_diagram.puml | 2 +- src/main/uml/api_class_diagram.svg | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 870d4e2..cb7b428 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,10 +16,10 @@ plugins { dependencies { implementation("org.eclipse.keypop:keypop-reader-java-api:2.1.0") implementation("org.eclipse.keypop:keypop-card-java-api:2.0.1") + implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") { isChanging = true} implementation("org.eclipse.keyple:keyple-common-java-api:2.0.2") implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.1") implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.1") - implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") { isChanging = true} compileOnly("org.slf4j:slf4j-api:1.7.36") testImplementation(platform("org.junit:junit-bom:5.10.2")) diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java index 895ecc9..c7d133c 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java @@ -45,7 +45,7 @@ public static GenericExtensionService getInstance() { * @return A not null reference. * @since 4.0.0 */ - public GenericCardApiFactory createGenericCardApiFactory() { + public GenericCardApiFactory getGenericCardApiFactory() { return new GenericCardApiFactoryAdapter(); } diff --git a/src/main/uml/api_class_diagram.puml b/src/main/uml/api_class_diagram.puml index 83d6a1e..55fc2e4 100644 --- a/src/main/uml/api_class_diagram.puml +++ b/src/main/uml/api_class_diagram.puml @@ -66,7 +66,7 @@ package "org.eclipse.keyple.card.generic" as generic { -- +{static} GenericExtensionService getInstance () - +GenericCardApiFactory createGenericCardApiFactory() + +GenericCardApiFactory getGenericCardApiFactory() +CardResourceProfileExtension createCardResourceProfileExtension (IsoCardSelector cardSelector, GenericCardSelectionExtension genericCardSelectionExtension) -- **KeypleCardExtension** -- diff --git a/src/main/uml/api_class_diagram.svg b/src/main/uml/api_class_diagram.svg index d95050a..e6aeb1f 100644 --- a/src/main/uml/api_class_diagram.svg +++ b/src/main/uml/api_class_diagram.svg @@ -1 +1 @@ -Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Colors legend:External API references:keypop-reader-java-apikeyple-common-java-apikeyple-service-resource-java-libkeypop-genericcard-jvm-apiorg.eclipse.keyple.card.generic<<KeypleCardExtension>>finalGenericExtensionServiceGenericExtensionService getInstance () GenericCardFactoryApicreateGenericCardApiFactory()CardResourceProfileExtensioncreateCardResourceProfileExtension (IsoCardSelectorcardSelector,GenericCardSelectionExtensiongenericCardSelectionExtension) String getCommonApiVersion ()String getReaderApiVersion ()String getCardApiVersion ()KeypleCardExtension \ No newline at end of file +Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Keyple - keyple-card-generic-java-lib - 4.0+ (2026-03-11)Colors legend:External API references:keypop-reader-java-apikeyple-common-java-apikeyple-service-resource-java-libkeypop-genericcard-jvm-apiorg.eclipse.keyple.card.generic<<KeypleCardExtension>>finalGenericExtensionServiceGenericExtensionService getInstance () GenericCardApiFactorygetGenericCardApiFactory()CardResourceProfileExtensioncreateCardResourceProfileExtension (IsoCardSelectorcardSelector,GenericCardSelectionExtensiongenericCardSelectionExtension) String getCommonApiVersion ()String getReaderApiVersion ()String getCardApiVersion ()KeypleCardExtension \ No newline at end of file From 41569329fc6c2674c23739f72063dc01802686ca Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:11:36 +0100 Subject: [PATCH 09/14] Unmark `keypop-genericcard-jvm-api` dependency as changing. --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index cb7b428..9ce06b6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { dependencies { implementation("org.eclipse.keypop:keypop-reader-java-api:2.1.0") implementation("org.eclipse.keypop:keypop-card-java-api:2.0.1") - implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0-SNAPSHOT") { isChanging = true} + implementation("org.eclipse.keypop:keypop-genericcard-jvm-api:1.0.0") implementation("org.eclipse.keyple:keyple-common-java-api:2.0.2") implementation("org.eclipse.keyple:keyple-service-resource-java-lib:3.1.1") implementation("org.eclipse.keyple:keyple-util-java-lib:2.4.1") From c11abda9838eb7523604b7e8fbd971a230776444 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:13:15 +0100 Subject: [PATCH 10/14] Add Javadoc for `getGenericCardApiFactory` method in `GenericExtensionService`. --- .../org/eclipse/keyple/card/generic/GenericExtensionService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java index c7d133c..4cc9b21 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java @@ -42,6 +42,7 @@ public static GenericExtensionService getInstance() { } /** + * Returns an instance of {@link GenericCardApiFactory}. * @return A not null reference. * @since 4.0.0 */ From 04c441e712d0a1384c1a088f51c0d5c54a14cbe9 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:18:13 +0100 Subject: [PATCH 11/14] Add Javadoc comments to `GenericCardApiFactoryAdapter` class and methods --- .../generic/GenericCardApiFactoryAdapter.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java index c8cdfd2..a00bb04 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericCardApiFactoryAdapter.java @@ -17,13 +17,28 @@ import org.eclipse.keypop.reader.CardReader; import org.eclipse.keypop.reader.selection.spi.SmartCard; -public class GenericCardApiFactoryAdapter implements GenericCardApiFactory { +/** + * Adapter of {@link GenericCardApiFactory}. + * + * @since 4.0.0 + */ +class GenericCardApiFactoryAdapter implements GenericCardApiFactory { + /** + * {@inheritDoc} + * + * @since 4.0.0 + */ @Override public GenericCardSelectionExtension createGenericCardSelectionExtension() { return new GenericCardSelectionExtensionAdapter(); } + /** + * {@inheritDoc} + * + * @since 4.0.0 + */ @Override public CardTransactionManager createCardTransaction(CardReader cardReader, SmartCard card) { return new CardTransactionManagerAdapter(cardReader, card); From 8201dc6ffeb29142a3f0d83e11eec94ca6820ceb Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:30:04 +0100 Subject: [PATCH 12/14] Update changelog and Javadoc to reflect changes in Keypop Generic Card API and remove deprecated components --- CHANGELOG.md | 7 +++++++ src/main/javadoc/overview.html | 14 +++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96b6a4b..4076863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Added Keypop Generic Card API + +### Remove +- Removed deprecated enum `ChannelControl` +- Removed deprecated class `TransactionException` + ## [3.2.1] - 2026-02-20 ### Changed - Normalized logging and error messages using Keyple coding standards. diff --git a/src/main/javadoc/overview.html b/src/main/javadoc/overview.html index 59c1336..a587145 100644 --- a/src/main/javadoc/overview.html +++ b/src/main/javadoc/overview.html @@ -10,17 +10,9 @@

Overview

  • - Creation of a selection case targeting a specific card to be provided to the Keyple Selection - Service.
    - {@link org.eclipse.keyple.card.generic.GenericExtensionService#createGenericCardSelectionExtension()}
    - A selection case targets a specific card defined by various filtering options including the expected successful - status words. -
  • -
  • - Card transaction manager to perform APDU exchanges with a card.
    - {@link org.eclipse.keyple.card.generic.GenericExtensionService#createCardTransaction(CardReader reader, - SmartCard card)} + Use {@link org.eclipse.keyple.card.generic.GenericExtensionService#getGenericCardApiFactory()} to retrieve the + factory to create the various instance of classes used to manage ISO/IEC 7816 cards.
- + \ No newline at end of file From 988e33dfd2c9ebb426a58617fef4ffae3fea3c2c Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:35:27 +0100 Subject: [PATCH 13/14] Update changelog to reflect migration to `keypop-genericcard-jvm-api` 1.0.0 and removal of deprecated components --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4076863..47674ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed -- Added Keypop Generic Card API - -### Remove +- Migrated to `keypop-genericcard-jvm-api` 1.0.0 +### Removed - Removed deprecated enum `ChannelControl` - Removed deprecated class `TransactionException` From f4c17c6b3b91ce4982bb401d49796be9c58fd415 Mon Sep 17 00:00:00 2001 From: VincentDucrot Date: Thu, 12 Mar 2026 15:43:19 +0100 Subject: [PATCH 14/14] Spotless apply --- .../org/eclipse/keyple/card/generic/GenericExtensionService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java index 4cc9b21..d946a78 100644 --- a/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java +++ b/src/main/java/org/eclipse/keyple/card/generic/GenericExtensionService.java @@ -43,6 +43,7 @@ public static GenericExtensionService getInstance() { /** * Returns an instance of {@link GenericCardApiFactory}. + * * @return A not null reference. * @since 4.0.0 */