![JAR search and dependency download from the Maven repository](/logo.png)
org.spongycastle.jsse.provider.SSLParametersUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bctls-jdk15on Show documentation
Show all versions of bctls-jdk15on Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
The newest version!
package org.spongycastle.jsse.provider;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.net.ssl.SSLParameters;
abstract class SSLParametersUtil
{
private static final Method getAlgorithmConstraints;
private static final Method setAlgorithmConstraints;
private static final Method getEndpointIdentificationAlgorithm;
private static final Method setEndpointIdentificationAlgorithm;
private static final Method getUseCipherSuitesOrder;
private static final Method setUseCipherSuitesOrder;
private static Class> getClassPrivileged(final String className)
{
return AccessController.doPrivileged(new PrivilegedAction>()
{
public Class> run()
{
try
{
ClassLoader loader = SSLParametersUtil.class.getClassLoader();
if (loader != null)
{
return loader.loadClass(className);
}
return Class.forName(className);
}
catch (Exception e)
{
return null;
}
}
});
}
private static Method getMethodPrivileged(final Class> clazz, final String methodName)
{
if (clazz == null)
{
return null;
}
return AccessController.doPrivileged(new PrivilegedAction()
{
public Method run()
{
try
{
return clazz.getMethod(methodName);
}
catch (Exception e)
{
return null;
}
}
});
}
private static Object invokeGetterPrivileged(final Object obj, final Method method)
{
return AccessController.doPrivileged(new PrivilegedAction
© 2015 - 2025 Weber Informatics LLC | Privacy Policy