import de.rtner.misc.BinTools;
import de.rtner.security.auth.spi.*;

/**
 * <p>
 * Request for Comments: 6070 PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2) Test Vectors
 * <p>
 * Ad-hoc test program that checks test #6.<br/>
 * Values are hard-coded. Compile and run with
 * <code>
 *   javac -cp PBKDF2-1.0.4.jar RFC6070Test6.java
 *   java -cp PBKDF2-1.0.4.jar;. RFC6070Test6
 * </code>
 * <p>
 * This piece of code is in the public domain.
 *
 * @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898</a>
 * @see <a href="http://tools.ietf.org/html/rfc6070">RFC 6070</a>
 * @author Matthias G&auml;rtner
 * @version 1.0
 */
class RFC6070Test6 {

	public static void main( String[] args ) {
		PBKDF2Parameters p = new PBKDF2Parameters("HmacSHA1","ISO-8859-1",null,0);
		new PBKDF2HexFormatter().fromString(p, "7361006C74:4096:56fa6aa75548099dcc37d7f03425e0c3");

		boolean verifyOK = new PBKDF2Engine(p).verifyKey("pass\0word");
		System.out.println(verifyOK ? "OK" : "FAIL");
	}
}
