Interface OwnerPINxWithPredecrement
-
public interface OwnerPINxWithPredecrement extends OwnerPINx
TheOwnerPINxWithPredecrement
interface represents an Owner PIN, extends Personal Identification Number functionality as defined in thePIN
interface, and provides the ability to update the PIN, update the try limit and try counter and thus owner functionality.The
OwnerPINxWithPredecrement
interface extends theOwnerPINx
to support the decrementing of the tries counter before any PIN validation attempts.- Since:
- 3.0.5
- See Also:
OwnerPINx
,OwnerPINBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
check(byte[] pin, short offset, byte length)
Comparespin
against the PIN value without decrementing the try counter.byte
decrementTriesRemaining()
Decrements the try counter if thePIN
is not blocked.-
Methods inherited from interface javacard.framework.OwnerPINx
getTryLimit, setTriesRemaining, setTryLimit, update
-
Methods inherited from interface javacard.framework.PIN
getTriesRemaining, isValidated, reset
-
-
-
-
Method Detail
-
decrementTriesRemaining
byte decrementTriesRemaining()
Decrements the try counter if thePIN
is not blocked. It also resets the validated flag. This method must be called prior to calling thecheck
method; the state for enforcing this constraint must be implemented as aCLEAR_ON_RESET
transient object; it must also be cleared when thecheck
method is called as well as when any other public method that affects the try counter, the validated flag, or the blocking state is called.Even if a transaction is in progress, update of internal state - the try counter, the validated flag, and the blocking state, shall not participate in the transaction.
In addition to returning a
byte
result, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResult
class, if supported by the platform.- Returns:
- the number of times remaining after decrementing.
-
check
boolean check(byte[] pin, short offset, byte length) throws PINException, ArrayIndexOutOfBoundsException, NullPointerException
Comparespin
against the PIN value without decrementing the try counter. If thePIN
is not blocked then: if the PIN value matches, it sets the validated flag and resets the try counter to its maximum; otherwise if the PIN value does not match, it resets the validated flag, decrements the try counter - if not assumed to having been pre-decremented - and, if the counter has reached zero, blocks thePIN
.Even if a transaction is in progress, update of internal state - the try counter, the validated flag, and the blocking state, shall not participate in the transaction.
Note:
- This method does not decrement the try counter. The
try counter must have been pre-decremented by a prior call
to the
decrementTriesRemaining
method. If thedecrementTriesRemaining
method has not been called prior to calling this method then aPINException
exception is thrown; the state for enforcing this constraint must be implemented as aCLEAR_ON_RESET
transient object; it must also be cleared when this method is called as well as when any other public method that affects the try counter, the validated flag, or the blocking state is called. - If
NullPointerException
orArrayIndexOutOfBoundsException
is thrown, the validated flag must be set to false and, thePIN
blocked if the counter reaches zero. - If
offset
orlength
parameter is negative anArrayIndexOutOfBoundsException
exception is thrown. - If
offset+length
is greater thanpin.length
, the length of thepin
array, anArrayIndexOutOfBoundsException
exception is thrown. - If
pin
parameter isnull
aNullPointerException
exception is thrown.
In addition to returning a
boolean
result, platform-implementations of this method set the result in an internal state which can be rechecked using assertion methods of theSensitiveResult
class, if supported by the platform.- Specified by:
check
in interfacePIN
- Parameters:
pin
- the byte array containing the PIN value being checkedoffset
- the starting offset in thepin
arraylength
- the length ofpin
- Returns:
true
if the PIN comparison is successful,false
otherwise.- Throws:
ArrayIndexOutOfBoundsException
- if the check operation would cause access of data outside array bounds.NullPointerException
- ifpin
isnull
PINException
- with the following reason codes:ILLEGAL_STATE
if thedecrementTriesRemaining
method has not been called prior to calling this method.
- This method does not decrement the try counter. The
try counter must have been pre-decremented by a prior call
to the
-
-