Skip to content

Commit

Permalink
refactor: Replaced @veramo/utils with uint8arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoe Maas committed Dec 3, 2024
1 parent 67b5af1 commit 9afc487
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IAgentContext} from '@veramo/core'
import {IOIDFClient} from '@sphereon/ssi-sdk.oidf-client'
import {contextHasPlugin} from '@sphereon/ssi-sdk.agent-config'
import {IJwsValidationResult, JwsPayload} from '../types/IJwtService'
import {decodeBase64url} from "@veramo/utils";
import * as u8a from 'uint8arrays'

/**
* Resolves an OIDF Entity ID against multiple trust anchors to establish trusted relationships
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function resolveExternalOIDFEntityIdIdentifier(
continue
}

payload = JSON.parse(decodeBase64url(jwtVerifyResult.jws.payload))
payload = JSON.parse(u8a.toString(u8a.fromString(jwtVerifyResult.jws.payload, 'base64url')))
const signature = jwtVerifyResult.jws.signatures[0]
if (signature.identifier.jwks.length === 0) {
errorList[trustAnchor] = 'No JWK was present in the trust anchor signature'
Expand Down

0 comments on commit 9afc487

Please sign in to comment.