public class CalypsoPo
extends org.eclipse.keyple.core.card.selection.AbstractSmartCard
An instance of CalypsoPo is obtained by casting the AbstractSmartCard object from the selection process (e.g. (CalypsoPo)(cardSelectionsResult.getActiveSmartCard()))
The various information contained in CalypsoPo is accessible by getters and includes:
PoTransaction
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.Byte,ElementaryFile> |
getAllFiles()
Gets a reference to a map of all known Elementary Files by their associated SFI.
Note that if a secure session is actually running, then the map contains all session modifications, which can be canceled if the secure session fails. |
java.lang.String |
getApplicationSerialNumber()
Gets the Calypso application serial number as an HEX String.
|
byte[] |
getApplicationSerialNumberBytes()
Gets the Calypso application serial number as an array of bytes.
|
byte |
getApplicationSubtype()
The Application Subtype indicates to the terminal a reference to the file structure of the
Calypso DF.
|
byte |
getApplicationType()
The Application Type byte determines the Calypso Revision and various options
|
java.lang.String |
getAtr()
Get the Answer To Reset as an HEX String.
|
protected byte[] |
getCalypsoSerialNumber()
Gets the full Calypso serial number including the possible validity date information in the two
MSB.
|
java.lang.String |
getDfName()
Gets the DF name as an HEX String.
|
byte[] |
getDfNameBytes()
Gets the DF name as an array of bytes.
|
DirectoryHeader |
getDirectoryHeader()
Gets the DF metadata.
|
ElementaryFile |
getFileByLid(short lid)
Gets a reference to the
ElementaryFile that has the provided LID value.Note that if a secure session is actually running, then the object contains all session modifications, which can be canceled if the secure session fails. |
ElementaryFile |
getFileBySfi(byte sfi)
Gets a reference to the
ElementaryFile that has the provided SFI value.Note that if a secure session is actually running, then the object contains all session modifications, which can be canceled if the secure session fails. |
protected int |
getModificationsCounter()
Indicates the maximum number of changes allowed in session.
|
protected int |
getPayloadCapacity()
Gets the maximum length of data that an APDU in this PO can carry.
|
int |
getPinAttemptRemaining()
Gives the number of erroneous PIN presentations remaining before blocking.
|
byte |
getPlatform()
The platform identification byte is the reference of the chip
|
protected PoClass |
getPoClass()
The PO class is the ISO7816 class to be used with the current PO.
|
PoRevision |
getRevision()
Gets the PO revision.
|
protected byte[] |
getSerialNumberExpirationBytes() |
byte |
getSessionModification()
Get the session modification byte from the startup info structure.
|
byte |
getSoftwareIssuer()
The Software Issuer byte indicates the entity responsible for the software of the selected
application.
|
byte |
getSoftwareRevision()
The Software Revision field may be set to any fixed value by the Software Issuer of the Calypso
application.
|
byte |
getSoftwareVersion()
The Software Version field may be set to any fixed value by the Software Issuer of the Calypso
application.
|
java.lang.String |
getStartupInfo()
Gets the Calypso startup information field as an HEX String
|
int |
getSvBalance()
Gets the current SV balance value
|
java.util.List<SvDebitLogRecord> |
getSvDebitLogAllRecords()
Gets list of references to the
SvDebitLogRecord read from the PO. |
SvDebitLogRecord |
getSvDebitLogLastRecord()
Gets a reference to the last
SvDebitLogRecord |
int |
getSvLastTNum()
Gets the last SV transaction number
|
SvLoadLogRecord |
getSvLoadLogRecord()
Gets a reference to the last
SvLoadLogRecord |
boolean |
isConfidentialSessionModeSupported()
Indicates whether the Confidential Session Mode is supported or not (since rev 3.2).
|
boolean |
isDeselectRatificationSupported()
Indicates if the ratification is done on deselect (ratification command not necessary)
|
boolean |
isDfInvalidated()
Tells if the PO has been invalidated or not.
|
boolean |
isDfRatified()
Tells if the last session with this PO has been ratified or not.
|
protected boolean |
isModificationsCounterInBytes()
Tells if the change counter allowed in session is established in number of operations or number
of bytes modified.
|
boolean |
isPinBlocked()
Indicates if the PIN is blocked.
|
boolean |
isPinFeatureAvailable()
Indicates whether the PO has the Calypso PIN feature.
|
boolean |
isPublicAuthenticationSupported()
Indicates whether the Public Authentication is supported or not (since rev 3.3).
|
protected boolean |
isSerialNumberExpiring() |
boolean |
isSvFeatureAvailable()
Indicates whether the PO has the Calypso Stored Value feature.
|
public final PoRevision getRevision()
The PO revision indicates the generation of the product presented.
It will also have an impact on the internal construction of some commands to take into account the specificities of the different POs.
public final byte[] getDfNameBytes()
The DF name is the name of the application DF as defined in ISO/IEC 7816-4.
It also corresponds to the complete representation of the target covered by the AID value provided in the selection command.
The AID selects the application by specifying all or part of the targeted DF Name (5 bytes minimum).
public final java.lang.String getDfName()
protected final byte[] getCalypsoSerialNumber()
The serial number to be used as diversifier for key derivation.
This is the complete number returned by the PO in its response to the Select command.
public final byte[] getApplicationSerialNumberBytes()
The serial number for the application, is unique ID for the PO.
The difference with getCalypsoSerialNumber is that the two possible bytes (MSB) of validity
date are here forced to zero.
public final java.lang.String getApplicationSerialNumber()
public final java.lang.String getStartupInfo()
protected final boolean isSerialNumberExpiring()
protected final byte[] getSerialNumberExpirationBytes()
public final java.lang.String getAtr()
The Answer To Reset is sent by the PO is ISO7816-3 mode and in contactless mode for PC/SC readers.
When the ATR is obtained in contactless mode, it is in fact reconstructed by the reader from information obtained from the lower communication layers.Therefore, it may differ from one reader to another depending on the interpretation that has been made by the manufacturer of the PC/SC standard.
This field is not interpreted in the Calypso module.
java.lang.IllegalStateException - if the ATR is not available (see hasAtr() method)protected final int getPayloadCapacity()
protected final boolean isModificationsCounterInBytes()
This varies depending on the revision of the PO.
protected final int getModificationsCounter()
This number can be a number of operations or a number of commands (see isModificationsCounterInBytes)
public final byte getPlatform()
public final byte getApplicationType()
public final boolean isConfidentialSessionModeSupported()
This boolean is interpreted from the Application Type byte
public final boolean isDeselectRatificationSupported()
This boolean is interpreted from the Application Type byte
public final boolean isSvFeatureAvailable()
This boolean is interpreted from the Application Type byte
public final boolean isPinFeatureAvailable()
This boolean is interpreted from the Application Type byte
public final boolean isPublicAuthenticationSupported()
This boolean is interpreted from the Application Type byte
public final byte getApplicationSubtype()
public final byte getSoftwareIssuer()
public final byte getSoftwareVersion()
public final byte getSoftwareRevision()
public final byte getSessionModification()
Depending on the type of PO, the session modification byte indicates the maximum number of bytes that can be modified or the number of possible write commands in a session.
public final boolean isDfInvalidated()
An invalidated PO has 6283 as status word in response to the Select Application command.
public final boolean isDfRatified()
java.lang.IllegalStateException - if these methods is call when no session has been openedpublic final int getSvBalance()
java.lang.IllegalStateException - if no SV Get command has been executedpublic final int getSvLastTNum()
java.lang.IllegalStateException - if no SV Get command has been executedpublic final SvLoadLogRecord getSvLoadLogRecord()
SvLoadLogRecordjava.util.NoSuchElementException - if requested log is not found.public final SvDebitLogRecord getSvDebitLogLastRecord()
SvDebitLogRecordjava.util.NoSuchElementException - if requested log is not found.public final java.util.List<SvDebitLogRecord> getSvDebitLogAllRecords()
SvDebitLogRecord read from the PO.java.util.NoSuchElementException - if requested log is not found.protected final PoClass getPoClass()
It determined from the PO revision
Two classes are possible: LEGACY and ISO.
public final DirectoryHeader getDirectoryHeader()
public final ElementaryFile getFileBySfi(byte sfi)
ElementaryFile that has the provided SFI value.sfi - the SFI to searchjava.util.NoSuchElementException - if requested EF is not found.public final ElementaryFile getFileByLid(short lid)
ElementaryFile that has the provided LID value.lid - the LID to searchjava.util.NoSuchElementException - if requested EF is not found.public final java.util.Map<java.lang.Byte,ElementaryFile> getAllFiles()
public final boolean isPinBlocked()
java.lang.IllegalStateException - if the PIN has not been checkedpublic final int getPinAttemptRemaining()
java.lang.IllegalStateException - if the PIN has not been checked