Interface CalypsoSamSelection
-
- All Superinterfaces:
org.calypsonet.terminal.reader.selection.spi.CardSelection
public interface CalypsoSamSelection extends org.calypsonet.terminal.reader.selection.spi.CardSelection
SAM specificCardSelection
providing means to filter SAM and define optional commands to be executed during the selection phase such as the Unlock command.- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CalypsoSamSelection
filterByProductType(CalypsoSam.ProductType productType)
Sets a filter to target a SAM having the provided specificCalypsoSam.ProductType
.CalypsoSamSelection
filterBySerialNumber(java.lang.String serialNumberRegex)
Sets a filter targeting a SAM having a serial number matching the provided regular expression.CalypsoSamSelection
setUnlockData(java.lang.String unlockData)
Sets the lock value expected by the SAM to be unlocked (8 or 16 bytes).
-
-
-
Method Detail
-
filterByProductType
CalypsoSamSelection filterByProductType(CalypsoSam.ProductType productType)
Sets a filter to target a SAM having the provided specificCalypsoSam.ProductType
.If not specified, any type is accepted.
- Parameters:
productType
- The SAM product type.- Returns:
- The object instance.
- Throws:
java.lang.IllegalArgumentException
- If productType is null.- Since:
- 1.0.0
-
filterBySerialNumber
CalypsoSamSelection filterBySerialNumber(java.lang.String serialNumberRegex)
Sets a filter targeting a SAM having a serial number matching the provided regular expression.If set, only a SAM with a serial number matching the provided filter will be selected.
The filter is regular expression that will be applied to the real serial number.The regular expression is based on an hexadecimal representation of the serial number.
Example:
- A filter targeting all SAMs having an 8-byte serial number starting with A0h would be "^A0.{6}$".
- A filter targeting a SAM having the exact serial number 12345678h would be "12345678".
- Parameters:
serialNumberRegex
- A regular expression.- Returns:
- The object instance.
- Throws:
java.lang.IllegalArgumentException
- If samSerialNumberRegex is null, empty or invalid.- Since:
- 1.0.0
-
setUnlockData
CalypsoSamSelection setUnlockData(java.lang.String unlockData)
Sets the lock value expected by the SAM to be unlocked (8 or 16 bytes).The Unlock command will be executed only after a successful filtering.
- Parameters:
unlockData
- A hexadecimal representation of the 16 or 32 digit long unlock value.- Returns:
- The object instance.
- Throws:
java.lang.IllegalArgumentException
- If unlockData is null, malformed or out of range.- Since:
- 1.0.0
-
-