Libsodium bindings for Java (JNI)
The API can be considered stable.
Libstodium provides Java (JNI) bindings for the libsodium methods.
This library implements JNI wrappers to functions from the libsodium library. The
library tries to implement zero-copy wherever possible through the use of direct
ByteBuffers. For applications using byte[] arrays, calls to libstodium methods can
still be made by wrapping each array with a call to ByteBuffer.wrap(). When using
arrays, the library will try to keep the amount of copying to a minimum, but
specifics depend entirely on the JVM used to run the code.
Credits to:
The library is heavily focussed on intergration with Android Studio and working
on Android systems.
The supported Android API versions are:
When you plan to use libstodium in an Android Studio project, I would recommend
cloning the repository into a subdirectory of the project root.
To start, download this repository (there is no need to download libsodium, the setup script handles this):
$ git clone https://github.com/ArteMisc/libstodium.git
(Optional) on Ubuntu, you can run this command to make sure everything is setup on your machine:
$ ./install_system_dependencies.sh
Next, run the setup script:
$ ./setup.sh # load Ndk and Swig, install libsodium and JNI bindings, cleanup
In order for setup to run correctly, the environment variable JAVA_HOME should be set.
If this is not the case, the script will quit. You can set the JAVA_HOME value usingexport JAVA_HOME=/path/to/java
or by running the command like this:
$ JAVA_HOME=/path/to/java ./setup.sh
Each part has its own software license, including: