def construct(self, tup): """Construct a ECDSA key from a tuple of valid ECDSA components. The curve T must be valid. :Parameters: tup : tuple A tuple of long integers, with 1 or 2 items in the following order: 1. Public key (*Q*). 2. Private key (*d*). Optional. :Return: A ECDSA key object (`_ECDSAobj`). """ key = _ECDSA.construct(*tup) return _ECDSAobj(self, key)
def _generate(self, T, randfunc=None, progress_func=None): rf = self._get_randfunc(randfunc) obj = _ECDSA.generate_py(T, rf, progress_func) key = _ECDSA.construct(obj.Q, obj.d) return _ECDSAobj(self, key)