Hypersign Verifiable Credential SDK

The Hypersign Verifiable Credential comply W3C Verifiable Credentials Data Model v1.1 specification whose status can be stored in Hypersign Credential Revocation Registry on Hypersign Identity Blockchain Network.

Read Hypersign Verifiable Credential (VC)for more details.

HypersignVerifiableCredentail SDK

Is a javascript library for verifiable credentials operation (generate, issue etc). It also provides APIs to store/update/retrieve credential status to/from the Hypersign Credential Revocation Registry on the Hypersign Blockchain network easily.

NOTES

  1. Let us assume that we have created a DID - acting as an issuer and subject both (for demonstration purpose) - and have also registered a schema on the Hypersign blockchain. See documentation for HypersignDID and HypersignSchema before proceeding.

  2. The subject DID may or may not be a private DID. Read concept of private and public DIDs here.

Table of Contents

Install The Package

Import The Package

APIs

Initialize instance of HypersignVerifiableCredential with offlineSigner

Create Instance of the class

OfflineSigner

You may follow this this code snippet for creating OfflineSigner

Call init() to initialize the offlineSigner

generate()

Generates a new credential document of type IVerifiableCredential

API Definition

Usage

Output

issue()

Signs a credential document and registers credential status on the Hypersign blockchain.

API Definition

Usage

Output

Note: When we issue credential, only cryptographic hash of the credential document get stored on the blockchain for privacy purpose and security purpose. The credentialHash in credentialStatus is a digest of the verifiable credential, generated using sha256 hashing algorithm which is of length 256 bits and is represented into 64 HEX characters.

verify()

Verfies signed/issued credential

API Definition

Usage

Output

resolveCredentialStatus()

Resolves credential status from Hypersign Blokchain and returns status of the credential of type CredentialStatus

API Definition

Usage

Output

updateCredentialStatus()

Updates credential status into Hypersign Blokchain

API Definition

Usage

Supported status: LIVE, SUSPENDED, REVOKED and EXPIRED. Please read the doc for more details about status.

Output

Security Concerns

// TODO

Last updated