Browse Source

feat: switch to the SimpleSigner code for working signatures

kb/add-usage-guide
Trent Larson 2 years ago
parent
commit
693df1bda1
  1. 4
      src/libs/crypto/index.ts

4
src/libs/crypto/index.ts

@ -122,7 +122,7 @@ export const accessToken = async (identifier: IIdentifier) => {
: privateKeyHex; : privateKeyHex;
const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16"); const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16");
const signer = didJwt.ES256KSigner(privateKeyBytes, true); const signer = didJwt.SimpleSigner(privateKeyHex);
const nowEpoch = Math.floor(Date.now() / 1000); const nowEpoch = Math.floor(Date.now() / 1000);
const endEpoch = nowEpoch + 60; // add one minute const endEpoch = nowEpoch + 60; // add one minute
@ -143,7 +143,7 @@ export const sign = async (privateKeyHex: string) => {
: privateKeyHex; : privateKeyHex;
const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16"); const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16");
const signer = didJwt.ES256KSigner(privateKeyBytes, true); const signer = didJwt.SimpleSigner(privateKeyHex);
return signer; return signer;
}; };

Loading…
Cancel
Save