This can be done with the ssh-keygen command.
ssh-keygen
Example for SSH server key:
ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub
Example for user's key:
ssh-keygen -lf ~/.ssh/id_rsa.pub