Package org.conscrypt

Class NativeCryptoJni

java.lang.Object
org.conscrypt.NativeCryptoJni

final class NativeCryptoJni extends Object
Helper to initialize the JNI libraries. This version runs when compiled as part of a host OpenJDK build.
  • Field Details

  • Constructor Details

    • NativeCryptoJni

      private NativeCryptoJni()
  • Method Details

    • init

      static void init() throws UnsatisfiedLinkError
      Attempts to load the shared JNI library. First try loading the platform-specific library name (e.g. conscrypt_openjdk_jni-linux-x86_64). If that doesn't work, try to load the library via just the prefix (e.g. conscrypt_openjdk_jni). If not found, try the static library name. The non-suffixed dynamic library name is used by the Android build system, which builds the appropriate library for the system it's being run on under that name. The static library name is needed in order to support Java 8 static linking (http://openjdk.java.net/jeps/178), where the library name is used to invoke a library-specific load method (i.e. JNI_OnLoad_conscrypt).
      Throws:
      UnsatisfiedLinkError - if the library failed to load.
    • logResults

      private static void logResults(List<NativeLibraryLoader.LoadResult> results)
    • throwBestError

      private static void throwBestError(List<NativeLibraryLoader.LoadResult> results)
    • classLoader

      private static ClassLoader classLoader()
    • platformLibName

      private static String platformLibName()
    • osName

      private static String osName()
    • archName

      private static String archName()