--- a/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java Thu Dec 13 09:02:52 2018 +0000
+++ b/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java Thu Dec 13 17:28:19 2018 +0800
@@ -33,7 +33,6 @@
import java.security.ProviderException;
import java.util.HashMap;
import java.util.Arrays;
-import java.util.Map;
import static sun.security.util.SecurityConstants.PROVIDER_VER;
@@ -86,36 +85,36 @@
}
} else if (type.equals("KeyStore")) {
if (algo.equals("Windows-MY")) {
- return new KeyStore.MY();
+ return new CKeyStore.MY();
} else if (algo.equals("Windows-ROOT")) {
- return new KeyStore.ROOT();
+ return new CKeyStore.ROOT();
}
} else if (type.equals("Signature")) {
if (algo.equals("NONEwithRSA")) {
- return new RSASignature.Raw();
+ return new CSignature.NONEwithRSA();
} else if (algo.equals("SHA1withRSA")) {
- return new RSASignature.SHA1();
+ return new CSignature.SHA1withRSA();
} else if (algo.equals("SHA256withRSA")) {
- return new RSASignature.SHA256();
+ return new CSignature.SHA256withRSA();
} else if (algo.equals("SHA384withRSA")) {
- return new RSASignature.SHA384();
+ return new CSignature.SHA384withRSA();
} else if (algo.equals("SHA512withRSA")) {
- return new RSASignature.SHA512();
+ return new CSignature.SHA512withRSA();
} else if (algo.equals("MD5withRSA")) {
- return new RSASignature.MD5();
+ return new CSignature.MD5withRSA();
} else if (algo.equals("MD2withRSA")) {
- return new RSASignature.MD2();
+ return new CSignature.MD2withRSA();
} else if (algo.equals("RSASSA-PSS")) {
- return new RSASignature.PSS();
+ return new CSignature.PSS();
}
} else if (type.equals("KeyPairGenerator")) {
if (algo.equals("RSA")) {
- return new RSAKeyPairGenerator();
+ return new CKeyPairGenerator.RSA();
}
} else if (type.equals("Cipher")) {
if (algo.equals("RSA") ||
algo.equals("RSA/ECB/PKCS1Padding")) {
- return new RSACipher();
+ return new CRSACipher();
}
}
} catch (Exception ex) {
@@ -147,47 +146,47 @@
* Key store
*/
putService(new ProviderService(p, "KeyStore",
- "Windows-MY", "sun.security.mscapi.KeyStore$MY"));
+ "Windows-MY", "sun.security.mscapi.CKeyStore$MY"));
putService(new ProviderService(p, "KeyStore",
- "Windows-ROOT", "sun.security.mscapi.KeyStore$ROOT"));
+ "Windows-ROOT", "sun.security.mscapi.CKeyStore$ROOT"));
/*
* Signature engines
*/
HashMap<String, String> attrs = new HashMap<>(1);
- attrs.put("SupportedKeyClasses", "sun.security.mscapi.Key");
+ attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey");
// NONEwithRSA must be supplied with a pre-computed message digest.
// Only the following digest algorithms are supported: MD5, SHA-1,
// SHA-256, SHA-384, SHA-512 and a special-purpose digest
// algorithm which is a concatenation of SHA-1 and MD5 digests.
putService(new ProviderService(p, "Signature",
- "NONEwithRSA", "sun.security.mscapi.RSASignature$Raw",
+ "NONEwithRSA", "sun.security.mscapi.CSignature$NONEwithRSA",
null, attrs));
putService(new ProviderService(p, "Signature",
- "SHA1withRSA", "sun.security.mscapi.RSASignature$SHA1",
+ "SHA1withRSA", "sun.security.mscapi.CSignature$SHA1withRSA",
null, attrs));
putService(new ProviderService(p, "Signature",
- "SHA256withRSA", "sun.security.mscapi.RSASignature$SHA256",
+ "SHA256withRSA", "sun.security.mscapi.CSignature$SHA256withRSA",
new String[] { "1.2.840.113549.1.1.11", "OID.1.2.840.113549.1.1.11" },
attrs));
putService(new ProviderService(p, "Signature",
- "SHA384withRSA", "sun.security.mscapi.RSASignature$SHA384",
+ "SHA384withRSA", "sun.security.mscapi.CSignature$SHA384withRSA",
new String[] { "1.2.840.113549.1.1.12", "OID.1.2.840.113549.1.1.12" },
attrs));
putService(new ProviderService(p, "Signature",
- "SHA512withRSA", "sun.security.mscapi.RSASignature$SHA512",
+ "SHA512withRSA", "sun.security.mscapi.CSignature$SHA512withRSA",
new String[] { "1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13" },
attrs));
putService(new ProviderService(p, "Signature",
- "RSASSA-PSS", "sun.security.mscapi.RSASignature$PSS",
+ "RSASSA-PSS", "sun.security.mscapi.CSignature$PSS",
new String[] { "1.2.840.113549.1.1.10", "OID.1.2.840.113549.1.1.10" },
attrs));
putService(new ProviderService(p, "Signature",
- "MD5withRSA", "sun.security.mscapi.RSASignature$MD5",
+ "MD5withRSA", "sun.security.mscapi.CSignature$MD5withRSA",
null, attrs));
putService(new ProviderService(p, "Signature",
- "MD2withRSA", "sun.security.mscapi.RSASignature$MD2",
+ "MD2withRSA", "sun.security.mscapi.CSignature$MD2withRSA",
null, attrs));
/*
@@ -196,7 +195,7 @@
attrs.clear();
attrs.put("KeySize", "16384");
putService(new ProviderService(p, "KeyPairGenerator",
- "RSA", "sun.security.mscapi.RSAKeyPairGenerator",
+ "RSA", "sun.security.mscapi.CKeyPairGenerator$RSA",
null, attrs));
/*
@@ -205,12 +204,12 @@
attrs.clear();
attrs.put("SupportedModes", "ECB");
attrs.put("SupportedPaddings", "PKCS1PADDING");
- attrs.put("SupportedKeyClasses", "sun.security.mscapi.Key");
+ attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey");
putService(new ProviderService(p, "Cipher",
- "RSA", "sun.security.mscapi.RSACipher",
+ "RSA", "sun.security.mscapi.CRSACipher",
null, attrs));
putService(new ProviderService(p, "Cipher",
- "RSA/ECB/PKCS1Padding", "sun.security.mscapi.RSACipher",
+ "RSA/ECB/PKCS1Padding", "sun.security.mscapi.CRSACipher",
null, attrs));
return null;
}