@zedeid-sdk/sd-vc-lib
v2.0.0
Published
Issue, present and verify selectively disclosable credentials
Downloads
40
Keywords
Readme
sd-vc-lib
Package for issue, present and verify selectively disclossable verifiable credentials.
Also available via: https://cdn.jsdelivr.net/npm/@zedeid-sdk/sd-vc-lib/dist/browser/zedeid-vcsd.js
Breaking changes
Credentials and presentations issued with v1.0.0 will no longer be valid with v2.0.0
Usage
issue
import { issue } from 'sd-vc-lib';
Issue selectively disclosable credentials for given claims.
Parameters
- signerPrivateKey | issuer: string | Signer - hex-encoded private key(Ethereum) | signer object for issuer
- claims: Claims - list of key-value pairs.
- holderPublicKey: string - hex-encoded public key(Ethereum)
Returns
- VC - signed selectively disclosable verifiable credential.
present
import { present } from 'sd-vc-lib';
Present given list of verifiable credentials.
Parameters
- holderPrivateKey | holder: string | Signer - hex encoded private key(Ethereum) | signer object for holder
- credentials: VC[] - list of verifiable credentials.
- masks: Mask[] - list of masks.
Returns
- VP - presentation of a set of selectively disclosed verifiable credentials.
verify
import { verify } from 'sd-vc-lib';
verify the authenticity of a verifiable presentation.
Parameters
- vp: VP - valid mnemonic phrase.
- signerPublicKeys: string[] - set of hex-encoded public keys(Ethereum)
- holderPublicKey: string - hex-encoded public key(Ethereum)
Returns
- boolean - true if valid.
verifyVC
import { verifyVC } from 'sd-vc-lib';
verify the authenticity of a verifiable credential.
Parameters
- vc: VC - verifiable credential.
- signerPublicKey: string - hex-encoded public key(Ethereum).
- holderPublicKey: string - hex-encoded public key(Ethereum).
Returns
- boolean - true if a verifiable credential is valid.