Class 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)  
      int getFeatureControlCode​(int feature)
      Determine the IOCTL for the requested feature
      long getReadersPACECapabilities()
      Get the readers PACE capabilities
      0x40: Terminal supports PACE
      0x20: Terminal supports EPA:eID
      0x60: Supporting PACE and EPA:eID
      boolean hasExecutePace()
      True if card terminal supports FEATURE_EXECUTE_PACE
      boolean hasModifyPinDirect()
      True if card terminal supports FEATURE_MODIFY_PIN_DIRECT
      boolean hasVerifyPinDirect()
      True if card terminal supports FEATURE_VERIFY_PIN_DIRECT
      byte[] modifyPINDirect​(javax.smartcardio.CommandAPDU xcapdu)
      Modifying PIN direct with a class 3 card terminal
      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
      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
      void setFormatString​(byte formatString)
      Set formatting options
      USB CCID PIN FORMAT xxx
      void setInsertionOffsetNew​(byte insertionOffsetNew)
      Set insertion position offset in bytes for the new PIN
      void setInsertionOffsetOld​(byte insertionOffsetOld)
      Set insertion position offset in bytes for the current PIN
      void setLangId​(byte langId)
      Set first byte of the two byte language code for messages
      void setLangId2​(byte langId2)
      Last byte of the two byte language code for messages
      void setMaxPINSize​(byte maxPINSize)
      Set max PIN size
      void setMinPINSize​(byte minPINSize)
      Set min PIN size
      void setMsgIndex​(byte msgIndex)
      Set index of first prompting message
      void setMsgIndex2​(byte msgIndex2)
      Set index of second prompting message
      void setMsgIndex3​(byte msgIndex3)
      Set index of third prompting message
      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
      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
      void setPinEncoding​(java.lang.String encoding)
      Set the formatString depending on the PIN encoding.
      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
      void setTeoPrologue​(byte teoPrologue)
      Set teoPrologue
      T=1 I-block prologue field to use (fill with 00).
      First of three bytes
      void setTeoPrologue2​(byte teoPrologue2)
      Set teoPrologue
      T=1 I-block prologue field to use (fill with 00).
      Second of three bytes
      void setTeoPrologue3​(byte teoPrologue3)
      Set teoPrologue
      T=1 I-block prologue field to use (fill with 00).
      Third of three bytes
      void setTimeOut​(byte timeOut)
      Set timeout in seconds
      void setTimeOut2​(byte timeOut2)
      Set timeout in seconds after first key stroke
      byte[] verifyPINDirect​(javax.smartcardio.CommandAPDU xcapdu)
      Verifying PIN direct with a class 3 card terminal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PCSCIOControl

        public PCSCIOControl​(javax.smartcardio.Card card)
        Parameters:
        card - the card object
    • Method Detail

      • setPinEncoding

        public void setPinEncoding​(java.lang.String encoding)
                            throws CardTerminalException
        Set the formatString depending on the PIN encoding.
        Parameters:
        encoding - one of "Format 2 Block", "Packed BCD", "String encoding"
        Throws:
        javax.smartcardio.CardException
        CardTerminalException
      • 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.CardException
        Verifying 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.CardException
        Modifying 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.CardException
        Get 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 Template
        pin - PIN
        certdesc - Certificate Description
        Returns:
        byte[] Output Data
        Throws:
        javax.smartcardio.CardException