Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def public_key(self, value):
if value is None:
return
if isinstance(value, bytes):
value = HDKey(value)
if value.is_private:
value = value.public()
self.x, self.y = value.public_point()
if USE_FASTECDSA:
if not fastecdsa_secp256k1.is_point_on_curve((self.x, self.y)):
raise BKeyError('Invalid public key, point is not on secp256k1 curve')
self._public_key = value