Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
jose-jws-example.html is broken without these fixes.
  • Loading branch information
alokmenghrajani committed May 28, 2019
1 parent 6d829c3 commit e838ece
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/jose-jws-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class Signer {
} else if (Utils.isCryptoKey(rsa_key)) {
throw new Error("key_id is a mandatory argument when the key is a CryptoKey");
} else {
kid_promise = Jose.WebCryptographer.keyId(rsa_key);
kid_promise = this.cryptographer.keyId(rsa_key);
}

that.waiting_kid++;
Expand Down
2 changes: 1 addition & 1 deletion lib/jose-jws-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class Verifier {
throw new Error("key_id is a mandatory argument when the key is a CryptoKey");
} else {
console.log("it's not safe to not pass a key_id");
kid_promise = Jose.WebCryptographer.keyId(rsa_key);
kid_promise = this.cryptographer.keyId(rsa_key);
}

that.waiting_kid++;
Expand Down
2 changes: 1 addition & 1 deletion lib/jose-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const sha256 = (str) => {
// DOMString. This was initially implemented as an object and continues to be
// supported, so we favor the older form for backwards compatibility.
return Jose.crypto.subtle.digest({name: "SHA-256"}, arrayFromString(str)).then(function(hash) {
return this.encodeArray(hash);
return new Base64Url().encodeArray(hash);
});
};

Expand Down

0 comments on commit e838ece

Please sign in to comment.