Class PTEID_Pin

java.lang.Object
pt.gov.cartaodecidadao.PTEID_Object
pt.gov.cartaodecidadao.PTEID_Pin

public class PTEID_Pin extends PTEID_Object
Class that represent one card PIN.
  • Field Details

    • AUTH_PIN

      public static final long AUTH_PIN
      PIN reference value for the authentication PIN.
      It can be used as parameter for PTEID_Pins::getPinByPinRef()
    • SIGN_PIN

      public static final long SIGN_PIN
      PIN reference value for the signature PIN. It can be used as parameter for PTEID_Pins::getPinByPinRef()
    • ADDR_PIN

      public static final long ADDR_PIN
      PIN reference value for the address PIN. It can be used as parameter for PTEID_Pins::getPinByPinRef()
    • UNBLOCK_FLAG_NEW_PIN

      public static final int UNBLOCK_FLAG_NEW_PIN
      Flags available for PTEID_Pin::unlockPin
    • UNBLOCK_FLAG_PUK_MERGE

      public static final int UNBLOCK_FLAG_PUK_MERGE
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class PTEID_Object
    • getIndex

      public long getIndex() throws PTEID_Exception
      Get the index of the pin
      Throws:
      PTEID_Exception
    • getType

      public long getType() throws PTEID_Exception
      Get the type of the pin
      Throws:
      PTEID_Exception
    • getId

      public long getId() throws PTEID_Exception
      Get the id of the pin
      Throws:
      PTEID_Exception
    • getPinRef

      public long getPinRef() throws PTEID_Exception
      Get the pinref value of the pin
      Throws:
      PTEID_Exception
    • getUsageCode

      public PTEID_PinUsage getUsageCode() throws PTEID_Exception
      Get the usage code of the pin
      Throws:
      PTEID_Exception
    • getFlags

      public long getFlags() throws PTEID_Exception
      Get the flags of the pin
      Throws:
      PTEID_Exception
    • getLabel

      public String getLabel() throws PTEID_Exception
      Get the label of the pin
      Throws:
      PTEID_Exception
    • getLabelById

      public String getLabelById(long id)
      Get the label of the pin by Id
    • unlockPin

      public boolean unlockPin(String pszPuk, String pszNewPin, PTEID_ulwrapper triesLeft, long flags) throws PTEID_Exception
      Throws:
      PTEID_Exception
    • getTriesLeft

      public int getTriesLeft() throws PTEID_Exception
      Return the remaining tries for entering the correct pin.


      Returns:
      the number of remaining tries in the other case
      Throws:
      PTEID_Exception
    • isVerified

      public boolean isVerified() throws PTEID_Exception
      Check the current verification status of the PIN


      Returns:
      true if the PIN has already been successfully presented during the current card session or false
      otherwise
      Throws:
      PTEID_Exception
    • verifyPin

      public boolean verifyPin(String csPin, PTEID_ulwrapper ulRemaining, boolean bShowDlg) throws PTEID_Exception
      Ask the card to verify the pin.

      Parameters:
      csPin - is the pin code to verify (if csPin is empty, a popup will ask for the code)
      ulRemaining - return the remaining tries (only if verifying failed)
      bShowDlg - flag used to either show or not a dialog where the user inserts the pin (default=true)

      Returns:
      true if success and false if failed
      Throws:
      PTEID_Exception
    • changePin

      public boolean changePin(String csPin1, String csPin2, PTEID_ulwrapper ulRemaining, String PinName, boolean bShowDlg) throws PTEID_Exception
      Ask the card to change the pin.

      if csPin1 or csPin2 are empty, a popup will ask for the codes.

      Parameters:
      csPin1 - is the old pin code
      csPin2 - is the new pin code
      ulRemaining - return the remaining tries (only when operation failed)

      Returns:
      true if success and false if failed
      Throws:
      PTEID_Exception