|
@ -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; |
|
|
}; |
|
|
}; |
|
|