Package io.netty.handler.ssl.util
Class BouncyCastleUtil
- java.lang.Object
-
- io.netty.handler.ssl.util.BouncyCastleUtil
-
public final class BouncyCastleUtil extends java.lang.ObjectContains methods that can be used to detect if BouncyCastle is available.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classBouncyCastleUtil.BcPkixprivate static classBouncyCastleUtil.BcProvprivate static classBouncyCastleUtil.BcTls
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringBC_FIPS_PROVIDERprivate static java.lang.StringBC_FIPS_PROVIDER_NAMEprivate static java.lang.StringBC_JSSE_ALPN_SELECTORprivate static java.lang.StringBC_JSSE_PROVIDERprivate static java.lang.StringBC_JSSE_PROVIDER_NAMEprivate static java.lang.StringBC_JSSE_SSLENGINEprivate static java.lang.StringBC_PEMPARSERprivate static java.lang.StringBC_PROVIDERprivate static java.lang.StringBC_PROVIDER_NAMEprivate static InternalLoggerlogger
-
Constructor Summary
Constructors Modifier Constructor Description privateBouncyCastleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.ProvidergetBcProviderJce()Get the BouncyCastle Java Crypto Extensions provider, or throw an exception if it is unavailable.static java.security.ProvidergetBcProviderJsse()Get the BouncyCastle Java Secure Socket Extensions provider, or throw an exception if it is unavailable.static java.lang.Class<? extends javax.net.ssl.SSLEngine>getBcSSLEngineClass()Returns the publicSSLEnginesub-class that is used by bouncy-castle ornullif it can't be loaded.private static booleanincludeLoadingErrorStackTrace(java.lang.Throwable e)static booleanisBcJsseInUse(javax.net.ssl.SSLEngine engine)Indicates whether the given SSLEngine is implemented by BouncyCastle.static booleanisBcPkixAvailable()Indicate whether the BouncyCastle Public-Key Infrastructure utilities are available.static booleanisBcProvAvailable()Indicate whether the BouncyCastle Java Crypto Extensions provider is available.static booleanisBcTlsAvailable()Indicate whether the BouncyCastle Java Secure Socket Extensions provider is available.(package private) static voidreset()Reset the loaded providers.static java.lang.ThrowableunavailabilityCauseBcPkix()static java.lang.ThrowableunavailabilityCauseBcProv()static java.lang.ThrowableunavailabilityCauseBcTls()
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
-
BC_PROVIDER_NAME
private static final java.lang.String BC_PROVIDER_NAME
- See Also:
- Constant Field Values
-
BC_PROVIDER
private static final java.lang.String BC_PROVIDER
- See Also:
- Constant Field Values
-
BC_FIPS_PROVIDER_NAME
private static final java.lang.String BC_FIPS_PROVIDER_NAME
- See Also:
- Constant Field Values
-
BC_FIPS_PROVIDER
private static final java.lang.String BC_FIPS_PROVIDER
- See Also:
- Constant Field Values
-
BC_JSSE_PROVIDER_NAME
private static final java.lang.String BC_JSSE_PROVIDER_NAME
- See Also:
- Constant Field Values
-
BC_JSSE_PROVIDER
private static final java.lang.String BC_JSSE_PROVIDER
- See Also:
- Constant Field Values
-
BC_PEMPARSER
private static final java.lang.String BC_PEMPARSER
- See Also:
- Constant Field Values
-
BC_JSSE_SSLENGINE
private static final java.lang.String BC_JSSE_SSLENGINE
- See Also:
- Constant Field Values
-
BC_JSSE_ALPN_SELECTOR
private static final java.lang.String BC_JSSE_ALPN_SELECTOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isBcProvAvailable
public static boolean isBcProvAvailable()
Indicate whether the BouncyCastle Java Crypto Extensions provider is available.
-
isBcPkixAvailable
public static boolean isBcPkixAvailable()
Indicate whether the BouncyCastle Public-Key Infrastructure utilities are available.
-
isBcTlsAvailable
public static boolean isBcTlsAvailable()
Indicate whether the BouncyCastle Java Secure Socket Extensions provider is available.
-
unavailabilityCauseBcProv
public static java.lang.Throwable unavailabilityCauseBcProv()
- Returns:
- the cause if unavailable.
nullif available.
-
unavailabilityCauseBcPkix
public static java.lang.Throwable unavailabilityCauseBcPkix()
- Returns:
- the cause if unavailable.
nullif available.
-
unavailabilityCauseBcTls
public static java.lang.Throwable unavailabilityCauseBcTls()
- Returns:
- the cause if unavailable.
nullif available.
-
isBcJsseInUse
public static boolean isBcJsseInUse(javax.net.ssl.SSLEngine engine)
Indicates whether the given SSLEngine is implemented by BouncyCastle.
-
getBcProviderJce
public static java.security.Provider getBcProviderJce()
Get the BouncyCastle Java Crypto Extensions provider, or throw an exception if it is unavailable.
-
getBcProviderJsse
public static java.security.Provider getBcProviderJsse()
Get the BouncyCastle Java Secure Socket Extensions provider, or throw an exception if it is unavailable.
-
getBcSSLEngineClass
public static java.lang.Class<? extends javax.net.ssl.SSLEngine> getBcSSLEngineClass()
Returns the publicSSLEnginesub-class that is used by bouncy-castle ornullif it can't be loaded.- Returns:
- engine class.
-
reset
static void reset()
Reset the loaded providers. Useful for testing, to redo the loading under different conditions.
-
includeLoadingErrorStackTrace
private static boolean includeLoadingErrorStackTrace(java.lang.Throwable e)
-
-