/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 5083253
* @summary Verify that PBKDF2WithHmacSHA1 SecretKeyFactory works.
* @author Valerie Peng
*/
public class PBKDF2HmacSHA1FactoryTest {
/*
* Use test vectors found in the appendix B of RFC 3962
* "Advanced Encryption Standard (AES) Encryption for Kerberos 5"
*/
"cdedb5281bb2f801565a1122b25635150ad1f7a04bb9f3a333ecc0e2e1f70837"),
"01dbee7f4a9e243e988b62c73cda935da05378b93244ec8f48a99e61ad799d86"),
"5c08eb61fdf71e4e4ec3cf6ba1f5512ba7e52ddbc5e5142f708a31e2e62b1e13"),
"d1daa78615f287e6a1c8b120d7062a493f98d203e6be49a6adf4fa574b6e64ee"),
new TestVector(1200,
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pass phrase equals block size",
"139c30c0966bc32ba55fdbf212530ac9c5ec59f1a452f5cc9ad940fea0598ed1"),
new TestVector(1200,
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"pass phrase exceeds block size",
"9ccad6d468770cd51b10e6a68721be611a8b4d282601db3b36be9246915ec82a"),
"EXAMPLE.COMpianist",
"6b9cf26d45455a43a5b8bb276a403b39e7fe37a0c41e02c281ff3069e1e94f52"),
};
throw new Exception("Wrong format for derived key");
}
throw new Exception("Wrong length for derived key");
}
// Test generateSecret(...) using test vectors
throw new Exception("Wrong value for derived key");
}
// Test getKeySpec(...)
throw new Exception("Wrong derived keySpec");
}
}
}
}
return true;
}
return false;
}
char[] res = new char[2];
}
}
}
return bytes;
}
test();
}
}
class TestVector {
try {
expectedVals = null;
}
}
try {
expectedVals = null;
}
}
}
try {
for (int i = 0; i < numOfKeySizes; i++) {
}
expectedVals = null;
}
}
}