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
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.
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.
npm i https://github.com/hypersign-protocol/hid-ssi-js-sdk --save
import { HypersignVerifiableCredential } from 'hs-ssi-sdk';
const hypersignVC = new HypersignVerifiableCredential({
offlineSigner, // OPTIONAL signer of type OfflineSigner
nodeRestEndpoint: 'https://api.jagrat.hypersign.id', // OPTIONAL RPC endpoint of the Hypersign blockchain, Default 'TEST'
nodeRpcEndpoint: 'https://rpc.jagrat.hypersign.id', // OPTIONAL REST endpoint of the Hypersign blockchain
namespace: 'testnet', // OPTIONAL namespace of did, Default ''
});
// OR Just initalize with offlineSigner
const hypersignVC = new HypersignVerifiableCredential({
offlineSigner
})