We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when using io.BytesIO to create file like object and pass than object to RSAKey.from_private_key in python3 like this
ssh_key = '-----BEGIN DSA PRIVATE KEY-----\n'\ '<keydata>'\ '-----END DSA PRIVATE KEY-----\n' file_obj = io.BytestIO(ssh_key) pkey = RSAKey.from_private_key(file_obj)
it raises an error
the issue is here
def _read_private_key(self, tag, f, password=None): lines = f.readlines() start = 0 beginning_of_key = "-----BEGIN " + tag + " PRIVATE KEY-----" while start < len(lines) and lines[start].strip() != beginning_of_key: start += 1 if start >= len(lines): raise SSHException("not a valid " + tag + " private key file")
readline returns a list of binary and this comparison fails
lines[start].strip() != beginning_of_key
The text was updated successfully, but these errors were encountered:
you could use io.StringIO(ssh_key) instead
io.StringIO(ssh_key)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
when using io.BytesIO to create file like object and pass than object to RSAKey.from_private_key in python3 like this
it raises an error
the issue is here
readline returns a list of binary and this comparison fails
The text was updated successfully, but these errors were encountered: