Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

Commit 1420062

Browse files
feat: add "SelectFileException" to manage the status of the "Select File" card command
1 parent e730569 commit 1420062

File tree

6 files changed

+135
-89
lines changed

6 files changed

+135
-89
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
- `prepareWriteEventCeiling`, `prepareWriteEventCeilings` methods to `SamTransactionManager` API (issue [#25])
1010
- `prepareReadEventCeiling`, `prepareReadEventCeilings` methods to `SamTransactionManager` and `getEventCeiling`, `getEventCeilings` methods to `CalypsoSam` API (issue [#26])
1111
- `prepareReadEventCounter`, `prepareReadEventCounters` methods to `SamTransactionManager` and `getEventCounter`, `getEventCounters` methods to `CalypsoSam` API (issue [#27])
12+
- `SelectFileException` to manage the status of the "Select File" card command.
1213
### Upgraded
1314
- "Calypsonet Terminal Reader API" to version `1.1.0`
1415

src/main/java/org/calypsonet/terminal/calypso/transaction/CardTransactionManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,8 @@ CardTransactionManager prepareDecreaseCounters(
915915
* @throws InvalidCardSignatureException If a secure session is open and multiple session mode is
916916
* enabled and an intermediate session is correctly closed but the card signature is
917917
* incorrect.
918+
* @throws SelectFileException If a "Select File" prepared card command indicated that the file
919+
* was not found.
918920
* @since 1.0.0
919921
* @deprecated Use {@link #processCommands()} instead.
920922
*/
@@ -1107,6 +1109,8 @@ CardTransactionManager processChangeKey(
11071109
* card signature.
11081110
* @throws InvalidCardSignatureException If multiple session mode is enabled and an intermediate
11091111
* session is correctly closed but the card signature is incorrect.
1112+
* @throws SelectFileException If a "Select File" prepared card command indicated that the file
1113+
* was not found.
11101114
* @since 1.0.0
11111115
*/
11121116
CardTransactionManager processOpening(WriteAccessLevel writeAccessLevel);

src/main/java/org/calypsonet/terminal/calypso/transaction/CommonTransactionManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ public interface CommonTransactionManager<
109109
* @throws InvalidCardSignatureException If a secure session is open and multiple session mode is
110110
* enabled and an intermediate session is correctly closed but the card signature is
111111
* incorrect.
112+
* @throws SelectFileException If a "Select File" prepared card command indicated that the file
113+
* was not found.
112114
* @since 1.2.0
113115
*/
114116
T processCommands();
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* **************************************************************************************
2+
* Copyright (c) 2022 Calypso Networks Association https://calypsonet.org/
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional information
5+
* regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the terms of the
8+
* Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0
9+
*
10+
* SPDX-License-Identifier: EPL-2.0
11+
************************************************************************************** */
12+
package org.calypsonet.terminal.calypso.transaction;
13+
14+
/**
15+
* Indicates that the file selection failed because it was not found. This can happen in the
16+
* following cases:
17+
*
18+
* <ul>
19+
* <li>The "Select File" card command status is 6A82h;
20+
* </ul>
21+
*
22+
* @since 1.4.0
23+
*/
24+
public class SelectFileException extends RuntimeException {
25+
26+
/**
27+
* Encapsulates a lower level exception.
28+
*
29+
* @param message Message to identify the exception context.
30+
* @param cause The cause.
31+
* @since 1.4.0
32+
*/
33+
public SelectFileException(String message, Throwable cause) {
34+
super(message, cause);
35+
}
36+
}

src/main/uml/api_class_diagram.puml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@startuml
22
title
3-
Calypsonet - calypsonet-terminal-calypso-java-api - 1.4.+ (2022-10-10)
3+
Calypsonet - calypsonet-terminal-calypso-java-api - 1.4.+ (2022-10-19)
44
end title
55

66
' == THEME ==
@@ -441,6 +441,7 @@ package "org.calypsonet.terminal.calypso" as api {
441441
+**InvalidSignatureException**: R-APDU of PSO Verify Signature = 6988.
442442
+**InvalidCardSignatureException**: R-APDU of DigestAuthenticate = 6988 **or** R-APDU of SvCheck = 6988.
443443
+**CardSignatureNotVerifiableException**: R-APDU of CloseSecureSession = 9000 but SAM is no more available.
444+
+**SelectFileException**: R-APDU of SelectFile = 6A82.
444445
+**UnexpectedCommandStatusException**
445446
+**ReaderIOException**: Card reader and/or SAM reader communication is broken.
446447
+**CardIOException**

0 commit comments

Comments
 (0)