From 23ac3ff8a40af6249f783f358f38f448ff6285b2 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 29 Jan 2025 17:07:34 +1100 Subject: [PATCH] feat: Add signature checker --- signature-checker.py | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 signature-checker.py diff --git a/signature-checker.py b/signature-checker.py new file mode 100644 index 0000000..c0ff812 --- /dev/null +++ b/signature-checker.py @@ -0,0 +1,50 @@ +import json +import account +import requests + +# Plugin Data +info = { + "name": "Check signatures", + "description": "Validate signatures", + "version": "1.0", + "author": "Nathan.Woodburn/" +} + +# Functions +functions = { + "validate":{ + "name": "Validate signature", + "type": "default", + "description": "Validate that a message was signed by a specific domain", + "params": { + "domain": { + "name": "Signing domain", + "type": "text", + }, + "message": { + "name": "Message", + "type": "text", + }, + "signature": { + "name": "Signature", + "type": "text", + } + }, + "returns": { + "status": + { + "name": "Validity of the signature", + "type": "text" + } + } + } +} + +def validate(params, authentication): + domain = params["domain"] + message = params["message"] + signature = params["signature"] + + if account.verifyMessageWithName(domain, signature,message): + return {"status": "Valid"} + return {"status": "Invalid signature"} \ No newline at end of file