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)