Closed richfitz closed 8 years ago
You can use as.list
on the pubkey to get its fingerprint:
key <- rsa_keygen()
pubkey <- as.list(key)$pubkey
as.list(pubkey)$fingerprint
Does that help?
edit: actually this already works in the cran version
OK, brilliant. That's all I need.
Can I know your use case? Note that this fingerprint is the md5
hash of the ssh pubkey, which is the thing that you see in your ssh client. But some other systems might use a different algorithm to derive a fingerprint...
This is for the data encryption package (https://github.com/dide-tools/encryptr) - I want something that I can use for the filename of a public key and user-specific encrypted data key that is somewhat collision resistant and repeatable. So the fingerprint is nice because I can go from the users public key to the appropriate filename.
Any chance you could export the fingerprint function? I have a use case where being able to get the hash of a public key would be useful.