Class BouncyCastleUtil


  • public final class BouncyCastleUtil
    extends java.lang.Object
    Contains methods that can be used to detect if BouncyCastle is available.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.security.Provider getBcProviderJce()
      Get the BouncyCastle Java Crypto Extensions provider, or throw an exception if it is unavailable.
      static java.security.Provider getBcProviderJsse()
      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 public SSLEngine sub-class that is used by bouncy-castle or null if it can't be loaded.
      static boolean isBcJsseInUse​(javax.net.ssl.SSLEngine engine)
      Indicates whether the given SSLEngine is implemented by BouncyCastle.
      static boolean isBcPkixAvailable()
      Indicate whether the BouncyCastle Public-Key Infrastructure utilities are available.
      static boolean isBcProvAvailable()
      Indicate whether the BouncyCastle Java Crypto Extensions provider is available.
      static boolean isBcTlsAvailable()
      Indicate whether the BouncyCastle Java Secure Socket Extensions provider is available.
      static java.lang.Throwable unavailabilityCauseBcPkix()  
      static java.lang.Throwable unavailabilityCauseBcProv()  
      static java.lang.Throwable unavailabilityCauseBcTls()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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. null if available.
      • unavailabilityCauseBcPkix

        public static java.lang.Throwable unavailabilityCauseBcPkix()
        Returns:
        the cause if unavailable. null if available.
      • unavailabilityCauseBcTls

        public static java.lang.Throwable unavailabilityCauseBcTls()
        Returns:
        the cause if unavailable. null if 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 public SSLEngine sub-class that is used by bouncy-castle or null if it can't be loaded.
        Returns:
        engine class.