def write_private_key_file(self, filename, password=None):
raise Exception("<STR_LIT>")<EOL>
Write private key contents into a file.  If the password is not
``None``, the key is encrypted before writing.

:param str filename: name of the file to write
:param str password:
    an optional password to use to encrypt the key file

:raises: ``IOError`` -- if there was an error writing the file
:raises: `.SSHException` -- if the key is invalid