From b402d38879f808f34d7738fce79d485867819523 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Fri, 10 May 2024 13:57:11 +0200 Subject: [PATCH] Add environment to create_key script --- bin/create_key | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/create_key b/bin/create_key index 6632952..a4407f9 100755 --- a/bin/create_key +++ b/bin/create_key @@ -7,10 +7,12 @@ require "code0/license" # Generate a key pair. You should do this only once. key_pair = OpenSSL::PKey::RSA.generate(4096) +environment = ARGV.shift || 'test' + # Write it to a file to use in the license generation application. -File.write("keys/license_encryption_key_test.key", key_pair.to_pem) +File.write("keys/license_encryption_key_#{environment}.key", key_pair.to_pem) # Extract the public key. public_key = key_pair.public_key # Write it to a file to ship along with the main application. -File.write("keys/license_encryption_key_test.pub", public_key.to_pem) +File.write("keys/license_encryption_key_#{environment}.pub", public_key.to_pem)