Interface CommonTransactionManager<T extends CommonTransactionManager<T,S>,S extends CommonSecuritySetting<S>>
-
- Type Parameters:
T
- The type of the lowest level child object.S
- The type of the lowest level child object of the associatedCommonSecuritySetting
.
- All Known Subinterfaces:
CardTransactionManager
,SamTransactionManager
public interface CommonTransactionManager<T extends CommonTransactionManager<T,S>,S extends CommonSecuritySetting<S>>
Common service providing the high-level API to manage transactions with a Calypso card or SAM.- Since:
- 1.2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description S
getSecuritySetting()
Deprecated.Useless accessor (will be soon removed).java.util.List<byte[]>
getTransactionAuditData()
Returns the audit data of the transaction containing all APDU exchanges with the card and the SAM.T
prepareComputeSignature(CommonSignatureComputationData<?> data)
Schedules the execution of a "Data Cipher" or "PSO Compute Signature" SAM command.T
prepareVerifySignature(CommonSignatureVerificationData<?> data)
Schedules the execution of a "Data Cipher" or "PSO Verify Signature" SAM command.T
processCommands()
Process all previously prepared commands.
-
-
-
Method Detail
-
getSecuritySetting
@Deprecated S getSecuritySetting()
Deprecated.Useless accessor (will be soon removed).Returns the settings defining the security parameters of the transaction.- Returns:
- Null if the transaction does not use security settings.
- Since:
- 1.2.0
-
getTransactionAuditData
java.util.List<byte[]> getTransactionAuditData()
Returns the audit data of the transaction containing all APDU exchanges with the card and the SAM.- Returns:
- An empty list if there is no audit data.
- Since:
- 1.2.0
-
prepareComputeSignature
T prepareComputeSignature(CommonSignatureComputationData<?> data)
Schedules the execution of a "Data Cipher" or "PSO Compute Signature" SAM command.Once the command is processed, the result will be available in the provided input/output
BasicSignatureComputationData
orTraceableSignatureComputationData
objects.The signature may be used for many purposes, for example:
- To add a signature to data recorded in a contactless card or ticket.
Remark: to speed up processing, it is recommended to use a constant signing key (which is not diversified before ciphering). Instead, the serial number of the card or ticket should be inserted at the beginning of the data to sign. - To sign some data reported from a terminal to a central system.
Remark: in this case, the terminal SAM contains a signing work key diversified with its own serial number, guarantying that the data has indeed been signed by this SAM. The central system SAM uses the master signing key, diversified before signing with the diversifier set previously by "Select Diversifier" command.
- Parameters:
data
- The input/output data containing the parameters of the command.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException
- If the input data is inconsistent.- Since:
- 1.2.0
- See Also:
CommonSignatureComputationData
,BasicSignatureComputationData
,TraceableSignatureComputationData
- To add a signature to data recorded in a contactless card or ticket.
-
prepareVerifySignature
T prepareVerifySignature(CommonSignatureVerificationData<?> data)
Schedules the execution of a "Data Cipher" or "PSO Verify Signature" SAM command.Once the command is processed, the result will be available in the provided input/output
BasicSignatureVerificationData
orTraceableSignatureVerificationData
objects.- Parameters:
data
- The input/output data containing the parameters of the command.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException
- If the input data is inconsistent.SamRevokedException
- If the signature has been computed in "SAM traceability" mode and the SAM revocation status check has been requested and the SAM is revoked (for traceable signature only).- Since:
- 1.2.0
- See Also:
CommonSignatureVerificationData
,BasicSignatureVerificationData
,TraceableSignatureVerificationData
-
processCommands
T processCommands()
Process all previously prepared commands.- Returns:
- The current instance.
- Throws:
ReaderIOException
- If a communication error with the card reader or SAM reader occurs.CardIOException
- If a communication error with the card occurs.SamIOException
- If a communication error with the SAM occurs.InvalidSignatureException
- If a signature associated to a prepared signature verification SAM command is invalid.UnexpectedCommandStatusException
- If a command returns an unexpected status.InconsistentDataException
- If inconsistent data have been detected.SessionBufferOverflowException
- If a secure session is open and multiple session mode is disabled and the session buffer capacity is not sufficient.CardSignatureNotVerifiableException
- If a secure session is open and multiple session mode is enabled and an intermediate session is correctly closed but the SAM is no longer available to verify the card signature.InvalidCardSignatureException
- If a secure session is open and multiple session mode is enabled and an intermediate session is correctly closed but the card signature is incorrect.SelectFileException
- If a "Select File" prepared card command indicated that the file was not found.- Since:
- 1.2.0
-
-