jdk/src/share/classes/sun/security/pkcs11/P11Key.java
changeset 17491 7a33824ec8c5
parent 11521 d7698e6c5f51
child 18809 97f5713a0f1a
child 20813 0ad12d66a652
--- a/jdk/src/share/classes/sun/security/pkcs11/P11Key.java	Tue May 14 20:16:21 2013 +0400
+++ b/jdk/src/share/classes/sun/security/pkcs11/P11Key.java	Tue May 14 18:08:18 2013 +0100
@@ -47,6 +47,7 @@
 
 import sun.security.util.DerValue;
 import sun.security.util.Length;
+import sun.security.util.ECUtil;
 
 /**
  * Key implementation classes.
@@ -984,9 +985,9 @@
             if (encoded == null) {
                 fetchValues();
                 try {
-                    Key key = new sun.security.ec.ECPrivateKeyImpl(s, params);
+                    Key key = ECUtil.generateECPrivateKey(s, params);
                     encoded = key.getEncoded();
-                } catch (InvalidKeyException e) {
+                } catch (InvalidKeySpecException e) {
                     throw new ProviderException(e);
                 }
             }
@@ -1064,9 +1065,8 @@
             if (encoded == null) {
                 fetchValues();
                 try {
-                    Key key = new sun.security.ec.ECPublicKeyImpl(w, params);
-                    encoded = key.getEncoded();
-                } catch (InvalidKeyException e) {
+                    return ECUtil.x509EncodeECPublicKey(w, params);
+                } catch (InvalidKeySpecException e) {
                     throw new ProviderException(e);
                 }
             }