Code Snippet
This section describes how we use the zkPass SDK in our demo code
Generate Proof
This code snippet generates a zkPass proof. It requires 3 parameters:
SERVICE_URL
: you can usehttps://playground-zkpass.ssi.id
, or use your own endpoint if you deploy zkPass on your own server.API_KEY
&API_SECRET
: Get yours athttps://portal.ssi.id
userDataToken
: check Generate User Data Token section for more details.dvrToken
: check Generate DVR Token section for more details.
Verify Proof
This code snippet verifies a zkPass proof token. Components :
zkPassProofToken
: check Generate Proof section for more details.expectedMetadata
: this is the expected metadata of the dvr.dvrPayload
: the dvr payload extracted from Dvr token.
Generate User Data Token
This code snippet generate user data token. Components :
signingKey
: a private key used to sign user data.data
: user data in JSON format.verifyingKey
: a public key to verify that user data token.
Generate DVR Token
This code snippet generate DVR token. Components :
signingKey
: a private key used to sign dvr.dvrData
: Dvr data to sign.
Last updated