--- 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);
}
}