Package org.eclipse.keyple.card.generic
Interface GenericCardSelection
-
- All Superinterfaces:
org.calypsonet.terminal.reader.selection.spi.CardSelection
public interface GenericCardSelection extends org.calypsonet.terminal.reader.selection.spi.CardSelectionCard specificCardSelectionproviding means to filter cards, select applications.- Since:
- 2.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGenericCardSelection.FileControlInformationTypes of templates available in return for the Select Application command, according to the ISO7816-4 standard.static classGenericCardSelection.FileOccurrenceNavigation options through the different applications contained in the card according to the ISO7816-4 standard.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GenericCardSelectionaddSuccessfulStatusWord(int statusWord)Adds a status word to the list of those that should be considered successful for the Select Application APDU.GenericCardSelectionfilterByCardProtocol(java.lang.String cardProtocol)Requests a protocol-based filtering by defining an expected card.GenericCardSelectionfilterByDfName(byte[] aid)Requests a DF Name-based filtering by defining in a byte array the AID that will be included in the standard SELECT APPLICATION command sent to the card during the selection process.GenericCardSelectionfilterByDfName(java.lang.String aid)Requests a DF Name-based filtering by defining in a hexadecimal string the AID that will be included in the standard SELECT APPLICATION command sent to the card during the selection process.GenericCardSelectionfilterByPowerOnData(java.lang.String powerOnDataRegex)Requests a power-on data-based filtering by defining a regular expression that will be applied to the card's power-on data.GenericCardSelectionsetFileControlInformation(GenericCardSelection.FileControlInformation fileControlInformation)Sets the file control mode (see ISO7816-4).GenericCardSelectionsetFileOccurrence(GenericCardSelection.FileOccurrence fileOccurrence)Sets the file occurrence mode (see ISO7816-4).
-
-
-
Method Detail
-
filterByCardProtocol
GenericCardSelection filterByCardProtocol(java.lang.String cardProtocol)
Requests a protocol-based filtering by defining an expected card.If the card protocol is set, only cards using that protocol will match the card selector.
- Parameters:
cardProtocol- A not empty String.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If the argument is null or empty.- Since:
- 2.0.0
-
filterByPowerOnData
GenericCardSelection filterByPowerOnData(java.lang.String powerOnDataRegex)
Requests a power-on data-based filtering by defining a regular expression that will be applied to the card's power-on data.If it is set, only the cards whose power-on data is recognized by the provided regular expression will match the card selector.
- Parameters:
powerOnDataRegex- A valid regular expression- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If the provided regular expression is null, empty or invalid.- Since:
- 2.0.0
-
filterByDfName
GenericCardSelection filterByDfName(byte[] aid)
Requests a DF Name-based filtering by defining in a byte array the AID that will be included in the standard SELECT APPLICATION command sent to the card during the selection process.The provided AID can be a right truncated image of the target DF Name (see ISO 7816-4 4.2).
- Parameters:
aid- A byte array containing 5 to 16 bytes.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If the provided array is null or out of range.- Since:
- 2.0.0
-
filterByDfName
GenericCardSelection filterByDfName(java.lang.String aid)
Requests a DF Name-based filtering by defining in a hexadecimal string the AID that will be included in the standard SELECT APPLICATION command sent to the card during the selection process.The provided AID can be a right truncated image of the target DF Name (see ISO 7816-4 4.2).
- Parameters:
aid- A hexadecimal string representation of 5 to 16 bytes.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If the provided AID is null, invalid or out of range.- Since:
- 2.0.0
-
setFileOccurrence
GenericCardSelection setFileOccurrence(GenericCardSelection.FileOccurrence fileOccurrence)
Sets the file occurrence mode (see ISO7816-4).The default value is
GenericCardSelection.FileOccurrence.FIRST.- Parameters:
fileOccurrence- TheGenericCardSelection.FileOccurrence.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If fileOccurrence is null.- Since:
- 2.0.0
-
setFileControlInformation
GenericCardSelection setFileControlInformation(GenericCardSelection.FileControlInformation fileControlInformation)
Sets the file control mode (see ISO7816-4).The default value is
GenericCardSelection.FileControlInformation.FCI.- Parameters:
fileControlInformation- TheGenericCardSelection.FileControlInformation.- Returns:
- The current instance.
- Throws:
java.lang.IllegalArgumentException- If fileControlInformation is null.- Since:
- 2.0.0
-
addSuccessfulStatusWord
GenericCardSelection addSuccessfulStatusWord(int statusWord)
Adds a status word to the list of those that should be considered successful for the Select Application APDU.Note: initially, the list contains the standard successful status word
9000h.- Parameters:
statusWord- A positive int ≤FFFFh.- Returns:
- The current instance.
- Since:
- 2.0.0
-
-