8086002: Move apple.security.AppleProvider to a proper module

Move Apple provider to java.base module with "libosxsecurity" native library.

Reviewed-by: mchung
This commit is contained in:
Valerie Peng 2015-08-18 21:16:27 +00:00
parent 71cc6f510a
commit 33abd28183
7 changed files with 85 additions and 2 deletions

View file

@ -178,6 +178,26 @@ final class ProviderConfig {
p = new com.sun.crypto.provider.SunJCE();
} else if (provName.equals("SunJSSE") || provName.equals("com.sun.net.ssl.internal.ssl.Provider")) {
p = new com.sun.net.ssl.internal.ssl.Provider();
} else if (provName.equals("Apple") || provName.equals("apple.security.AppleProvider")) {
// need to use reflection since this class only exists on MacOsx
p = AccessController.doPrivileged(new PrivilegedAction<Provider>() {
public Provider run() {
try {
Class<?> c = Class.forName("apple.security.AppleProvider");
if (Provider.class.isAssignableFrom(c)) {
return (Provider) c.newInstance();
} else {
return null;
}
} catch (Exception ex) {
if (debug != null) {
debug.println("Error loading provider Apple");
ex.printStackTrace();
}
return null;
}
}
});
} else {
if (isLoading) {
// because this method is synchronized, this can only