RFR: 8367326: Refactor PEM API tests requiring PEMRecord usage
Matthew Donovan
mdonovan at openjdk.org
Thu Nov 20 17:17:06 UTC 2025
On Mon, 17 Nov 2025 16:56:03 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
> Changed to use PEM API:
> * test/jdk/sun/security/validator/PKIXValAndRevCheckTests.java
> * test/jdk/sun/security/rsa/pss/PSSKeyCompatibility.java
> * test/jdk/sun/security/pkcs11/rsa/TestKeyFactory.java
test/jdk/sun/security/rsa/TestKeyFactory.java line 237:
> 235:
> 236: private static void test(KeyFactory kf, Key key) throws Exception {
> 237: if (!key.getAlgorithm().equals("RSA")) {
I know you didn't add this if-statement, but it's weird that it (and the one in `testKey()`) exists. This is a test for RSA keys and the main method explicitly creates an RSA key pair generator. It seems to me that if this method is suddenly getting a non-RSA key, that's something we'd like to know in the form of a test failure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28356#discussion_r2546865150
More information about the security-dev
mailing list