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

Commit f228088

Browse files
refactor: change signature design
1 parent 425d6f4 commit f228088

File tree

6 files changed

+57
-57
lines changed

6 files changed

+57
-57
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
/**
1919
* Common data to manage the security operations of a Calypso transaction.
2020
*
21-
* @param <T> The type of the lowest level child object.
21+
* @param <S> The type of the lowest level child object.
2222
* @since 1.2.0
2323
*/
24-
public interface CommonSecuritySetting<T extends CommonSecuritySetting<T>> {
24+
public interface CommonSecuritySetting<S extends CommonSecuritySetting<S>> {
2525

2626
/**
2727
* Defines the control SAM and the reader through which it is accessible to be used to handle the
@@ -34,7 +34,7 @@ public interface CommonSecuritySetting<T extends CommonSecuritySetting<T>> {
3434
* {@link CalypsoSam} is equal to {@link CalypsoSam.ProductType#UNKNOWN}.
3535
* @since 1.2.0
3636
*/
37-
T setControlSamResource(CardReader samReader, CalypsoSam calypsoSam);
37+
S setControlSamResource(CardReader samReader, CalypsoSam calypsoSam);
3838

3939
/**
4040
* Sets the service to be used to dynamically check if a SAM is revoked or not.
@@ -44,5 +44,5 @@ public interface CommonSecuritySetting<T extends CommonSecuritySetting<T>> {
4444
* @throws IllegalArgumentException If the provided service is null.
4545
* @since 1.2.0
4646
*/
47-
T setSamRevocationService(SamRevocationServiceSpi service);
47+
S setSamRevocationService(SamRevocationServiceSpi service);
4848
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
* Common service providing the high-level API to manage transactions with a Calypso card or SAM.
1818
*
1919
* @param <T> The type of the lowest level child object.
20-
* @param <E> The type of the lowest level child object of the associated {@link
20+
* @param <S> The type of the lowest level child object of the associated {@link
2121
* CommonSecuritySetting}.
2222
* @since 1.2.0
2323
*/
2424
public interface CommonTransactionManager<
25-
T extends CommonTransactionManager<T, E>, E extends CommonSecuritySetting<E>> {
25+
T extends CommonTransactionManager<T, S>, S extends CommonSecuritySetting<S>> {
2626

2727
/**
2828
* Returns the settings defining the security parameters of the transaction.
2929
*
3030
* @return Null if the transaction does not use security settings.
3131
* @since 1.2.0
3232
*/
33-
E getSecuritySetting();
33+
S getSecuritySetting();
3434

3535
/**
3636
* Returns the audit data of the transaction containing all APDU exchanges with the card and the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public interface SignatureComputationData {
5050
* <p>By default, the key diversification is performed with the full serial number of the target
5151
* card or SAM depending on the transaction context (Card or SAM transaction).
5252
*
53-
* @param diversifier The diversifier to be used (8 bytes long).
53+
* @param diversifier The diversifier to be used (from 1 to 8 bytes long).
5454
* @return The current instance.
5555
* @since 1.2.0
5656
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public interface SignatureVerificationData {
4040
* <p>By default, the key diversification is performed with the full serial number of the target
4141
* card or SAM depending on the transaction context (Card or SAM transaction).
4242
*
43-
* @param diversifier The diversifier to be used (8 bytes long).
43+
* @param diversifier The diversifier to be used (from 1 to 8 bytes long).
4444
* @return The current instance.
4545
* @since 1.2.0
4646
*/

src/main/uml/api_class_diagram.puml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ package "org.calypsonet.terminal.calypso" as api {
266266
}
267267
package transaction {
268268
' Common to Card and SAM
269-
+interface CommonTransactionManager<T extends CommonTransactionManager<T, E>,\nE extends CommonSecuritySetting<E>> {
270-
+E getSecuritySetting ()
269+
+interface CommonTransactionManager<T extends CommonTransactionManager<T, S>,\nS extends CommonSecuritySetting<S>> {
270+
+S getSecuritySetting ()
271271
+List<byte[]> getTransactionAuditData ()
272272

273273
+T prepareComputeSignature (SignatureComputationData data)
@@ -293,9 +293,9 @@ package "org.calypsonet.terminal.calypso" as api {
293293

294294
+boolean isSignatureValid ()
295295
}
296-
+interface CommonSecuritySetting<T extends CommonSecuritySetting<T>> {
297-
+T setControlSamResource (<back:yellow>CardReader</back> samReader, CalypsoSam calypsoSam)
298-
+T setSamRevocationServiceSpi (SamRevocationServiceSpi service)
296+
+interface CommonSecuritySetting<S extends CommonSecuritySetting<S>> {
297+
+S setControlSamResource (<back:yellow>CardReader</back> samReader, CalypsoSam calypsoSam)
298+
+S setSamRevocationServiceSpi (SamRevocationServiceSpi service)
299299
}
300300
' Card
301301
+interface CardTransactionManager extends CommonTransactionManager {

0 commit comments

Comments
 (0)