Last active
March 14, 2025 17:56
-
-
Save paranoiq/1932126 to your computer and use it in GitHub Desktop.
public RSA key validation regexp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3} ([^@]+@[^@]+)# | |
// this is the most simple case. see more complete regexps in coments below | |
// http://generator.my-addr.com/generate_ssh_public_rsa_key-private_rsa_key-ssh_pair_online_tool.php | |
// https://help.ubuntu.com/community/SSH/OpenSSH/Keys | |
// http://www.ietf.org/rfc/rfc4716.txt |
I've put together a repository here https://github.com/nemchik/ssh-key-regex
I've cited credit to @paranoiq for this gist and @MaPePeR for all of the amazing information provided here in the comments.
If I am made aware of new supported key types I will be happy to update the information or accept pull requests to improve.
A potential future goal will be to use GitHub pages to present the information as a webpage with nicer formatting.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@MaPePeR thanks for the follow up! That's super helpful! This comment thread is getting a bit large, so I'm considering making a repository where this could be kept up with and issues and pull requests could be opened to improve the information.
I'd want to include information such as removing characters from the end for the reasons you mentioned.