--- old/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java 2018-09-18 15:57:59.864378635 +0200 +++ new/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyPairGenerator.java 2018-09-18 15:57:59.695377498 +0200 @@ -415,10 +415,10 @@ long[] keyIDs = token.p11.C_GenerateKeyPair (session.id(), new CK_MECHANISM(mechanism), publicKeyTemplate, privateKeyTemplate); - PublicKey publicKey = P11Key.publicKey - (session, keyIDs[0], algorithm, keySize, publicKeyTemplate); - PrivateKey privateKey = P11Key.privateKey - (session, keyIDs[1], algorithm, keySize, privateKeyTemplate); + PublicKey publicKey = P11Key.publicKey(session, keyIDs[0], + algorithm, keySize, publicKeyTemplate, true); + PrivateKey privateKey = P11Key.privateKey(session, keyIDs[1], + algorithm, keySize, privateKeyTemplate, true); return new KeyPair(publicKey, privateKey); } catch (PKCS11Exception e) { throw new ProviderException(e);