@classmethod<EOL><INDENT>def from_private_key(cls, file_obj, password=None):<DEDENT>
key = cls(file_obj=file_obj, password=password)<EOL>return key<EOL>
Create a key object by reading a private key from a file (or file-like)
object.  If the private key is encrypted and ``password`` is not
``None``, the given password will be used to decrypt the key (otherwise
`.PasswordRequiredException` is thrown).

:param file_obj: the file-like object to read from
:param str password:
    an optional password to use to decrypt the key, if it's encrypted
:return: a new `.PKey` based on the given private key

:raises: ``IOError`` -- if there was an error reading the key
:raises: `.PasswordRequiredException` --
    if the private key file is encrypted, and ``password`` is ``None``
:raises: `.SSHException` -- if the key file is invalid