Interface CalypsoCard
- All Superinterfaces:
org.eclipse.keypop.reader.selection.spi.IsoSmartCard
,org.eclipse.keypop.reader.selection.spi.SmartCard
IsoSmartCard
interface of the "Keypop Reader API" to provide additional
functionality specific to Calypso cards.
An instance of CalypsoCard
is obtained by casting the IsoSmartCard
object from
the selection process defined by the "Keypop Reader API".
It is a dynamic view of the card's content, regularly updated from the selection stage to the end of the transaction.
The various information contained in CalypsoCard includes:
- The application identification fields (revision/version, class, DF name, serial number, ATR, issuer)
- The indication of the presence of optional features (Stored Value, PIN, Rev3.2 mode, ratification management)
- The management information of the modification buffer
- The invalidation status
- The files, counters, SV data read or modified during the execution of the processes defined by the card transaction manager.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
All Calypso Card products supported by this API. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Gets the Calypso application serial number as an array of bytes.byte
Gets the Application Subtype that provides a reference to the file structure of the Calypso DF.byte
Gets the Application Type byte which determines the Calypso product type and various options.byte[]
Returns the CA certificate.byte[]
Returns the card certificate.byte[]
Returns the card public key.byte[]
Gets the DF name as an array of bytes.Returns the metadata of the current DF.getFileByLid
(short lid) Returns a reference to theElementaryFile
that has the provided LID value.getFileBySfi
(byte sfi) Returns a reference to theElementaryFile
that has the provided SFI.getFiles()
Returns a reference to the set of all known Elementary Files contains inside the current DF.int
Gives the number of erroneous PIN presentations remaining before blocking.byte
Gets the platform identification byte which is the reference of the chip.Gets the card product type.byte
Gets the session modification byte from the startup info structure.byte
Gets the Software Issuer byte that indicates the entity responsible for the software of the selected application.byte
Gets the Software Revision field that may be set to any fixed value by the Software Issuer of the Calypso application.byte
Gets the Software Version field that may be set to any fixed value by the Software Issuer of the Calypso application.byte[]
Gets the raw Calypso startup information.int
Gets the current SV balance valueGets list of references to theSvDebitLogRecord
read from the card.Gets a reference to the lastSvDebitLogRecord
int
Gets the last SV transaction numberGets a reference to the lastSvLoadLogRecord
byte[]
Gets the traceability information of the product.int
Returns the transaction counter value provided in the output data of the last successful "Open Secure Session" command.boolean
Tells if the current DF is invalidated or not.boolean
Tells if the last session with this card has been ratified or not.boolean
Indicates whether the Extended Mode is supported or not (since rev 3.2).boolean
isHce()
Indicates if the card is a Calypso HCE (Host Card Emulation) .boolean
Indicates if the PIN is blocked.boolean
Indicates whether the card has the Calypso PIN feature.boolean
Indicates whether the Public Key Authentication is supported or not (since rev 3.3).boolean
Indicates if the ratification is done on deselect (ratification command not necessary).boolean
Indicates whether the card has the Calypso Stored Value feature.Methods inherited from interface org.eclipse.keypop.reader.selection.spi.IsoSmartCard
getSelectApplicationResponse
Methods inherited from interface org.eclipse.keypop.reader.selection.spi.SmartCard
getPowerOnData
-
Method Details
-
getProductType
CalypsoCard.ProductType getProductType()Gets the card product type.- Returns:
- A non-null reference.
- Since:
- 1.0.0
-
isHce
boolean isHce()Indicates if the card is a Calypso HCE (Host Card Emulation) .- Returns:
- True if the card is a Calypso HCE.
- Since:
- 1.0.0
-
isDfInvalidated
boolean isDfInvalidated()Tells if the current DF is invalidated or not.The invalidation status is determined either from the response to the Select Application command or from the response to a Select File (DF) command.
For a PRIME_REVISION_3 card, a 6283h status word is returned in response to the Select Application command when the corresponding DF is invalidated.
For older Calypso cards it may be necessary to execute a Select File command in order to determine the invalidation status.
- Returns:
- True if the current DF has been invalidated.
- Since:
- 1.0.0
-
getDfName
byte[] getDfName()Gets the DF name as an array of bytes.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).
- Returns:
- A non-null byte array containing the DF Name bytes (5 to 16 bytes).
- Since:
- 1.0.0
-
getApplicationSerialNumber
byte[] getApplicationSerialNumber()Gets the Calypso application serial number as an array of bytes.- Returns:
- A non-null byte array containing the Application Serial Number (8 bytes).
- Since:
- 1.0.0
-
getStartupInfoRawData
byte[] getStartupInfoRawData()Gets the raw Calypso startup information.- Returns:
- A non-null byte array.
- Since:
- 1.0.0
-
getPlatform
byte getPlatform()Gets the platform identification byte which is the reference of the chip.- Returns:
- The platform identification byte.
- Since:
- 1.0.0
-
getApplicationType
byte getApplicationType()Gets the Application Type byte which determines the Calypso product type and various options.- Returns:
- The Application Type byte.
- Since:
- 1.0.0
-
getApplicationSubtype
byte getApplicationSubtype()Gets the Application Subtype that provides a reference to the file structure of the Calypso DF.- Returns:
- The Application Subtype byte
- Since:
- 1.0.0
-
getSoftwareIssuer
byte getSoftwareIssuer()Gets the Software Issuer byte that indicates the entity responsible for the software of the selected application.- Returns:
- The Software Issuer byte.
- Since:
- 1.0.0
-
getSoftwareVersion
byte getSoftwareVersion()Gets the Software Version field that may be set to any fixed value by the Software Issuer of the Calypso application.- Returns:
- The Software Version byte.
- Since:
- 1.0.0
-
getSoftwareRevision
byte getSoftwareRevision()Gets the Software Revision field that may be set to any fixed value by the Software Issuer of the Calypso application.- Returns:
- The Software Revision byte.
- Since:
- 1.0.0
-
getSessionModification
byte getSessionModification()Gets the session modification byte from the startup info structure.Depending on the type of card, the session modification byte indicates the maximum number of bytes that can be modified or the number of possible write commands in a session.
- Returns:
- The Session Modification byte.
- Since:
- 1.0.0
-
getTraceabilityInformation
byte[] getTraceabilityInformation()Gets the traceability information of the product.The returned array contains the software issuer ID and the discretionary data.
- Returns:
- An empty array if the traceability information is not available.
- Since:
- 1.1.0
- See Also:
-
getCardPublicKey
byte[] getCardPublicKey()Returns the card public key.- Returns:
- An empty array if the public key is not available.
- Since:
- 2.1.0
- See Also:
-
getCardCertificate
byte[] getCardCertificate()Returns the card certificate.- Returns:
- An empty array if the public key is not available.
- Since:
- 2.1.0
- See Also:
-
getCaCertificate
byte[] getCaCertificate()Returns the CA certificate.- Returns:
- An empty array if the public key is not available.
- Since:
- 2.1.0
- See Also:
-
getDirectoryHeader
DirectoryHeader getDirectoryHeader()Returns the metadata of the current DF.- Returns:
- Null if is not set.
- Since:
- 1.0.0
- See Also:
-
getFileBySfi
Returns a reference to theElementaryFile
that has the provided SFI.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.
- Parameters:
sfi
- The SFI to search.- Returns:
- Null if the requested EF is not found or if the SFI is equal to 0.
- Since:
- 1.0.0
-
getFileByLid
Returns a reference to theElementaryFile
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.
- Parameters:
lid
- The LID to search.- Returns:
- Null if the requested EF is not found.
- Since:
- 1.0.0
-
getFiles
Set<ElementaryFile> getFiles()Returns a reference to the set of all known Elementary Files contains inside the current DF.Note that if a secure session is actually running, then the set contains all session modifications, which can be canceled if the secure session fails.
- Returns:
- A non-null reference (it may be empty if no one EF is set).
- Since:
- 1.1.0
-
isDfRatified
boolean isDfRatified()Tells if the last session with this card has been ratified or not.- Returns:
- True if the card has been ratified.
- Throws:
IllegalStateException
- If no session has been opened.- Since:
- 1.0.0
- See Also:
-
getTransactionCounter
int getTransactionCounter()Returns the transaction counter value provided in the output data of the last successful "Open Secure Session" command.Please note that there are other commands that can decrement the original card counter (e.g. Change Key, Change/Verify PIN, SV Debit/Undebit/Reload). For these other commands, the counter value returned by this method will not be updated.
- Returns:
- A positive value.
- Throws:
IllegalStateException
- If no session has been opened.- Since:
- 1.2.0
- See Also:
-
isPkiModeSupported
boolean isPkiModeSupported()Indicates whether the Public Key Authentication is supported or not (since rev 3.3).This boolean is interpreted from the Application Type byte
- Returns:
- True if the Public Key Authentication is supported.
- Since:
- 1.0.0
-
isExtendedModeSupported
boolean isExtendedModeSupported()Indicates whether the Extended Mode is supported or not (since rev 3.2).This boolean is initially the result of the interpretation of the application type byte but may be updated after the secure session is opened. Indeed, depending on the type of key used, the extended mode functionalities may not be available (non-AES keys) and this information is provided by the card in response to the "Open Secure Session" command.
- Returns:
- True if the Extended Mode is supported.
- Since:
- 1.0.0
-
isRatificationOnDeselectSupported
boolean isRatificationOnDeselectSupported()Indicates if the ratification is done on deselect (ratification command not necessary).This boolean is interpreted from the Application Type byte
- Returns:
- True if the ratification on deselect is supported.
- Since:
- 1.0.0
-
isPinFeatureAvailable
boolean isPinFeatureAvailable()Indicates whether the card has the Calypso PIN feature.This boolean is interpreted from the Application Type byte
- Returns:
- True if the card has the PIN feature.
- Since:
- 1.0.0
-
isPinBlocked
boolean isPinBlocked()Indicates if the PIN is blocked. The maximum number of incorrect PIN submissions has been reached.- Returns:
- True if the PIN status is blocked
- Throws:
IllegalStateException
- If the PIN has not been checked.- Since:
- 1.0.0
- See Also:
-
getPinAttemptRemaining
int getPinAttemptRemaining()Gives the number of erroneous PIN presentations remaining before blocking.- Returns:
- The number of remaining attempts.
- Throws:
IllegalStateException
- If the PIN has not been checked.- Since:
- 1.0.0
- See Also:
-
isSvFeatureAvailable
boolean isSvFeatureAvailable()Indicates whether the card has the Calypso Stored Value feature.This boolean is interpreted from the Application Type byte
- Returns:
- True if the card has the Stored Value feature
- Since:
- 1.0.0
-
getSvBalance
int getSvBalance()Gets the current SV balance value- Returns:
- An int
- Throws:
IllegalStateException
- If no SV Get command has been executed.- Since:
- 1.0.0
- See Also:
-
SecureSymmetricCryptoTransactionManager.prepareSvGet(SvOperation, SvAction)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int, byte[], byte[])
SecureSymmetricCryptoTransactionManager.prepareSvReload(int)
SecureSymmetricCryptoTransactionManager.prepareSvReload(int, byte[], byte[], byte[])
-
getSvLastTNum
int getSvLastTNum()Gets the last SV transaction number- Returns:
- An int
- Throws:
IllegalStateException
- If no SV Get command has been executed.- Since:
- 1.0.0
- See Also:
-
SecureSymmetricCryptoTransactionManager.prepareSvGet(SvOperation, SvAction)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int, byte[], byte[])
SecureSymmetricCryptoTransactionManager.prepareSvReload(int)
SecureSymmetricCryptoTransactionManager.prepareSvReload(int, byte[], byte[], byte[])
-
getSvLoadLogRecord
SvLoadLogRecord getSvLoadLogRecord()Gets a reference to the lastSvLoadLogRecord
- Returns:
- A last SV load log record object or null if not available.
- Since:
- 1.0.0
- See Also:
-
SecureSymmetricCryptoTransactionManager.prepareSvGet(SvOperation, SvAction)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int, byte[], byte[])
SecureSymmetricCryptoTransactionManager.prepareSvReload(int)
SecureSymmetricCryptoTransactionManager.prepareSvReload(int, byte[], byte[], byte[])
-
getSvDebitLogLastRecord
SvDebitLogRecord getSvDebitLogLastRecord()Gets a reference to the lastSvDebitLogRecord
- Returns:
- A last SV debit log record object or null if not available.
- Since:
- 1.0.0
- See Also:
-
SecureSymmetricCryptoTransactionManager.prepareSvGet(SvOperation, SvAction)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int, byte[], byte[])
SecureSymmetricCryptoTransactionManager.prepareSvReload(int)
SecureSymmetricCryptoTransactionManager.prepareSvReload(int, byte[], byte[], byte[])
-
getSvDebitLogAllRecords
List<SvDebitLogRecord> getSvDebitLogAllRecords()Gets list of references to theSvDebitLogRecord
read from the card.- Returns:
- An empty list if no log records are available.
- Since:
- 1.0.0
- See Also:
-
SecureSymmetricCryptoTransactionManager.prepareSvGet(SvOperation, SvAction)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int)
SecureSymmetricCryptoTransactionManager.prepareSvDebit(int, byte[], byte[])
SecureSymmetricCryptoTransactionManager.prepareSvReload(int)
SecureSymmetricCryptoTransactionManager.prepareSvReload(int, byte[], byte[], byte[])
-