Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nichoth committed Apr 29, 2024
1 parent cd34c15 commit a707926
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ export async function create (
}
}

/**
* Check that a signature matches the given message.
* @param {SignedPost} msg The message to check
* @returns {boolean} True or false if the signature matches
*/
export async function isValid (msg:SignedPost):Promise<boolean> {
const { signature: __, key: _, ..._msg } = msg.metadata
const isOk = verifyFromString()
const { signature, key: _, ..._msg } = msg.metadata
const str = stringify(_msg)
const isOk = await verifyFromString(str, signature, msg.metadata.author)
return isOk
}

/**
Expand Down

0 comments on commit a707926

Please sign in to comment.