Skip to content

07. Verify API

Lukas.J.Han edited this page Dec 15, 2023 · 1 revision
const verified = await sdjwt.verify(encodedSdjwt, publicKey, requiredClaimKeys, options);

Parameters

  • 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
  };
},

Return

  • boolean: true if SD JWT is verified

Keys

You can check all JSON Path by keys method

const keys = await sdjwt.keys(encodedSdjwt);
// return all JSON Path keys in claims [string[]]
Clone this wiki locally