|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datecs.api.universalreader.UniversalReader.SmartCardReader
public final class UniversalReader.SmartCardReader
This class provides functionality for the Smart Card reader.
Method Summary | |
---|---|
boolean |
isCardPresent()
Returns if smart card is present into reader. |
ResponseAPDU |
read(byte[] data)
Sends APDU read request. |
ResponseAPDU |
read(int cla,
int ins,
int p1,
int p2,
int lc)
Sends APDU read request. |
AnswerToReset |
reset()
Resets the smart card and returns the ATR. |
void |
select(int slot)
Selects the smart card reader slot. |
void |
setPower(boolean on)
Powers on/off smart card. |
ResponseAPDU |
transmit(byte[] data)
Sends combined APDU write/read request. |
ResponseAPDU |
transmit(int cla,
int ins,
int p1,
int p2,
byte[] data)
Sends combined APDU write/read request. |
ResponseAPDU |
write(byte[] data)
Sends APDU write request. |
ResponseAPDU |
write(int cla,
int ins,
int p1,
int p2,
byte[] data)
Sends APDU write request. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void setPower(boolean on) throws java.io.IOException, UniversalReaderException
Call this method to powered on the smart card before any APDU request, and to powered off the smart card when finish to use it.
on
- the flag indicates where to power on/off the reader.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public AnswerToReset reset() throws java.io.IOException, UniversalReaderException
Call this method before sending first APDU command.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU write(int cla, int ins, int p1, int p2, byte[] data) throws java.io.IOException, UniversalReaderException
cla
- the CLA parameter. Consults with smart card documentation.ins
- the INS parameter. Consults with smart card documentation.p1
- the P1 parameter. Consults with smart card documentation.p2
- the P2 parameter. Consults with smart card documentation.data
- the byte array to write to the smart card or
null
if you don't want to send any data with
the command.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU write(byte[] data) throws java.io.IOException, UniversalReaderException
data
is null
, a
NullPointerException
is thrown.
data
- the byte array contains write command that send to the smart
card.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU read(int cla, int ins, int p1, int p2, int lc) throws java.io.IOException, UniversalReaderException
cla
- the CLA parameter. Consults with smart card documentation.ins
- the INS parameter. Consults with smart card documentation.p1
- the P1 parameter. Consults with smart card documentation.p2
- the P2 parameter. Consults with smart card documentation.lc
- the number of bytes requested to read from smart card.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU read(byte[] data) throws java.io.IOException, UniversalReaderException
data
is null
, a
NullPointerException
is thrown.
data
- the byte array contains read command that send to the
smart card.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU transmit(int cla, int ins, int p1, int p2, byte[] data) throws java.io.IOException, UniversalReaderException
cla
- the CLA parameter. Consult smart card documentation.ins
- the INS parameter. Consult smart card documentation.p1
- the P1 parameter. Consult smart card documentation.p2
- the P2 parameter. Consult smart card documentation.data
- the byte array to write to the smart card or
null
if you don't want to send any data with
the command.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public ResponseAPDU transmit(byte[] data) throws java.io.IOException, UniversalReaderException
data
is null
, a
NullPointerException
is thrown.
data
- the byte array contains write command that send the smart
card.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public boolean isCardPresent() throws java.io.IOException, UniversalReaderException
true
if smart card available into module;
otherwise returns false
.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.public void select(int slot) throws java.io.IOException, UniversalReaderException
slot
- the smart card reader slot number, starting from 0.
java.io.IOException
- if an I/O error occurs.
UniversalReaderException
- if an error occurs during execution.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |