Class PCSCIOControl
- java.lang.Object
-
- de.cardcontact.opencard.terminal.smartcardio.PCSCIOControl
-
public class PCSCIOControl extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PCSCIOControl(javax.smartcardio.Card card)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]establishPACEChannel(int pinid, byte[] chat, byte[] pin, byte[] certdesc)intgetFeatureControlCode(int feature)Determine the IOCTL for the requested featurelonggetReadersPACECapabilities()Get the readers PACE capabilities
0x40: Terminal supports PACE
0x20: Terminal supports EPA:eID
0x60: Supporting PACE and EPA:eIDbooleanhasExecutePace()True if card terminal supports FEATURE_EXECUTE_PACEbooleanhasModifyPinDirect()True if card terminal supports FEATURE_MODIFY_PIN_DIRECTbooleanhasVerifyPinDirect()True if card terminal supports FEATURE_VERIFY_PIN_DIRECTbyte[]modifyPINDirect(javax.smartcardio.CommandAPDU xcapdu)Modifying PIN direct with a class 3 card terminalvoidsetConfirmPIN(byte confirmPIN)Set confirmation options for acceptance of a new PIN
Bit 0 = 0: No confirmation requested
Bit 0 = 1: Confirmation requested
Bit 1 = 0: No current PIN entry requested
Bit 1 = 1: Current PIN entry requested
Bit 2-7 RFUvoidsetEntryValidationCondition(byte entryValidationCondition)Set conditions under which PIN entry should be considered complete
0x01 = max size reached
0x02 = validation key pressed
0x04 = timeout occurredvoidsetFormatString(byte formatString)Set formatting options
USB CCID PIN FORMAT xxxvoidsetInsertionOffsetNew(byte insertionOffsetNew)Set insertion position offset in bytes for the new PINvoidsetInsertionOffsetOld(byte insertionOffsetOld)Set insertion position offset in bytes for the current PINvoidsetLangId(byte langId)Set first byte of the two byte language code for messagesvoidsetLangId2(byte langId2)Last byte of the two byte language code for messagesvoidsetMaxPINSize(byte maxPINSize)Set max PIN sizevoidsetMinPINSize(byte minPINSize)Set min PIN sizevoidsetMsgIndex(byte msgIndex)Set index of first prompting messagevoidsetMsgIndex2(byte msgIndex2)Set index of second prompting messagevoidsetMsgIndex3(byte msgIndex3)Set index of third prompting messagevoidsetNumberMessage(byte numberMessage)Set number of messages to display for PIN verification/modification
0x00 = no message
0x01 = Message which index is indicated in MsgIndex1 (confirmPIN = 0x00)
0x02 = Messages which index are indicated in MsgIndex1 and MsgIndex2 (confirmPIN = 0x01 or 0x02)
0x03 = Messages which index are indicated in MsgIndex1, MsgIndex2 and MsgIndex3 (confirmPIN = 0x03
0xFF = Default CCID messagevoidsetPinBlockString(byte pinBlockString)Set Pin block string
bits 7-4 bit size of PIN length in APDU
bits 3-0 PIN block size in bytes after justification and formattingvoidsetPinEncoding(java.lang.String encoding)Set the formatString depending on the PIN encoding.voidsetPinLengthFormat(byte pinLengthFormat)Set Pin length format
bits 7-5 RFU,
bit 4 set if system units are bytes clear if system units are bits,
bits 3-0 PIN length position in system unitsvoidsetTeoPrologue(byte teoPrologue)Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
First of three bytesvoidsetTeoPrologue2(byte teoPrologue2)Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
Second of three bytesvoidsetTeoPrologue3(byte teoPrologue3)Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
Third of three bytesvoidsetTimeOut(byte timeOut)Set timeout in secondsvoidsetTimeOut2(byte timeOut2)Set timeout in seconds after first key strokebyte[]verifyPINDirect(javax.smartcardio.CommandAPDU xcapdu)Verifying PIN direct with a class 3 card terminal
-
-
-
Method Detail
-
setPinEncoding
public void setPinEncoding(java.lang.String encoding) throws CardTerminalExceptionSet the formatString depending on the PIN encoding.- Parameters:
encoding- one of "Format 2 Block", "Packed BCD", "String encoding"- Throws:
javax.smartcardio.CardExceptionCardTerminalException
-
setTimeOut
public void setTimeOut(byte timeOut)
Set timeout in seconds
-
setTimeOut2
public void setTimeOut2(byte timeOut2)
Set timeout in seconds after first key stroke
-
setFormatString
public void setFormatString(byte formatString)
Set formatting options
USB CCID PIN FORMAT xxx
-
setPinBlockString
public void setPinBlockString(byte pinBlockString)
Set Pin block string
bits 7-4 bit size of PIN length in APDU
bits 3-0 PIN block size in bytes after justification and formatting
-
setPinLengthFormat
public void setPinLengthFormat(byte pinLengthFormat)
Set Pin length format
bits 7-5 RFU,
bit 4 set if system units are bytes clear if system units are bits,
bits 3-0 PIN length position in system units
-
setMaxPINSize
public void setMaxPINSize(byte maxPINSize)
Set max PIN size
-
setMinPINSize
public void setMinPINSize(byte minPINSize)
Set min PIN size
-
setConfirmPIN
public void setConfirmPIN(byte confirmPIN)
Set confirmation options for acceptance of a new PIN
Bit 0 = 0: No confirmation requested
Bit 0 = 1: Confirmation requested
Bit 1 = 0: No current PIN entry requested
Bit 1 = 1: Current PIN entry requested
Bit 2-7 RFU
-
setEntryValidationCondition
public void setEntryValidationCondition(byte entryValidationCondition)
Set conditions under which PIN entry should be considered complete
0x01 = max size reached
0x02 = validation key pressed
0x04 = timeout occurred
-
setNumberMessage
public void setNumberMessage(byte numberMessage)
Set number of messages to display for PIN verification/modification
0x00 = no message
0x01 = Message which index is indicated in MsgIndex1 (confirmPIN = 0x00)
0x02 = Messages which index are indicated in MsgIndex1 and MsgIndex2 (confirmPIN = 0x01 or 0x02)
0x03 = Messages which index are indicated in MsgIndex1, MsgIndex2 and MsgIndex3 (confirmPIN = 0x03
0xFF = Default CCID message
-
setLangId
public void setLangId(byte langId)
Set first byte of the two byte language code for messages
-
setLangId2
public void setLangId2(byte langId2)
Last byte of the two byte language code for messages
-
setMsgIndex
public void setMsgIndex(byte msgIndex)
Set index of first prompting message
-
setMsgIndex2
public void setMsgIndex2(byte msgIndex2)
Set index of second prompting message
-
setMsgIndex3
public void setMsgIndex3(byte msgIndex3)
Set index of third prompting message
-
setTeoPrologue
public void setTeoPrologue(byte teoPrologue)
Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
First of three bytes
-
setTeoPrologue2
public void setTeoPrologue2(byte teoPrologue2)
Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
Second of three bytes
-
setTeoPrologue3
public void setTeoPrologue3(byte teoPrologue3)
Set teoPrologue
T=1 I-block prologue field to use (fill with 00).
Third of three bytes
-
setInsertionOffsetOld
public void setInsertionOffsetOld(byte insertionOffsetOld)
Set insertion position offset in bytes for the current PIN
-
setInsertionOffsetNew
public void setInsertionOffsetNew(byte insertionOffsetNew)
Set insertion position offset in bytes for the new PIN
-
hasVerifyPinDirect
public boolean hasVerifyPinDirect()
True if card terminal supports FEATURE_VERIFY_PIN_DIRECT
-
hasModifyPinDirect
public boolean hasModifyPinDirect()
True if card terminal supports FEATURE_MODIFY_PIN_DIRECT
-
hasExecutePace
public boolean hasExecutePace()
True if card terminal supports FEATURE_EXECUTE_PACE
-
verifyPINDirect
public byte[] verifyPINDirect(javax.smartcardio.CommandAPDU xcapdu) throws javax.smartcardio.CardExceptionVerifying PIN direct with a class 3 card terminal- Parameters:
xcapdu- The CommandAPDU- Returns:
- byte array
- Throws:
javax.smartcardio.CardException
-
modifyPINDirect
public byte[] modifyPINDirect(javax.smartcardio.CommandAPDU xcapdu) throws javax.smartcardio.CardExceptionModifying PIN direct with a class 3 card terminal- Parameters:
xcapdu- The CommandAPDU- Returns:
- byte array
- Throws:
javax.smartcardio.CardException
-
getFeatureControlCode
public int getFeatureControlCode(int feature)
Determine the IOCTL for the requested feature- Parameters:
feature- One of PCSCIOControl.FEATURE_*- Returns:
- The feature control code or -1 if feature was not found
-
getReadersPACECapabilities
public long getReadersPACECapabilities() throws javax.smartcardio.CardExceptionGet the readers PACE capabilities
0x40: Terminal supports PACE
0x20: Terminal supports EPA:eID
0x60: Supporting PACE and EPA:eID- Returns:
- The PACE capabilities or -1
- Throws:
javax.smartcardio.CardException
-
establishPACEChannel
public byte[] establishPACEChannel(int pinid, byte[] chat, byte[] pin, byte[] certdesc) throws javax.smartcardio.CardException- Parameters:
pinid- The PinID must be one of these:- 0x01 MRZ,
- 0x02 CAN,
- 0x03 PIN,
- 0x04 PUK
chat- Certificate Holder Authorization Templatepin- PINcertdesc- Certificate Description- Returns:
- byte[] Output Data
- Throws:
javax.smartcardio.CardException
-
-