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
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
According to the note here you need to decode the sd-jwt in case the hasher function is async (which is in my canse since its executed in the browser via webcrypto). So I am decoding the list of credentials like this:
const vcs: SdJwtDecodedVerifiableCredential[] = [];
for (const credential of credentials) {
const decoded = await CredentialMapper.decodeSdJwtVcAsync(
credential.value,
getHasher()
);
vcs.push(decoded);
}
const pex = new PresentationExchange({
allVerifiableCredentials: vcs,
});
But then I am running in this error Hasher must be provided when creating a presentation with an SD-JWT VC. After logging the credentials and the conditions I get this:
So is the intention of if (credentials.some((c) => CredentialMapper.isSdJwtDecodedCredential(c) || CredentialMapper.isSdJwtEncoded(c))) { to only get the sd-jwt-vc credentials, the error seems to be here.
To avoid the hash call in the function, we need to pass the pre calculated sdHash in the SdJwtDecodedVerifiableCredential object.
Or we just make the hasher call async since PresentationExchange.findValidPresentationDefinitions is already async :)
The text was updated successfully, but these errors were encountered:
In case we can solve issue #147 by passing an async hash function, we can calculate everything inside the pex function and do not need changes like in this issue. So when the other issue is resolved, we can close this one
I'm submitting a ...
[x] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
Summary
According to the note here you need to decode the sd-jwt in case the hasher function is async (which is in my canse since its executed in the browser via webcrypto). So I am decoding the list of credentials like this:
But then I am running in this error
Hasher must be provided when creating a presentation with an SD-JWT VC
. After logging the credentials and the conditions I get this:So is the intention of
if (credentials.some((c) => CredentialMapper.isSdJwtDecodedCredential(c) || CredentialMapper.isSdJwtEncoded(c))) {
to only get the sd-jwt-vc credentials, the error seems to be here.To avoid the hash call in the function, we need to pass the pre calculated sdHash in the
SdJwtDecodedVerifiableCredential
object.Or we just make the hasher call async since
PresentationExchange.findValidPresentationDefinitions
is already async :)The text was updated successfully, but these errors were encountered: