commit cef7bbf29476dbdaaffae94e7ee014558fea53c7
parent 12e9f490429054f25187fa0adc4dc1323f100655
Author: ThomasV <thomasv1@gmx.de>
Date: Tue, 4 Mar 2014 16:33:25 +0100
add get_public_key method to EC_KEY class
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/lib/bitcoin.py b/lib/bitcoin.py
@@ -371,6 +371,9 @@ class EC_KEY(object):
self.privkey = ecdsa.ecdsa.Private_key( self.pubkey, secret )
self.secret = secret
+ def get_public_key(self, compressed=True):
+ return point_to_ser(self.pubkey.point, compressed).encode('hex')
+
def sign_message(self, message, compressed, address):
private_key = ecdsa.SigningKey.from_secret_exponent( self.secret, curve = SECP256k1 )
public_key = private_key.get_verifying_key()