File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ export class DidJwkDriver {
172172 let jwkJson ;
173173 let jwk ;
174174 try {
175- jwkJson = base64url . decode ( encodedJwk ) ;
175+ jwkJson = new TextDecoder ( ) . decode ( base64url . decode ( encodedJwk ) ) ;
176176 } catch ( e ) {
177177 const error = new Error (
178178 `Could not decode base64url-encoded JWK from "${ encodedJwk } ".` ) ;
@@ -220,7 +220,9 @@ export class DidJwkDriver {
220220 did, jwk, verificationMethodType = 'JsonWebKey'
221221 } = { } ) {
222222 if ( did === undefined ) {
223- did = `did:jwk:${ base64url . encode ( JSON . stringify ( jwk ) ) } ` ;
223+ const encoded = base64url . encode (
224+ new TextEncoder ( ) . encode ( JSON . stringify ( jwk ) ) ) ;
225+ did = `did:jwk:${ encoded } ` ;
224226 } else if ( typeof did !== 'string' ) {
225227 throw new TypeError ( '"did" must be a string.' ) ;
226228 }
You can’t perform that action at this time.
0 commit comments