PCSC4Java
0.2
Library PCSC for Java language.
|
Public Member Functions | |
abstract ATR | getATR () |
abstract String | getProtocol () |
abstract CardChannel | getBasicChannel () |
abstract CardChannel | openLogicalChannel () throws CardException |
abstract void | beginExclusive () throws CardException |
abstract void | endExclusive () throws CardException |
abstract byte[] | transmitControlCommand (int controlCode, byte[] command) throws CardException |
abstract void | reconnect (int iShareMode, int iInitialization) throws CardException |
abstract void | disconnect (int iDisposition) throws CardException |
abstract byte[] | getAttrib (int iAttribute) throws CardException |
abstract void | setAttrib (int iAttribute, byte[] pBCommand) throws CardException |
byte[] | modifyPinDirect (byte[] abyModifyPin) throws CardException |
byte[] | verifyPinDirect (byte[] abyVerifyPin) throws CardException |
abstract int | getSharingMode () |
Protected Member Functions | |
Card () | |
boolean | hasFeature (Byte feature) throws CardException |
void | queryFeatures () throws CardException |
Protected Attributes | |
final int | IOCTL_GET_FEATURE_REQUEST = SCARD_CTL_CODE(3400) |
Map< Byte, Integer > | m_features |
A Smart Card with which a connection has been established. Card objects are obtained by calling CardTerminal.connect().
fr.redbilled.pcscforjava.Card.Card | ( | ) | [protected] |
Constructs a new Card object.
This constructor is called by subclasses only. Application should call the CardTerminal::connect CardTerminal.connect()} method to obtain a Card object.
abstract void fr.redbilled.pcscforjava.Card.beginExclusive | ( | ) | throws CardException [pure virtual] |
Requests exclusive access to this card.
Once a thread has invoked beginExclusive
, only this thread is allowed to communicate with this card until it calls endExclusive
. Other threads attempting communication will receive a CardException.
Applications have to ensure that exclusive access is correctly released. This can be achieved by executing the beginExclusive()
and endExclusive
calls in a try ... finally
block.
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
CardException | if exclusive access has already been set or if exclusive access could not be established |
IllegalStateException | if this card object has been disposed of via the disconnect disconnect()} method |
abstract void fr.redbilled.pcscforjava.Card.disconnect | ( | int | iDisposition | ) | throws CardException [pure virtual] |
Disconnects the connection with this card. After this method returns, calling methods on this object or in CardChannels associated with this object that require interaction with the card will raise an IllegalStateException.
iDisposition | must be #SCARD_LEAVE_CARD to leave the card in its current state or #SCARD_RESET_CARD to reset the card before the disconnection or #SCARD_UNPOWER_CARD to power off the card before the disconnection or #SCARD_EJECT_CARD to eject the card before the disconnection. |
CardException | if the card operation failed |
IllegalArgumentException | if a parameter is incoherent with this function. |
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
abstract void fr.redbilled.pcscforjava.Card.endExclusive | ( | ) | throws CardException [pure virtual] |
Releases the exclusive access previously established using beginExclusive
.
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
IllegalStateException | if the active Thread does not currently have exclusive access to this card or if this card object has been disposed of via the disconnect disconnect()} method |
CardException | if the operation failed |
abstract ATR fr.redbilled.pcscforjava.Card.getATR | ( | ) | [pure virtual] |
abstract byte [] fr.redbilled.pcscforjava.Card.getAttrib | ( | int | iAttribute | ) | throws CardException [pure virtual] |
Gets an attribute of this card.
iAttribute | is the identifier for the attribute to get and must be: SCARD_ATTR_ATR_STRING |
Answer to reset (ATR) string.
unsigned long encoded as 0xDDDDCCCC, where DDDD = data channel type and CCCC = channel number: The following encodings are defined for DDDD: 0x01 serial I/O; CCCC is a port number. 0x02 parallel I/O; CCCC is a port number. 0x04 PS/2 keyboard port; CCCC is zero. 0x08 SCSI; CCCC is SCSI ID number. 0x10 IDE; CCCC is device number. 0x20 USB; CCCC is device number. 0xFy vendor-defined interface with y in the range zero through 15; CCCC is vendor defined.
unsigned long indicating which mechanical characteristics are supported. If zero, no special characteristics are supported. Note that multiple bits can be set: 0x00000001 Card swallowing mechanism 0x00000002 Card ejection mechanism 0x00000004 Card capture mechanism All other values are reserved for future use (RFU).
Current block waiting time.
Current clock rate, in kHz.
Current character waiting time.
Bit rate conversion factor.
Current error block control encoding. 0 = longitudinal redundancy check (LRC) 1 = cyclical redundancy check (CRC)
Clock conversion factor.
Current byte size for information field size card.
Current byte size for information field size device.
Current guard time.
unsigned long encoded as 0x0rrrpppp where rrr is RFU and should be 0x000. pppp encodes the current protocol type. Whichever bit has been set indicates which ISO protocol is currently in use. (For example, if bit zero is set, T=0 protocol is in effect.)
Current work waiting time.
Default clock rate, in kHz.
Default data rate, in bps.
Reader's display name.
Reserved for future use.
Reader's system name.
Instance of this vendor's reader attached to the computer. The first instance will be device unit 0, the next will be unit 1 (if it is the same brand of reader) and so on. Two different brands of readers will both have zero for this value.
Single byte. Zero if smart card electrical contact is not active; nonzero if contact is active.
Single byte indicating smart card presence: 0 = not present 1 = card present but not swallowed (applies only if reader supports smart card swallowing) 2 = card present (and swallowed if reader supports smart card swallowing) 4 = card confiscated.
Single byte indicating smart card type: 0 = unknown type 1 = 7816 Asynchronous 2 = 7816 Synchronous Other values RFU.
Maximum clock rate, in kHz.
Maximum data rate, in bps.
Maximum bytes for information file size device.
Zero if device does not support power down while smart card is inserted. Nonzero otherwise.
unsigned long encoded as 0x0rrrpppp where rrr is RFU and should be 0x000. pppp encodes the supported protocol types. A '1' in a given bit position indicates support for the associated ISO protocol, so if bits zero and one are set, both T=0 and T=1 protocols are supported.
Vendor-supplied interface device serial number.
Vendor-supplied interface device type (model designation of reader).
Vendor-supplied interface device version (DWORD in the form 0xMMmmbbbb where MM = major version, mm = minor version, and bbbb = build number).
Vendor name.
CardException | if the card operation failed |
IllegalArgumentException | if a parameter is incoherent with this function. |
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
abstract CardChannel fr.redbilled.pcscforjava.Card.getBasicChannel | ( | ) | [pure virtual] |
Returns the CardChannel for the basic logical channel. The basic logical channel has a channel number of 0.
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
IllegalStateException | if this card object has been disposed of via the disconnect disconnect()} method |
abstract String fr.redbilled.pcscforjava.Card.getProtocol | ( | ) | [pure virtual] |
Returns the protocol in use for this card.
abstract int fr.redbilled.pcscforjava.Card.getSharingMode | ( | ) | [pure virtual] |
boolean fr.redbilled.pcscforjava.Card.hasFeature | ( | Byte | feature | ) | throws CardException [protected] |
byte [] fr.redbilled.pcscforjava.Card.modifyPinDirect | ( | byte[] | abyModifyPin | ) | throws CardException |
Transmits a modifyPinDirect to the terminal device using the transmitControlCommand} method.
abyModifyPin | the modify pin command. |
XiCardException | if a card operation failed. |
Definition at line 353 of file Card.java.
abstract CardChannel fr.redbilled.pcscforjava.Card.openLogicalChannel | ( | ) | throws CardException [pure virtual] |
Opens a new logical channel to the card and returns it. The channel is opened by issuing a MANAGE CHANNEL
command that should use the format [00 70 00 00 01]
.
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
CardException | is a new logical channel could not be opened |
IllegalStateException | if this card object has been disposed of via the disconnect disconnect()} method |
void fr.redbilled.pcscforjava.Card.queryFeatures | ( | ) | throws CardException [protected] |
abstract void fr.redbilled.pcscforjava.Card.reconnect | ( | int | iShareMode, |
int | iInitialization | ||
) | throws CardException [pure virtual] |
Reestablish the connection with this card. After this method returns, the connection with the card has been reseted. The reestablishment can be of type WARM_RESET (i.e power on the card without power off it) or COLD_RESET (i.e power on the card after have perfoming a power off).
iShareMode | must be #SCARD_SHARE_SHARED if the reader must be in share mode or #SCARD_SHARE_EXCLUSIVE if the reader must be in exclusive mode. |
iInitialization | must be #SCARD_LEAVE_CARD to leave the card in its current state or #SCARD_RESET_CARD to perform a WARM_RESET to the card of #SCARD_UNPOWER_CARD to perform a COLD_RESET to the card. |
CardException | if the card operation failed |
IllegalArgumentException | if a parameter is incoherent with this function. |
IllegalStateException | if this card object has been disposed of via the disconnect disconnect()} method |
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
abstract void fr.redbilled.pcscforjava.Card.setAttrib | ( | int | iAttribute, |
byte[] | pBCommand | ||
) | throws CardException [pure virtual] |
Sets an attribute of this card.
iAttribute | is the identifier for the attribute to set and must be: SCARD_ATTR_SUPRESS_T1_IFS_REQUEST |
Suppress sending of T=1 IFSD packet from the reader to the card. (Can be used if the currently inserted card does not support an IFSD request.)
pBCommand | the new attribute for the identifier request. |
CardException | if the card operation failed |
IllegalArgumentException | if a parameter is incoherent with this function. |
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
abstract byte [] fr.redbilled.pcscforjava.Card.transmitControlCommand | ( | int | controlCode, |
byte[] | command | ||
) | throws CardException [pure virtual] |
Transmits a control command to the terminal device.
This can be used to, for example, control terminal functions like a built-in PIN pad or biometrics.
controlCode | the control code of the command |
command | the command data |
SecurityException | if a SecurityManager exists and the caller does not have the required CardPermission permission} |
NullPointerException | if command is null |
CardException | if the card operation failed |
IllegalStateException | if this card object has been disposed of via the disconnect disconnect()} method |
byte [] fr.redbilled.pcscforjava.Card.verifyPinDirect | ( | byte[] | abyVerifyPin | ) | throws CardException |
Transmits a verifyPinDirect to the terminal device using the transmitControlCommand} method.
abyVerifyPin | the verify pin command. |
XiCardException | if a card operation failed. |
Definition at line 371 of file Card.java.
final int fr.redbilled.pcscforjava.Card.IOCTL_GET_FEATURE_REQUEST = SCARD_CTL_CODE(3400) [protected] |
Map<Byte, Integer> fr.redbilled.pcscforjava.Card.m_features [protected] |