Java Reference

Overview

Keychain Core has a Java interface which can be used to write applications anywhere the JVM is available - which today is almost anywhere!

The Java wrapper in v2.4 has some non-obvious differences with Keychain Core that the developer should be aware of. See [the notes below] for more information.

Objects

CharEncoding

Character encoding enumeration

Contact

A Facade which is managed outside of this Gateway

DirectoryThread

Thread used by the PairHelper utility

Exceptions

The various Exceptions that can be thrown from the wrapper

Facade

Class representing a self-sovereign identity

Gateway

The cryptographic management object which also refreshes itself with blockchain updates

MonitorThreadState

Enumeration for the monitor thread state

PairHelper

Development/POC example of a bare-bones Trusted Directory interface

PersonaStatus

Facade blockchain state enumeration

Persona

A Facade which is managed by this Gateway

Refreshable

Provided to Monitor to respond to block update callbacks

SecurityLevel

Encryption strength enumeration

Settings

Abstraction of configuration file

Uri

Location of Facade certificate on blockchain

Verification

Information about a signature’s validity

VerificationResult

Result of verifying a signed message

Notes

  1. Almost every method throws unchecked Exception if there is an internal error in the Keychain library. While in future versions of the wrapper these will be turned into checked exceptions with better names, in the meantime please wrap important sections of code with try and catch(Exception)

  2. Pay special attention to methods in Gateway, specifically

    1. Monitor has been subsumed into Gateway and now Gateway owns blockchain communication.

    2. The Gateway#decryptAndVerify works differently than Gateway#verify. In the former, all signatures are checked for validity and contact presence and only if all are true is the plaintext message returned; access to the VerificationResult itself is not there. In the latter, you get a VerificationResult and can do fine-grained checks.