public boolean verifyKeyFormatted ( String formatted , String candidatePassword ) { // Parameter as member of Engine was not the smartest design decision back then... PBKDF2Parameters p = getParameters ( ) ; PBKDF2Parameters q = new PBKDF2Parameters ( ) ; q . hashAlgorithm = p . hashAlgorithm ; q . hashCharset = p . hashCharset ; boolean verifyOK = false ; if ( ! getFormatter ( ) . fromString ( q , formatted ) ) { try { setParameters ( q ) ; verifyOK = verifyKey ( candidatePassword ) ; } finally { setParameters ( p ) ; } } return verifyOK ; }
Verification function .