src/com/makina/security/OpenFIPS201/PIV.java
public void verifyGetStatus(byte id) {

        OwnerPIN pin = null;

        switch (id) {

        case ID_KEY_GLOBAL_PIN:

            // Make sure FEATURE_PIN_GLOBAL_ENABLED is set
            if (!Config.FEATURE_PIN_GLOBAL_ENABLED) ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
            pin = cspPIV.globalPIN;
            break;

        case ID_KEY_PIN:
            // Make sure FEATURE_PIN_CARD_ENABLED is set
            if (!Config.FEATURE_PIN_CARD_ENABLED) ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
            pin = cspPIV.cardPIN;
            break;

        default:
            ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
        }

        // If P1='00', and Lc and the command data field are absent, the command can be used to retrieve the
        // number of further retries allowed ('63 CX'), or to check whether verification is not needed ('90 00').

        // Check for blocked
        if (pin.getTriesRemaining() == (byte)0) ISOException.throwIt(SW_OPERATION_BLOCKED);

        // If we are not validated
        if (!pin.isValidated()) {
            // Return the number of retries remaining
            ISOException.throwIt((short)(SW_RETRIES_REMAINING | (short)pin.getTriesRemaining()));
        }

        // If we got this far we are authenticated, so just return (9000)
    }
/**
     * Implements the variant of the 'VERIFY' command that returns the status of the requested PIN
     * @param id The requested PIN reference
     */
Implements the variant of the 'VERIFY' command that returns the status of the requested PIN
@param id The requested PIN reference
Implements the variant of the ' VERIFY ' command that returns the status of the requested PIN @param id The requested PIN reference
public void verifyGetStatus(byte id) {
        OwnerPIN pin = null;
        switch (id) {
        case ID_KEY_GLOBAL_PIN:
            if (!Config.FEATURE_PIN_GLOBAL_ENABLED) ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
            pin = cspPIV.globalPIN;
            break;
        case ID_KEY_PIN:
            if (!Config.FEATURE_PIN_CARD_ENABLED) ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
            pin = cspPIV.cardPIN;
            break;
        default:
            ISOException.throwIt(SW_REFERENCE_NOT_FOUND);
        }
        if (pin.getTriesRemaining() == (byte)0) ISOException.throwIt(SW_OPERATION_BLOCKED);
        if (!pin.isValidated()) {
            ISOException.throwIt((short)(SW_RETRIES_REMAINING | (short)pin.getTriesRemaining()));
        }
    }
public void verifyGetStatus ( byte id ) { OwnerPIN pin = null ; switch ( id ) { case ID_KEY_GLOBAL_PIN : if ( ! Config . FEATURE_PIN_GLOBAL_ENABLED ) ISOException . throwIt ( SW_REFERENCE_NOT_FOUND ) ; pin = cspPIV . globalPIN ; break ; case ID_KEY_PIN : if ( ! Config . FEATURE_PIN_CARD_ENABLED ) ISOException . throwIt ( SW_REFERENCE_NOT_FOUND ) ; pin = cspPIV . cardPIN ; break ; default : ISOException . throwIt ( SW_REFERENCE_NOT_FOUND ) ; } if ( pin . getTriesRemaining ( ) == ( byte ) 0 ) ISOException . throwIt ( SW_OPERATION_BLOCKED ) ; if ( ! pin . isValidated ( ) ) { ISOException . throwIt ( ( short ) ( SW_RETRIES_REMAINING | ( short ) pin . getTriesRemaining ( ) ) ) ; } }
Implements the variant of the 'VERIFY' command that returns the status of the requested PIN
 @param id The requested PIN reference
Implements the variant of the ' VERIFY ' command that returns the status of the requested PIN @param id The requested PIN reference
// Make sure FEATURE_PIN_GLOBAL_ENABLED is set // Make sure FEATURE_PIN_CARD_ENABLED is set // If P1='00', and Lc and the command data field are absent, the command can be used to retrieve the // number of further retries allowed ('63 CX'), or to check whether verification is not needed ('90 00'). // Check for blocked // If we are not validated // Return the number of retries remaining // If we got this far we are authenticated, so just return (9000)