MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / check_key

Method check_key

src/pyelliptic/ecc.py:246–259  ·  view source on GitHub ↗

Check the public key and the private key. The private key is optional (replace by None)

(self, privkey, pubkey)

Source from the content-addressed store, hash-verified

244 OpenSSL.BN_free(own_priv_key)
245
246 def check_key(self, privkey, pubkey):
247 """
248 Check the public key and the private key.
249 The private key is optional (replace by None)
250 """
251 curve, pubkey_x, pubkey_y, i = ECC._decode_pubkey(pubkey)
252 if privkey is None:
253 raw_privkey = None
254 curve2 = curve
255 else:
256 curve2, raw_privkey, i = ECC._decode_privkey(privkey)
257 if curve != curve2:
258 raise Exception("Bad public and private key")
259 return self.raw_check_key(raw_privkey, pubkey_x, pubkey_y, curve)
260
261 def raw_check_key(self, privkey, pubkey_x, pubkey_y, curve=None):
262 if curve is None:

Callers

nothing calls this directly

Calls 3

raw_check_keyMethod · 0.95
_decode_pubkeyMethod · 0.80
_decode_privkeyMethod · 0.80

Tested by

no test coverage detected