New Project
This commit is contained in:
@@ -100,3 +100,14 @@ export const accessToken = async (identifier: IIdentifier) => {
|
||||
});
|
||||
return jwt;
|
||||
};
|
||||
|
||||
export const sign = async (privateKeyHex: string) => {
|
||||
const input = privateKeyHex.startsWith("0x")
|
||||
? privateKeyHex.substring(2)
|
||||
: privateKeyHex;
|
||||
const privateKeyBytes = u8a.fromString(input.toLowerCase(), "base16");
|
||||
|
||||
const signer = didJwt.ES256KSigner(privateKeyBytes, true);
|
||||
|
||||
return signer;
|
||||
};
|
||||
Reference in New Issue
Block a user