Verifying a SD-JWT Credential
Verifier requests, holder shares selective disclosures, verifier verifies hashes and signature.
SD-JWT Credential Verification Process
Selective Disclosure Sharing: During the verification process, the verifier asked for a certain set of claims. The selective disclosure sharing mechanism allows the holder then to only share does require claims through sending the whole SD-JWT plus the disclosures which are needed for verification. This process therefore helps with privacy by not revealing more identity information than what's specifically requested.
Disclosure Verification: The verifier, upon receiving the shared disclosures and the SD-JWT, can confirm that the shared disclosures are a part of the SD-JWT. This is done by hashing the received disclosures in the same manner as the issuer did during the issuance process.
Hash Comparison and Tamper Check: The verifier then compares the hashed values of the shared disclosures with the values present in the SD-JWT. If the hashed values match, the verifier can be confident that the shared values haven't been tampered with and are actually part of the SD-JWT.
Transfer Format: Transferring the credential from holder to verifier happens through the sharing of the SD-JWT with the concatenated disclosures which were chosen to be revealed using the ~ sign. An example of this format would be:
Verification in Action
Using either the CLI, Kotlin or REST option, you can start verifying your SD-JWT credential.
Creating a SD-JWT Credential Presentation
We create a presentation to provide the verifier with the holder's credentials for verification. The presentation can include data from multiple credentials, making verification easier as only one interaction is required. We provide the holder DID and the disclosures to create a presentation, which we can then present to a verifier, via the present command. Example Command
Options:
-i, --holder-did
: DID of the holder (owner of the VC)-c, --challange
: Challenge to be used in the LD proof--sd, --selective-disclosure
: Path to selectively disclosed fields, in a simplified JsonPath format. Can be specified multiple times. By default NONE of the sd fields are disclosed, for multiple credentials, the path can be prefixed with the index of the presented credential, e.g. "credentialSubject.familyName", "0.credentialSubject.familyName", "1.credentialSubject.dateOfBirth". other options--sd-all-for
: Selects all selective disclosures for the credential at the specified index to be disclosed. Overrides --sd flags!--sd-all
: Selects all selective disclosures for all presented credentials to be disclosed.
Example Response
Parseing the presentation to JSON
Using the parse command, you can print the presenation as a JSON object.
Options:
-r
: Recursively parse credentials in presentation-c
: Credential content or file path
Verifying SD-JWT Presentation
We can check the validity of the presentation by providing the verify command with it. Use the storage location printed at the end of the last command.
Example Command
Example Output
Demo
Last updated