You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the quirks of SD-JWT is that the disclosures themselves can be encoded however the issuer deems right. There is no necessity to define rules like always using minified JSON or certain characters etc.
This means that as a holder, you have to keep the original base64 disclosure to compute hashes and disclose them. From my understanding you are parsing the disclosures and only working on the parsed disclosures - losing the initial encoding. As long as the issuer uses the same kind of encoding (e.g., JSON minified with utf-8) everything is fine, but if for example the JSON is not minified by the issuer the result will be different hashes breaking everything.
My understanding would be, that the output of getPrettyClaims() should include the resolved disclosures, for example
"given_name": "John"
which does not happen because the calculated digests differ from the ones in the SD-JWT (because of different encoding). Output of the digests results in:
I quickly glanced over that implementation and it seems to not share this problem. I just wanted to make you aware of this problem if this library is already used in demos etc (e.g., with credo).
One of the quirks of SD-JWT is that the disclosures themselves can be encoded however the issuer deems right. There is no necessity to define rules like always using minified JSON or certain characters etc.
This means that as a holder, you have to keep the original base64 disclosure to compute hashes and disclose them. From my understanding you are parsing the disclosures and only working on the parsed disclosures - losing the initial encoding. As long as the issuer uses the same kind of encoding (e.g., JSON minified with utf-8) everything is fine, but if for example the JSON is not minified by the issuer the result will be different hashes breaking everything.
I created a small test based on your examples that uses an example of the sd-jwt-vc spec (with the python implementation from Daniel that does not minify JSON) that loses the disclosures in the process: https://gist.github.com/c2bo/06bb2fc028c31e01a5ba9108e2f738df
Output is
My understanding would be, that the output of
getPrettyClaims()
should include the resolved disclosures, for examplewhich does not happen because the calculated digests differ from the ones in the SD-JWT (because of different encoding). Output of the digests results in:
Disclosures and digests differ:
whereas the issuer provided
The text was updated successfully, but these errors were encountered: