Package pt.gov.cartaodecidadao
Class PTEID_ReaderContext
java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_ReaderContext
This class represent a reader.
You get a reader object from the ReaderSet
either by its index (getReaderByNum) or by its name (getReaderByName).
Once you have a reader object, you can check if a card is present (isCardPresent).
Then you can ask which type of card is in the reader with getCardType()
and then get a card object using one of this methods :
getCard or getEIDCard.
You get a reader object from the ReaderSet
either by its index (getReaderByNum) or by its name (getReaderByName).
Once you have a reader object, you can check if a card is present (isCardPresent).
Then you can ask which type of card is in the reader with getCardType()
and then get a card object using one of this methods :
getCard or getEIDCard.
-
Method Summary
Modifier and TypeMethodDescriptionvoidBegin a transaction with the readervoiddelete()static voiddoJavaCallBack(int iKey, long lRet, long ulState) voidEnd the transactiongetCard()Get the card in the reader.
Instantiation is made regarding the type of the card
(PTEID_EIDCard).
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.Get the card interface used on the current used card
Returns the interface of the current cardReturn the type of the card in the reader.
Throw PTEID_ExNoCardPresent exception if no card is present.Get the EIDcard in the reader.
Instantiation is made regarding the type of the card
(PTEID_EIDCard).
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.Get an instance of ICAO_Card if the smartcard chip present in reader is compatible with ICAO Doc 9303 specification
Example of compatible documents: newer PT eID cards of type PTEID_CARDTYPE_IAS5, resident permits, european identity cards
and ePassports
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the current card is not compatible with the ICAO specification, exception PTEID_ExCardTypeUnknown is thrown.Read the Multipass token information from the card present in the reader
This token is a free access unique value, not related to personal citizen data.
Its purpose is to be used in some physical access control scenarios.
This is the only useful information available on IAS v5 cards without access control on contactless interface.
The implementation uses Passive and Chip Authentication mechanisms defined in ICAO Doc 9303 Part 11 to counter the risk of receiving untrusted or cloned information.
getName()Return the name of the reader.booleanisCardChanged(PTEID_ulwrapper ulOldId) Return true if a card has changed since the last called (with the same ulOldId parameter).booleanReturn true if a card is present and false otherwise.booleanisPinpad()voidRecover()Recover the card when it's not responding properly anymore.
This method attempts to reset the card connection and restore communication.voidRelease the card.
voidreleaseCard(boolean bAllReference) Release the card.
longSetEventCallback(Callback callback, Object pvRef) Specify a callback function to be called each time a
card is inserted/remove in/from this reader.
voidStopEventCallback(long ulHandle) To tell that the callbacks are not longer needed.
-
Method Details
-
delete
public void delete()- Overrides:
deletein classPTEID_Object
-
doJavaCallBack
public static void doJavaCallBack(int iKey, long lRet, long ulState) -
getName
Return the name of the reader.- Throws:
PTEID_Exception
-
isCardPresent
Return true if a card is present and false otherwise.- Throws:
PTEID_Exception
-
isPinpad
public boolean isPinpad() -
releaseCard
Release the card.
- Parameters:
bAllReference- If true all the invalid reference/pointer are destroyed.bAllReference- PUT THIS PARAMETER TO TRUE IS THREAD UNSAFE.bAllReference- You have to be sure that you will not use any old reference/pointer after this release- Throws:
PTEID_Exception
-
releaseCard
Release the card.
- Throws:
PTEID_Exception
-
isCardChanged
Return true if a card has changed since the last called (with the same ulOldId parameter).- Throws:
PTEID_Exception
-
getCardType
Return the type of the card in the reader.
Throw PTEID_ExNoCardPresent exception if no card is present.- Throws:
PTEID_Exception
-
getCard
Get the card in the reader.
Instantiation is made regarding the type of the card
(PTEID_EIDCard).
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.- Throws:
PTEID_Exception
-
getCardContactInterface
Get the card interface used on the current used card
Returns the interface of the current card -
getEIDCard
Get the EIDcard in the reader.
Instantiation is made regarding the type of the card
(PTEID_EIDCard).
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the card type is not supported, exception PTEID_ExCardTypeUnknown is thrown.- Throws:
PTEID_Exception
-
getICAOCard
Get an instance of ICAO_Card if the smartcard chip present in reader is compatible with ICAO Doc 9303 specification
Example of compatible documents: newer PT eID cards of type PTEID_CARDTYPE_IAS5, resident permits, european identity cards
and ePassports
If no card is present in the reader, exception PTEID_ExNoCardPresent is thrown.
If the current card is not compatible with the ICAO specification, exception PTEID_ExCardTypeUnknown is thrown.- Throws:
PTEID_Exception
-
getMultiPassToken
Read the Multipass token information from the card present in the reader
This token is a free access unique value, not related to personal citizen data.
Its purpose is to be used in some physical access control scenarios.
This is the only useful information available on IAS v5 cards without access control on contactless interface.
The implementation uses Passive and Chip Authentication mechanisms defined in ICAO Doc 9303 Part 11 to counter the risk of receiving untrusted or cloned information.
- Returns:
- A PTEID_ByteArray object containing the Multipass token which is a 16-byte value
- Throws:
PTEID_Exception
-
SetEventCallback
Specify a callback function to be called each time a
card is inserted/remove in/from this reader.
- Returns:
- A handle can be used to stop the callbacks when they are no longer needed.
- Throws:
PTEID_Exception
-
StopEventCallback
To tell that the callbacks are not longer needed.- Parameters:
ulHandle- is the handle return by SetEventCallback- Throws:
PTEID_Exception
-
BeginTransaction
Begin a transaction with the reader- Throws:
PTEID_Exception
-
EndTransaction
End the transaction- Throws:
PTEID_Exception
-
Recover
public void Recover()Recover the card when it's not responding properly anymore.
This method attempts to reset the card connection and restore communication.
-