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
Currently, the SD-JWT for VC module tries to recover the issuer public key of the SD-JWT.
(1) First, the module search for a valid key indentifier from the jwt header (kid, x5c, trust_chain, etc).
However, after PR #315, the flow above has been replicated and stabilized in the JWSHelper class, which now will extract (or match) the valid verifying key form the token header with one of the whitelisted set provided in the class constructor.
if (verifying_key:=find_jwk_by_kid(available_keys, header["kid"])):
returnverifying_key
# case 2: the token is self contained, and the verification key matches one of the key in the whitelist
if (self_contained_claims_key_pair:=find_self_contained_key(header)):
# check if the self contained key matches a trusted jwk
candidate_key=self_contained_claims_key_pair[0]
if (verifying_key:=find_jwk_by_thumbprint(available_keys, candidate_key.thumbprint)):
returnverifying_key
# case 3: if only one key and there is no header claim that can identitfy any key, than that MUST
# be the only valid CANDIDATE key for signature verification
iflen(self.jwks) ==1:
returnself.jwks[0].to_dict()
returnNone
As such, the SD-JWT for VC module should be refactored to use the new JWSHelper in order to remove the duplicated code and responsability concerning the identification of the issuer public key and its usage for token verification.
For history and completeness: this issue here described is linked with #305 (comment) and a refactoring to use JWSHelper would also solve the the problems declared in that comments.
The text was updated successfully, but these errors were encountered:
Currently, the SD-JWT for VC module tries to recover the issuer public key of the SD-JWT.
(1) First, the module search for a valid key indentifier from the jwt header (kid, x5c, trust_chain, etc).
eudi-wallet-it-python/pyeudiw/openid4vp/vp_sd_jwt_vc.py
Lines 33 to 34 in 766ba3f
(2) then it tries to match the identifier with the available public keys whitelisted from the trust evaluation mehcanism, here
eudi-wallet-it-python/pyeudiw/tools/jwk_handling.py
Lines 6 to 30 in 766ba3f
(3) Finally, after a candidate key is identified, it is then used for the issuer jwt verification, here
eudi-wallet-it-python/pyeudiw/openid4vp/vp_sd_jwt_vc.py
Lines 43 to 44 in 766ba3f
However, after PR #315, the flow above has been replicated and stabilized in the JWSHelper class, which now will extract (or match) the valid verifying key form the token header with one of the whitelisted set provided in the class constructor.
eudi-wallet-it-python/pyeudiw/jwt/__init__.py
Lines 376 to 395 in 766ba3f
As such, the SD-JWT for VC module should be refactored to use the new JWSHelper in order to remove the duplicated code and responsability concerning the identification of the issuer public key and its usage for token verification.
For history and completeness: this issue here described is linked with #305 (comment) and a refactoring to use JWSHelper would also solve the the problems declared in that comments.
The text was updated successfully, but these errors were encountered: