summaryrefslogtreecommitdiff
path: root/tikzit/scripts/generate_keys.rb
diff options
context:
space:
mode:
authorrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:50 +0000
committerrandomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-01-09 11:00:50 +0000
commita8a8dfb90d6a51ae369c042c95162f45754c7c4b (patch)
tree0e7a5f82febebe7129ebfb015f05b114064c39fd /tikzit/scripts/generate_keys.rb
parente1cf0babff63e670e0d550b4072c22649a117fa7 (diff)
Move tikzit into "trunk" directory
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@365 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/scripts/generate_keys.rb')
-rwxr-xr-xtikzit/scripts/generate_keys.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/tikzit/scripts/generate_keys.rb b/tikzit/scripts/generate_keys.rb
new file mode 100755
index 0000000..b22439c
--- /dev/null
+++ b/tikzit/scripts/generate_keys.rb
@@ -0,0 +1,13 @@
+#!/usr/bin/ruby
+["dsaparam.pem", "dsa_priv.pem", "dsa_pub.pem"].each do |file|
+ if File.exist? file
+ puts "There's already a #{file} here! Move it aside or be more careful!"
+ end
+end
+`openssl dsaparam 2048 < /dev/urandom > dsaparam.pem`
+`openssl gendsa dsaparam.pem -out dsa_priv.pem`
+`openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem`
+`rm dsaparam.pem`
+puts "\nGenerated private and public keys: dsa_priv.pem and dsa_pub.pem.\n
+BACK UP YOUR PRIVATE KEY AND KEEP IT SAFE!\n
+If you lose it, your users will be unable to upgrade!\n" \ No newline at end of file