Calculates the OpenSSH fingerprint of a public key. This value should match what you get to see when connecting with SSH to a server. Note that some other systems might use a different algorithm to derive a (different) fingerprint for the same keypair.
Examples
mykey <- rsa_keygen()
pubkey <- as.list(mykey)$pubkey
fingerprint(mykey)
#> sha256 0e:c4:3d:98:35:c4:03:15:71:71:26:f1:7d:dc:3c:a6:ab:e0:ee:05:96:8a:7a:00:c7:6f:e9:15:01:a0:66:34
fingerprint(pubkey)
#> sha256 0e:c4:3d:98:35:c4:03:15:71:71:26:f1:7d:dc:3c:a6:ab:e0:ee:05:96:8a:7a:00:c7:6f:e9:15:01:a0:66:34
# Some systems use other hash functions
fingerprint(pubkey, sha1)
#> sha1 ac:09:e5:90:0a:2f:7d:07:14:35:88:63:8e:bb:82:ab:3d:da:3a:f8
fingerprint(pubkey, sha256)
#> sha256 0e:c4:3d:98:35:c4:03:15:71:71:26:f1:7d:dc:3c:a6:ab:e0:ee:05:96:8a:7a:00:c7:6f:e9:15:01:a0:66:34
# Other key types
fingerprint(dsa_keygen())
#> sha256 43:dd:bd:2c:13:7b:fc:28:54:21:2c:a9:68:48:b1:e2:46:18:4b:48:71:b8:fa:67:58:7c:da:3f:0c:3b:26:a9