def ecdsa_sign(private_key, data, hash_algorithm):
if private_key.algorithm != '<STR_LIT>':<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return _sign(private_key, data, hash_algorithm)<EOL>
Generates an ECDSA signature

:param private_key:
    The PrivateKey to generate the signature with

:param data:
    A byte string of the data the signature is for

:param hash_algorithm:
    A unicode string of "md5", "sha1", "sha256", "sha384" or "sha512"

:raises:
    ValueError - when any of the parameters contain an invalid value
    TypeError - when any of the parameters are of the wrong type
    OSError - when an error is returned by the OS crypto library

:return:
    A byte string of the signature