@classmethod<EOL><INDENT>def generate(cls, curve=ec.SECP256R1(), progress_func=None, bits=None):<DEDENT>
if bits is not None:<EOL><INDENT>curve = cls._ECDSA_CURVES.get_by_key_length(bits)<EOL>if curve is None:<EOL><INDENT>raise ValueError("<STR_LIT>".format(bits))<EOL><DEDENT>curve = curve.curve_class()<EOL><DEDENT>private_key = ec.generate_private_key(curve, backend=default_backend())<EOL>return ECDSAKey(vals=(private_key, private_key.public_key()))<EOL>
Generate a new private ECDSA key.  This factory function can be used to
generate a new host key or authentication key.

:param progress_func: Not used for this type of key.
:returns: A new private key (`.ECDSAKey`) object