java.lang.Object
javax.smartcardio.CardTerminal
de.gematik.smartcards.pcsc.Ifd
Class extending
CardTerminal.- Author:
- gematik
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionEstablishes a connection to the card.getName()Returns the unique name of this terminal.booleanReturns whether a card is present in this terminal.toString()ReturnsStringrepresentation.booleanwaitForCardAbsent(long timeout) Waits until a card is absent in this terminal or the timeout expires.booleanwaitForCardPresent(long timeout) Waits until a card is present in this terminal or the timeout expires.
-
Method Details
-
getName
Returns the unique name of this terminal.- Specified by:
getNamein classCardTerminal- Returns:
- the unique name of this terminal.
- See Also:
-
connect
Establishes a connection to the card.If a connection has previously established using the specified protocol, this method returns the same
Cardobject as the previous call.Notes on implementation:
- Currently only protocol "T=1" is supported by this implementation. Other values for
protocolwill cause anIllegalArgumentException.
- Specified by:
connectin classCardTerminal- Parameters:
protocol- the protocol to use ("T=0", "T=1", or "T=CL"), or "*" to connect using any available protocol- Returns:
- the card the connection has been established with
- Throws:
IllegalArgumentException- if protocol is an invalid protocol specificationCardNotPresentException- if no card is present in this terminalCardException- if- a connection could not be established using the specified protocol
- connection has previously been established using a different protocol
SecurityException- if a SecurityManager exists and the caller does not have the requiredpermission- See Also:
- Currently only protocol "T=1" is supported by this implementation. Other values for
-
isCardPresent
Returns whether a card is present in this terminal.- Specified by:
isCardPresentin classCardTerminal- Returns:
- whether a card is present in this terminal.
- Throws:
CardException- if the status could not be determined- See Also:
-
toString
ReturnsStringrepresentation. -
waitForCardPresent
Waits until a card is present in this terminal or the timeout expires.If the method returns due to an expired timeout, it returns false. Otherwise, it returns true.
If a card is present in this terminal when this method is called, it returns immediately.
- Specified by:
waitForCardPresentin classCardTerminal- Parameters:
timeout- if positive, block for up totimeoutmilliseconds; if zero, block indefinitely; must not be negative- Returns:
- false if the method returns due to an expired timeout, true otherwise.
- Throws:
IllegalArgumentException- if timeout is negativeCardException- if the operation failed- See Also:
-
waitForCardAbsent
Waits until a card is absent in this terminal or the timeout expires.If the method returns due to an expired timeout, it returns false. Otherwise, it returns true.
If no card is present in this terminal when this method is called, it returns immediately.
- Specified by:
waitForCardAbsentin classCardTerminal- Parameters:
timeout- if positive, block for up totimeoutmilliseconds; if zero, block indefinitely; must not be negative- Returns:
- false if the method returns due to an expired timeout, true otherwise.
- Throws:
IllegalArgumentException- if timeout is negativeCardException- if the operation failed- See Also:
-