Skip to content

Commit

Permalink
fix: batch keys
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Nov 26, 2024
1 parent 3ccaf76 commit cf139ec
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/openid4vc/src/openid4vc-holder/OpenId4VciHolderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,18 +413,21 @@ export class OpenId4VciHolderService {
}

for (const [offeredCredentialId, offeredCredentialConfiguration] of credentialConfigurationsToRequest) {
// Get all options for the credential request (such as which kid to use, the signature algorithm, etc)
const { jwtSigner } = await this.getCredentialRequestOptions(agentContext, {
possibleProofOfPossessionSignatureAlgorithms: possibleProofOfPossessionSigAlgs,
offeredCredential: {
id: offeredCredentialId,
configuration: offeredCredentialConfiguration,
},
credentialBindingResolver,
})

const jwts: string[] = []

for (let i = 0; i < batchSize; i++) {
// TODO: we should call this method once with a keyLength. Gives more control to the user and better aligns with key attestations
// Get a key instance for each entry in the batch.
// Get all options for the credential request (such as which kid to use, the signature algorithm, etc)
const { jwtSigner } = await this.getCredentialRequestOptions(agentContext, {
possibleProofOfPossessionSignatureAlgorithms: possibleProofOfPossessionSigAlgs,
offeredCredential: {
id: offeredCredentialId,
configuration: offeredCredentialConfiguration,
},
credentialBindingResolver,
})

const { jwt } = await client.createCredentialRequestJwtProof({
credentialConfigurationId: offeredCredentialId,
issuerMetadata: resolvedCredentialOffer.metadata,
Expand Down

0 comments on commit cf139ec

Please sign in to comment.