Skip to content

Commit

Permalink
use js-base64's atob impl
Browse files Browse the repository at this point in the history
  • Loading branch information
sagi committed Dec 5, 2020
1 parent bf5704d commit 1388943
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export const getDERfromPEM = (pem) => {
.split('\n')
.slice(1, -1) // Remove the --- BEGIN / END PRIVATE KEY ---
.join('');
return str2ab(atob(pemB64));

return str2ab(Base64.atob(pemB64));
};

export const b64encodeJSON = (obj) =>
Base64.fromUint8Array(str2ab(JSON.stringify(obj)), true);
export const b64encodeJSON = (obj) => Base64.encode(JSON.stringify(obj), true);

export const getEncodedMessage = (header, payload) => {
const encodedHeader = b64encodeJSON(header);
Expand Down

0 comments on commit 1388943

Please sign in to comment.