Pin

public class Pin

Class represents a PIN that protects smart card contents.

Methods

change

public void change(String oldValue, String newValue)

Changes the PIN. The operation can only be made against the user PIN.

Parameters:
  • oldValue – The current PIN value. May be null if a protected authentication path exists Token.hasProtectedAuthPath().

  • newValue – The new PIN value. May be null if a protected authentication path exists.

getConstraints

public PinConstraint[] getConstraints()

Gets the format constraints of the PIN as an array of PinConstraint object.

Returns:

the PinConstraint array.

getLabel

public String getLabel()

Gets the PIN label. Can be undefined if the card has a single PIN without explicit label defined.

Returns:

the PIN label.

getMaxTries

public int getMaxTries()

Returns the number of maximum tries for the PIN verification. Can be undefined if the information is unavailable.

Returns:

the number of maximum tries for the PIN verification.

getPuksAvailable

public int getPuksAvailable()

Returns a bit field indicating availability of each PUK, with the LSB for 1st PUK. A bit at 1 indicates that the corresponding PUK is still available. Can be undefined if the information is unavailable.

Returns:

a bit field indicating availability of each PUK.

getRemainingTries

public int getRemainingTries()

Returns the number of remaining tries for the PIN verification. Can be undefined if the information is unavailable.

Returns:

the number of remaining tries for the PIN verification.

getToken

public Token getToken()

Returns Token object this PIN belongs to.

Returns:

the Token object.

initPin

public void initPin(String newValue)

Reinitializes the PIN value (eventually unblocking it, if required). The operation can only be made against the user PIN, and requires the security officer PIN to be verified Pin.login(String).

Parameters:
  • newValue – The new PIN value. May be null if a protected authentication path exists.

initPinSo

public void initPinSo()

Unblocks the SO PIN or the PUKs, depending on the profile. This function can operate only if the appropriate access conditons have been fulfilled.

isBlocked

public boolean isBlocked()

Returns true if the PIN is blocked.

Returns:

true if the PIN is blocked; false otherwise.

isInitialized

public boolean isInitialized()

Returns true if the PIN has been initialized.

Returns:

true if the PIN has been initialized; false otherwise.

isToBeChanged

public boolean isToBeChanged()

Returns true if the PIN need to be changed before use.

Returns:

true if the PIN need to be changed before use; false otherwise.

isTryCountLow

public boolean isTryCountLow()

Returns true if the PIN try counter is lower than the maximum (an unsuccessful verification attempt has been made).

Returns:

true if the PIN try counter is lower than the maximum; false otherwise.

isValidated

public boolean isValidated()

Returns true if the PIN has been successfully verified (access to the private objects is granted).

Returns:

true if the PIN has been successfully verified; false otherwise.

lastTry

public boolean lastTry()

Returns true if the PIN try counter shows only one attempt remaining.

Returns:

true if the PIN try counter shows only one attempt remaining; false otherwise.

login

public void login(String value)

Verifies the PIN.

Parameters:

loginSO

public void loginSO(String value)

Verifies the Security Officer (administrator or unblocking) PIN

Parameters:

logout

public void logout()

Resets the verified status of the PIN (cancels a call to Pin.login(String)).