diff --git a/jdk/test/sun/security/pkcs11/rsa/TestP11KeyFactoryGetRSAKeySpec.java b/jdk/test/sun/security/pkcs11/rsa/TestP11KeyFactoryGetRSAKeySpec.java index b4c467638c5..2b29b3f12f8 100644 --- a/jdk/test/sun/security/pkcs11/rsa/TestP11KeyFactoryGetRSAKeySpec.java +++ b/jdk/test/sun/security/pkcs11/rsa/TestP11KeyFactoryGetRSAKeySpec.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Amazon.com, Inc. or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -21,7 +22,6 @@ * questions. */ -import java.math.BigInteger; import java.security.KeyFactory; import java.security.KeyPair; import java.security.KeyPairGenerator; @@ -85,7 +85,7 @@ public void main(Provider p) throws Exception { private static void testKeySpec(KeyFactory factory, PrivateKey key, Class specClass) throws Exception { try { - KeySpec spec = factory.getKeySpec(key, RSAPrivateKeySpec.class); + KeySpec spec = factory.getKeySpec(key, specClass); if (testingSensitiveKeys) { throw new Exception("Able to retrieve spec from sensitive key"); }