Skip to content

Instantly share code, notes, and snippets.

@TerryGeng
Last active November 16, 2023 18:33
Show Gist options
  • Save TerryGeng/e43e0f98e5937eece8c49e7e5705437f to your computer and use it in GitHub Desktop.
Save TerryGeng/e43e0f98e5937eece8c49e7e5705437f to your computer and use it in GitHub Desktop.
Convert OpenSSH public key to PKCS#1 in HEX format
ssh-keygen -e -m pem -f ~/.ssh/id_rsa.pub | sed '1d;$d' | tr -d '\n' | base64 -d | od -t x1 -An | tr -d ' \n' | tr 'a-f' 'A-F' | sed 's/\(.\{8\}\)/\1 /g' | fold -w 54
@gurlov
Copy link

gurlov commented Nov 16, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment