0.01
The project is in a healthy, maintained state
Okapi Ruby native binary bindings - including the required binaries for supported platforms
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

~> 0.1.0
~> 1.15
~> 1.1
~> 13.0
~> 3.2
 Project Readme

Tools and libraries for managing digital identity

Golang Java Platform Libraries Python Ruby Wasm

This repo provides bindings in all popular languages for the core Okapi functionalities:

  • Support for working with did:key method
  • Security tools for authentication with Oberon
  • Experimental implementation of DIDComm Messaging protocol for gRPC
  • Linked Data Proofs using non-LD processing signatures, such as JcsEd25519Signature2020
  • On the roadmap: BBS+ Signatures

Library is available for use with different languages

Gem Go) Nuget npm PyPI Rust Swift

Installation

See the language specific README in each folder of this repo for usage. Additionally, check the okapi-examples for some quick sample applications.

Native Libraries

If the bindings in your language require the native libraries to be installed on your system (like Go, Python, Java, etc), you can use one of the following methods to install them:

Homebrew (MacOS and Linux)

We maintain a Homebrew Tap with bottles for MacOS and Linux. To install run:

brew install trinsic-id/tap/okapi

dpkg for Linux

You can find .deb packages for your platform with each release. These can be installed using dpkg. Choose the package for your architecture. The packages will install the required libraries and header files.

wget https://github.com/trinsic-id/okapi/releases/download/v1.1.0/okapi_1.1.0_amd64.deb

dpkg -i okapi_1.1.0_amd64.deb

win-get for Windows

winget install okapi

Library and API structure

The main library is built in Rust and exposed to other languages through a C-callable FFI. The function signatures for each method are exposed as byte arrays, that use Protobuf for the main IDL. This allows easy development and maintainance of new methods, with minimal language specific implementation.

All library methods are exposed via static method calls, generally grouped under a dedicated class in the Okapi namespace (where available).

For example, to generate new key using .NET you can use the DIDKey class.

For mathematical languages and environments, use the Python packages. Examples for MATLAB, Mathematica, R(lang), etc. can be found here: https://github.com/trinsic-id/okapi-examples

using Okapi.Keys;

var key = DIDKey.Generate(new GenerateKeyRequest { KeyType = KeyType.Ed25519 });

The same functionality for Node is exposed as:

import * from "okapi";

let request = new GenerateKeyRequest();
request.setKeyType(KeyType.Ed25519);

var key = DIDKey.generate(request);

API Reference

DIDKey

  • generate
  • resolve

DIDComm

  • pack
  • unpack
  • sign
  • verify

LdProofs

  • create_proof
  • verify_proof

Oberon

  • create_key
  • create_token
  • blind_token
  • unblind_token
  • create_proof
  • verify_proof

Development

Compile Protobuf

Some languages have support for compiling the protobuf definitions directly (.NET, node, rust), some (Java, Go, Python, Ruby) require use of a separate Python script located ./devops/generate_proto_files.py. The github action Push to buf.build will also create a branch called update-protobuf-generated-files with any changes.

Stats

Alt