Class LegacySamUtil
- java.lang.Object
-
- org.eclipse.keyple.card.calypso.crypto.legacysam.LegacySamUtil
-
public final class LegacySamUtil extends java.lang.Object
Util to help with Legacy SAM specificities.- Since:
- 0.4.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
buildPowerOnDataFilter(org.eclipse.keypop.calypso.crypto.legacysam.sam.LegacySam.ProductType productType, java.lang.String serialNumberRegex)
Create a regular expression to be used as "Power on data" filter in the selection process.
-
-
-
Method Detail
-
buildPowerOnDataFilter
public static java.lang.String buildPowerOnDataFilter(org.eclipse.keypop.calypso.crypto.legacysam.sam.LegacySam.ProductType productType, java.lang.String serialNumberRegex)
Create a regular expression to be used as "Power on data" filter in the selection process.Two criteria are available:
- A filter to target SAMs having a specific
LegacySam.ProductType
. - A filter to target SAMs having a serial number matching a specific regular expression.
Concerning the serial number, the regular expression is based on a hexadecimal representation of the 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".
Both argument are optional and can be null.
- Parameters:
productType
- The target SAM product type.serialNumberRegex
- A regular expression matching the SAM serial number.- Returns:
- A not empty string containing a regular
- Throws:
java.lang.IllegalArgumentException
- If productType is null.java.lang.IllegalArgumentException
- If serialNumberRegex is null, empty or invalid.- Since:
- 0.4.0
- A filter to target SAMs having a specific
-
-