You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suggest either exposing the HostKeys.entries attribute so that HostKeyEntrys can be added directly, or adding some proxy methods on the HostKeys class for adding/removing/updating HostKeyEntrys.
Furthermore, it would be nice if the HostKey class could load from a file-like object.
Ah right. Slightly non-intuitive, but fair enough. I had just figured out the paramiko.RSAKey(data=b"key byte string") bit myself, but that's not so obvious, so perhaps could go in the docs. I used a base64 decode too, to convert from the standard OpenSSH string format.
I think it makes sense to allow a key as a string, without requiring the caller to know which supported crypto algorithm it uses.
For example, the application code may be loading the key (directly into memory) from some secure secret store and not wish to persist it onto a filesystem (as even a temp file increases exposure to credential leak), and if the key is updated in future to use a different supported crypto algorithm (say if the credential migrates from RSA to Ed25519 during a routine key rotation) the same application code should still work without modification.
Activity
alexreg commentedon Dec 17, 2017
One more thing: it would be nice if the
HostKeyEntryconstructor could take akey_typeparameter... or is this unnecessary?ploxiln commentedon Dec 17, 2017
You can add a private key object:
http://docs.paramiko.org/en/2.4/api/hostkeys.html#paramiko.hostkeys.HostKeys.add
You can make a private key object like
paramiko.RSAKey(data=b"key byte string")alexreg commentedon Dec 17, 2017
Ah right. Slightly non-intuitive, but fair enough. I had just figured out the
paramiko.RSAKey(data=b"key byte string")bit myself, but that's not so obvious, so perhaps could go in the docs. I used a base64 decode too, to convert from the standard OpenSSH string format.benjimin commentedon Jul 23, 2026
I think it makes sense to allow a key as a string, without requiring the caller to know which supported crypto algorithm it uses.
For example, the application code may be loading the key (directly into memory) from some secure secret store and not wish to persist it onto a filesystem (as even a temp file increases exposure to credential leak), and if the key is updated in future to use a different supported crypto algorithm (say if the credential migrates from RSA to Ed25519 during a routine key rotation) the same application code should still work without modification.
Ideally we should be able to write:
Instead of needing to write: