ssif-api
TypeScript icon, indicating that this package has built-in type declarations

0.2.9 • Public • Published

Usage

Self Sovereign Identity Framework (SSIF) API The API is available as npm package https://www.npmjs.com/package/ssif-api and can be included in nodejs or javascript and retrieved using npm install. Typescript is used and propagated but not mandatory. The SsifApi manages connection with the claims registry (ERC780 alike contract on Rinkeby) and manages the open sessions that must exist to connect the users ID-App and the web service. The API does not offer direct gateway functionality, but function input/output can be mapped almost one on one on e.g. express or angular framework or other existing webserver framework functionality. See the example below. The idea is that the webserver has access to the necessary data and e.g. knows if the user in question is allready onboarded (use startSession) or needs to exchange key material because it is the first contact (use StartSessionFirstContact)

It is used in both Attestation Issuer (AI) and the Relying Party (RP)

SsifApi overview

Prerequisites

The software runs on nodejs with typescript.

Available functions

constructor SsifApi (ethereumProvider, contractAddress, [privateKey, [config]])

Initialize the API with location and access data to the ERC780 contract / address

static generateSessionId ()

A static function that can be used to generate a sessionId (which is a UUID)

addTrustEcdsaKoblitzSignature2016 (key)

set trust for a key this type of attestation (used in the KvK use case)

addTrustSSIFEthereumHash2017 (contract)

set trust for a contract of this type of attestation (legacy, used in the old rabo AI)

addTrustSsifErc780Hash2018 (issuer)

set trust for an issuer of this type of attestation (ERC780)

startSessionAutonomous (ssifCreateRequest)

When a session is started 'remote' i.e. not via the website hosted on this webserver, we do not have a sessionID and can not interact via QR-code with a users ID-App. All functions are therefor executed 'autonomously'. We use this function for the initial onboarding of a user in the Id-App, so the Id-App calls this function directly and (if authenticated), will receive a selection of attestations.

startSessionFirstContact (sessionId, ssifCreateRequest)

Use this function to start a session for a first encounter with this user and this attestor

startSession (sessionId, ssifCreateRequest)

Use this function to start a session in all other cases

getSession (sessionId)

offer this as a webservice 'get' endpoint

postSession (sessionId)

offer this as a webservice 'post' endpoint

Parameters

WIP

Readme

Keywords

none

Package Sidebar

Install

npm i ssif-api

Weekly Downloads

0

Version

0.2.9

License

Apache-2.0

Unpacked Size

122 kB

Total Files

24

Last publish

Collaborators

  • jnr101