Browse Source

Linted

simple-signer
Matthew Aaron Raymer 2 years ago
parent
commit
ba85663048
  1. 16
      src/libs/crypto/index.ts

16
src/libs/crypto/index.ts

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

Loading…
Cancel
Save