ojarva / python-sshpubkeys

OpenSSH public key parser for Python
BSD 3-Clause "New" or "Revised" License
101 stars 42 forks source link

How to get full base64 of public key? #52

Closed raxod502 closed 3 years ago

raxod502 commented 6 years ago

Basically, I want the result of

base64.b64encode(my_public_key._decoded_key)

except that this relies on the internal attribute SSHKey._decoded_key. If I could access my_public_key._decoded_key directly, that would work as well.

My use case is that I am given a list of SSH fingerprints in the format printed by ssh-add -L, and I have to figure out whether a given key is registered in the agent or not, based on the public key file which I'm parsing using python-sshpubkeys.

ojarva commented 6 years ago

If you can get output of ssh-add -l, you can use fingerprint output values.

If you want to have base64 output without using internal _decoded_key, please create a new PR that outputs this - I don't see why it shouldn't be there. I'm happy to review and merge that.

raxod502 commented 6 years ago

I won't have time to create such a pull request at the moment, but I appreciate the confirmation that this would be a good feature to add.