|
@ -117,10 +117,10 @@ export const createIdentifier = (): string => { |
|
|
export const accessToken = async (identifier: IIdentifier) => { |
|
|
export const accessToken = async (identifier: IIdentifier) => { |
|
|
const did: string = identifier.did; |
|
|
const did: string = identifier.did; |
|
|
const privateKeyHex: string = identifier.keys[0].privateKeyHex as string; |
|
|
const privateKeyHex: string = identifier.keys[0].privateKeyHex as string; |
|
|
const input = privateKeyHex.startsWith("0x") |
|
|
//const input = privateKeyHex.startsWith("0x")
|
|
|
? privateKeyHex.substring(2) |
|
|
// ? privateKeyHex.substring(2)
|
|
|
: privateKeyHex; |
|
|
// : privateKeyHex;
|
|
|
const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16"); |
|
|
//const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16");
|
|
|
|
|
|
|
|
|
const signer = didJwt.SimpleSigner(privateKeyHex); |
|
|
const signer = didJwt.SimpleSigner(privateKeyHex); |
|
|
|
|
|
|
|
@ -138,10 +138,10 @@ export const accessToken = async (identifier: IIdentifier) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
export const sign = async (privateKeyHex: string) => { |
|
|
export const sign = async (privateKeyHex: string) => { |
|
|
const input = privateKeyHex.startsWith("0x") |
|
|
//const input = privateKeyHex.startsWith("0x")
|
|
|
? privateKeyHex.substring(2) |
|
|
// ? privateKeyHex.substring(2)
|
|
|
: privateKeyHex; |
|
|
// : privateKeyHex;
|
|
|
const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16"); |
|
|
// const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16");
|
|
|
|
|
|
|
|
|
const signer = didJwt.SimpleSigner(privateKeyHex); |
|
|
const signer = didJwt.SimpleSigner(privateKeyHex); |
|
|
|
|
|
|
|
|