-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: check vct scheme to choose hardware/software key #133
Conversation
d59304e
to
233f8cd
Compare
}) | ||
} | ||
// TODO: require support for mDoc namespace here as well | ||
const vct = resolvedCredentialOffer.offeredCredentialConfigurations[offeredCredentialToRequest.id].vct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use supportedCredentialId
that is passed to this callback. This will help us when we add mdoc as well and request multiple creds.
Also -- vct is not always defined. So this check should be something like:
let shouldKeyBeHardwareBacked = false
const offeredCredentialConfiguration = offeredCredentialConfigurations[supportedCredentialId]
// TODO: use the enum for format, not sure what its' called)
if (offeredCredentialConfiguration.format === 'vc+sd-jwt' && pidSchemes?.sdJwtVcVcts.includes(offeredCredentialConfiguration.vct)) {
shouldKeyBeHardwareBacked = true
}
Finally, I'm not sure why we need to call it pidSchemes. That's more implementation specific. Why not call it useHardwareKeySchemes? Or just pass useHardwareKey: true/false
to this method? In receive pid use case we pass true, by default it's false
18ab52b
to
49c888b
Compare
pidSchemes?.sdJwtVcVcts.includes(offeredCredentialConfiguration.vct) | ||
|
||
// TODO: add mso-mdoc config from above | ||
const shouldKeyBeHardwareBacked = shouldKeyBeHardwareBackedForSdJwtVc ?? shouldKeyBeHardwareBackedForMsoMdoc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?? will only go to the next one if the value is undefined, but shouldKeyBeHardwareBackedForSdJwtVC will always have a value. I think you mean || in this case?
49c888b
to
207fba2
Compare
207fba2
to
ffec7e4
Compare
Signed-off-by: Berend Sliedrecht <[email protected]>
ffec7e4
to
597c749
Compare
Signed-off-by: Berend Sliedrecht [email protected]