Package org.conscrypt

Class NativeCryptoJni


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

      • DYNAMIC_LIB_NAME_PREFIX

        private static final java.lang.String DYNAMIC_LIB_NAME_PREFIX
        See Also:
        Constant Field Values
    • Constructor Detail

      • NativeCryptoJni

        private NativeCryptoJni()
    • Method Detail

      • init

        static void init()
                  throws java.lang.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:
        java.lang.UnsatisfiedLinkError - if the library failed to load.
      • classLoader

        private static java.lang.ClassLoader classLoader()
      • platformLibName

        private static java.lang.String platformLibName()
      • osName

        private static java.lang.String osName()
      • archName

        private static java.lang.String archName()