forked from openwallet-foundation/sd-jwt-js
-
Notifications
You must be signed in to change notification settings - Fork 0
07. Verify API
Lukas.J.Han edited this page Dec 15, 2023
·
1 revision
const verified = await sdjwt.verify(encodedSdjwt, publicKey, requiredClaimKeys, options);
- encodedSdjwt: encoded SD JWT [string]
- publicKey: key to verify SD JWT [Uint8Array | KeyLike]
- requiredClaimKeys: required JSON properties to verify [Array] (optional)
{
data: {
arr: ['value']
}
}
// The JSON Path of value 'value' is 'data.arr.0'
- options (optional)
options?: {
kb?: {
publicKey: Uint8Array | KeyLike; // public key for validate key binding JWT
};
},
- boolean: true if SD JWT is verified
You can check all JSON Path by keys
method
const keys = await sdjwt.keys(encodedSdjwt);
// return all JSON Path keys in claims [string[]]