From 4eaeade618224b675acc690769c5d7d8edcda6ce Mon Sep 17 00:00:00 2001
From: Ivanq <imachug@yandex.ru>
Date: Wed, 1 May 2019 07:42:56 +0300
Subject: [PATCH] Add privToPub and pubToAddr commands

---
 plugins/CryptMessage/CryptMessagePlugin.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/plugins/CryptMessage/CryptMessagePlugin.py b/plugins/CryptMessage/CryptMessagePlugin.py
index 7198ed08..462d183c 100644
--- a/plugins/CryptMessage/CryptMessagePlugin.py
+++ b/plugins/CryptMessage/CryptMessagePlugin.py
@@ -124,6 +124,15 @@ class UiWebsocketPlugin(object):
     def actionEcdsaVerify(self, to, data, address, signature):
         self.response(to, CryptBitcoin.verify(data, address, signature))
 
+    # Gets the publickey of a given privatekey
+    def actionPrivToPub(self, to, privatekey):
+        self.response(to, btctools.privtopub(privatekey))
+
+    # Gets the address of a given publickey
+    def actionPubToAddr(self, to, publickey):
+        address = btctools.pubtoaddr(btctools.decode_pubkey(publickey))
+        self.response(to, address)
+
 
 @PluginManager.registerTo("User")
 class UserPlugin(object):