src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSAPublicKey.java
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSAPublicKey.java	Fri May 11 14:55:56 2018 -0700
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSAPublicKey.java	Fri May 11 15:53:12 2018 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,7 @@
 import java.security.KeyRep;
 import java.security.ProviderException;
 
+import sun.security.rsa.RSAUtil.KeyType;
 import sun.security.rsa.RSAPublicKeyImpl;
 
 /**
@@ -165,8 +166,8 @@
         if (encoding == null) {
 
             try {
-                encoding = new RSAPublicKeyImpl(getModulus(),
-                    getPublicExponent()).getEncoded();
+                encoding = RSAPublicKeyImpl.newKey(KeyType.RSA, null,
+                    getModulus(), getPublicExponent()).getEncoded();
 
             } catch (KeyException e) {
                 // ignore