Created
April 10, 2020 12:33
-
-
Save bng44270/3e86a9d194e8fa33e200acbbeb17f96d to your computer and use it in GitHub Desktop.
Generate SSH Key Pairs with AppleScript
This file contains 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
set appname to "" | |
set keypass to "" | |
repeat | |
set appname to text returned of (display dialog "Enter application name" default answer "") | |
if (length of appname) > 0 then exit repeat | |
end repeat | |
repeat | |
set keypass to text returned of (display dialog "Enter key password" default answer "" with hidden answer) | |
if (length of keypass) > 0 then exit repeat | |
end repeat | |
do shell script "ssh-keygen -b 2048 -t rsa -N " & keypass & " -f ~/" & appname & ".key" | |
do shell script "zip -jr ~/Desktop/" & appname & ".zip ~/" & appname & ".key*" | |
do shell script "rm ~/" & appname & ".key*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment