How to find the type of a SSH key

If you have the key in a file and want to know what kind of SSH key you have, you can do: # On OSX % base64 -d -i keyfile | hexdump -C | head 00000000 00 00 00 07 73 73 68 2d 72 73 61 00 00 00 03 01 |....ssh-rsa.....| # On Linux % base64 -d keyfile | hexdump -C | head 00000000 00 00 00 07 73 73 68 2d 72 73 61 00 00 00 03 01 |....ssh-rsa.....|