summaryrefslogtreecommitdiff
path: root/tikzit-1/scripts/generate_keys.rb
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2017-01-11 16:33:00 +0100
committerAleks Kissinger <aleks0@gmail.com>2017-01-11 16:33:00 +0100
commit1802977b95d29198f27535b1b731d1180c083667 (patch)
tree032c4beb7411d88d76794a25f0e3b00a3437da3e /tikzit-1/scripts/generate_keys.rb
parentff79a9c213dfd75ea00ed5112d3a6e314601e064 (diff)
made new subdir
Diffstat (limited to 'tikzit-1/scripts/generate_keys.rb')
-rwxr-xr-xtikzit-1/scripts/generate_keys.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/tikzit-1/scripts/generate_keys.rb b/tikzit-1/scripts/generate_keys.rb
new file mode 100755
index 0000000..b22439c
--- /dev/null
+++ b/tikzit-1/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