Class PTEID_SmartCard

All Implemented Interfaces:
PTEID_SigningDevice
Direct Known Subclasses:
PTEID_EIDCard

public class PTEID_SmartCard extends PTEID_Card
Abstract base class for Smart card.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class PTEID_Card
    • selectApplication

      public void selectApplication(PTEID_ByteArray applicationId) throws PTEID_Exception
      Select an application from the card
      Throws:
      PTEID_Exception
    • sendAPDU

      public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin, String csPinCode) throws PTEID_Exception
      Send an APDU command to the card and get the result.
      Parameters:
      cmd - is the apdu command
      pin - is the pin to ask for writing
      csPinCode - is the code of the pin (it will be asked if needed and not set)
      Returns:
      a PTEID_ByteArray containing the result
      Throws:
      PTEID_Exception
    • sendAPDU

      public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd, PTEID_Pin pin) throws PTEID_Exception
      Send an APDU command to the card and get the result.
      Parameters:
      cmd - is the apdu command
      pin - is the pin to ask for writing

      Returns:
      a PTEID_ByteArray containing the result
      Throws:
      PTEID_Exception
    • sendAPDU

      public PTEID_ByteArray sendAPDU(PTEID_ByteArray cmd) throws PTEID_Exception
      Send an APDU command to the card and get the result.
      Overrides:
      sendAPDU in class PTEID_Card
      Parameters:
      cmd - is the apdu command


      Returns:
      a PTEID_ByteArray containing the result
      Throws:
      PTEID_Exception
    • readFile

      public int readFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin, String csPinCode) throws PTEID_Exception
      Read a File from the card.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      in - return the file
      pin - is the pin to ask for reading
      csPinCode - is the code of the pin (it will be asked if needed and not set)
      Throws:
      PTEID_Exception
    • readFile

      public int readFile(String fileID, PTEID_ByteArray in, PTEID_Pin pin) throws PTEID_Exception
      Read a File from the card.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      in - return the file
      pin - is the pin to ask for reading
      Throws:
      PTEID_Exception
    • readFile

      public int readFile(String fileID, PTEID_ByteArray in) throws PTEID_Exception
      Read a File from the card.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      in - return the file

      Throws:
      PTEID_Exception
    • writeFile

      public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode, long inOffset) throws PTEID_Exception
      Write a file to the card.
      Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      out - contents the bytes to write
      pin - is the pin to ask for writing
      csPinCode - is the code of the pin (it will be asked if needed and not set)
      inOffset - is the offset of the data to be written to the file
      Throws:
      PTEID_Exception
    • writeFile

      public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin, String csPinCode) throws PTEID_Exception
      Write a file to the card.
      Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      out - contents the bytes to write
      pin - is the pin to ask for writing
      csPinCode - is the code of the pin (it will be asked if needed and not set)
      Throws:
      PTEID_Exception
    • writeFile

      public boolean writeFile(String fileID, PTEID_ByteArray out, PTEID_Pin pin) throws PTEID_Exception
      Write a file to the card.
      Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Parameters:
      fileID - is the path of the file
      out - contents the bytes to write
      pin - is the pin to ask for writing

      Throws:
      PTEID_Exception
    • writeFile

      public boolean writeFile(String fileID, PTEID_ByteArray out) throws PTEID_Exception
      Write a file to the card.
      Throw PTEID_ExCmdNotAllowed exception you're not allowed to write the file.

      If no pin is passed and a pin is needed by the card, the pin code will be asked anyway.

      Overrides:
      writeFile in class PTEID_Card
      Parameters:
      fileID - is the path of the file
      out - contents the bytes to write


      Throws:
      PTEID_Exception
    • pinCount

      public long pinCount() throws PTEID_Exception
      Returns:
      the number of pins on the card.
      Throws:
      PTEID_Exception
    • getPins

      public PTEID_Pins getPins() throws PTEID_Exception
      Returns:
      an object to access all the pins on the card.
      Throws:
      PTEID_Exception
    • certificateCount

      public long certificateCount() throws PTEID_Exception
      Returns:
      the number of certificate on the card.
      Throws:
      PTEID_Exception