Created
September 10, 2022 15:35
-
-
Save vikramacharya/2f1d2da943a76172aa853c227cbdb13f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const verifyHeader = async (headerParts: any, body: any, public_key: string) => { | |
const { signing_string } = await createSigningString(JSON.stringify(body), headerParts['created'], headerParts['expires']); | |
console.log("recreated signing string:"); | |
console.log(signing_string); | |
const verified = await verifyMessage(headerParts['signature'], signing_string, public_key); | |
return verified; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment