def import_ecdsa_privatekey_from_file(filepath, password=None):
<EOL>securesystemslib.formats.PATH_SCHEMA.check_match(filepath)<EOL>if password is None: <EOL><INDENT>password = get_password('<STR_LIT>'<EOL>'<STR_LIT>' + Fore.RED + filepath + Fore.RESET + '<STR_LIT>',<EOL>confirm=False)<EOL><DEDENT>securesystemslib.formats.PASSWORD_SCHEMA.check_match(password)<EOL>encrypted_key = None<EOL>with open(filepath, '<STR_LIT:rb>') as file_object:<EOL><INDENT>encrypted_key = file_object.read()<EOL><DEDENT>key_object = securesystemslib.keys.decrypt_key(encrypted_key.decode('<STR_LIT:utf-8>'),<EOL>password)<EOL>if key_object['<STR_LIT>'] != '<STR_LIT>':<EOL><INDENT>message = '<STR_LIT>' + repr(key_object['<STR_LIT>'])<EOL>raise securesystemslib.exceptions.FormatError(message)<EOL><DEDENT>key_object['<STR_LIT>'] =securesystemslib.settings.HASH_ALGORITHMS<EOL>return key_object<EOL>
<Purpose>
  Import the encrypted ECDSA key file in 'filepath', decrypt it, and return
  the key object in 'securesystemslib.formats.ECDSAKEY_SCHEMA' format.

  The 'cryptography' library is currently supported and performs the actual
  cryptographic routine.

<Arguments>
  filepath:
    <filepath> file, an ECDSA encrypted key file.

  password:
    The password, or passphrase, to import the private key (i.e., the
    encrypted key file 'filepath' must be decrypted before the ECDSA key
    object can be returned.

<Exceptions>
  securesystemslib.exceptions.FormatError, if the arguments are improperly
  formatted or the imported key object contains an invalid key type (i.e.,
  not 'ecdsa-sha2-nistp256').

  securesystemslib.exceptions.CryptoError, if 'filepath' cannot be decrypted.

<Side Effects>
  'password' is used to decrypt the 'filepath' key file.

<Returns>
  An ECDSA key object of the form: 'securesystemslib.formats.ECDSAKEY_SCHEMA'.