SpruceKit
SpruceID
  • 🌲SpruceKit Introduction
    • Decentralized Identity Overview
    • Glossary
  • ⚡Quickstart
  • SpruceKit Mobile
    • SpruceKit Showcase App
      • Installation
      • Getting Started
      • Issue a Showcase Credential
      • Present a Showcase Credential
    • SpruceKit Mobile SDK
      • Introduction
      • Core Components
        • StorageManager
        • KeyManager
        • CredentialPack
        • Card
        • IsoMdlPresentation
        • mDocReader/IsomDLReader
        • Document Scanner
      • SpruceKit iOS SDK
        • Installation
        • Build a Wallet
          • Accept a W3C VC
          • Present a W3C VC
          • Present mDL in-person/offline
          • Present an mDL over the internet
        • Build a Verifier
          • Verify a W3C VC
          • Verify an mDL in-person/offline
          • Verify an mDL over the internet
      • SpruceKit Android SDK
        • Installation
        • Build a Wallet
          • Accept a W3C VC
          • Present a W3C VC
          • Present an mDL in-person/offline
          • Present an mDL over the internet
        • Build a Verifier
          • Verify a W3C VC
          • Verify an mDL in-person/offline
          • Verify an mDL over the internet
  • Verifiable Digital Credentials
    • ⚙️DIDKit
      • Installation
      • Core Concepts
      • DID Methods
      • Runtime Configuration
      • Specifications and Dependencies
      • Quickstart
      • DIDKit Packages
        • Command Line Interface
        • HTTP Server
        • Rust Crate
        • C Interface
        • Java and Android
        • Python
        • Javascript
      • DIDKit Examples
        • Core Functions (CLI)
        • Core Functions (HTTP)
        • did-web in minutes
        • Batch Generation & Verification
    • 🪪ISO mDL
      • Quickstart
      • Core Concepts
      • User Guide
  • Schema Definition Language
    • 🔗TreeLDR
      • TreeLDR Quickstart
        • First Schema
        • Compilation into JSON Schema
        • Compilation into JSON-LD Context
        • Writing a Layout
        • Simple Rust Integration
      • Types
        • Literal Types
      • Layouts
        • Primitive Layouts
        • Literal Layouts
        • Enumeration
        • Array Layout
        • References
      • Compiling
        • Schema Definition Formats
          • JSON Schema
          • JSON-LD Context
          • Resource Description Framework (RDF)
        • Programming Languages
          • Compiling to Rust
      • RDF Vocabulary
      • 💡TreeLDR Basics
        • Types and Layouts
        • Properties
        • Syntax
  • Witness for Credential Claims
    • 🔭Rebase
      • Core Library
      • Rust Client/Witness SDK
      • WASM Client SDK
      • Simple "Basic Post" Schema
      • DNS Witness Flow Schema
  • References
    • Contributing
    • Code of Conduct
Powered by GitBook
On this page
  • At a Glance
  • Installation
  • Android
  • Examples

Was this helpful?

  1. Verifiable Digital Credentials
  2. DIDKit
  3. DIDKit Packages

Java and Android

both Java and Android developers access DIDKit through the Java bindings

PreviousC InterfaceNextPython

Last updated 7 months ago

Was this helpful?

At a Glance

  • DIDKit exposes a straightforward set of Java bindings, using the Java Native Interface ().

  • The file includes all of DIDKit's Java class files. To use this in an application, you must also include the shared library (libdidkit.so) in your application in the Java library path.

  • For a quick function & type reference, you can study the .

Installation

Install Rust and DIDKit as usual and then:

Build

Run:

# from DIDKit root directory:
make -C lib ../target/didkit.jar

To build the shared library for your current platform/architecture:

# from DIDKit root directory:
make -C lib ../target/release/libdidkit.so

Test

# from DIDKit root directory:
make -C lib ../target/tests/java.stamp

+ Android

Android

Requires

Android SDK and NDK for Linux x86_64. The Android SDK is expected to be installed at ~/Android/Sdk. If it is somewhere else instead, you can specify it with a Make variable, e.g. make ANDROID_SDK_ROOT=/other/location/android-sdk.

Rust Android targets are also required. To install those with rustup, run:

//from root directory of didkit project
make -C lib install-rustup-androidCopy

Build

//from root directory of didkit project
make -C lib ../target/test/aar.stampCopy

Make variables

  • ANDROID_SDK_ROOT - path to Android SDK. Default: ~/Android/Sdk

  • ANDROID_TOOLS - Android tools directory. Default is to pick one matching $(ANDROID_SDK_ROOT)/build-tools/*.

  • ANDROID_NDK_HOME - Android NDK directory. Default is $(ANDROID_SDK_ROOT)/ndk-bundle) if exists, or one matching $(ANDROID_SDK_ROOT)/ndk/*.

Examples

Tool
Example

Authentication, Tomcat, CHAPI

Authentication, Maven, MySQL, Redis

For Android, build the separate which includes the Java class files and shared libraries for all Android targets.

for DIDKit. The AAR file includes Java class files using , and binary shared libraries for Android's supported architectures (x86, armeabi-v7a, arm64-v8a, x86_64). The AAR can be added to existing Android projects using Android Studio or Gradle.

⚙️
JNI
JAR
DIDKitTest.java file
Android Library (AAR file)
JNI
Android library (AAR file)
Github
Github