Skip to content

Commit

Permalink
Add environment to create_key script
Browse files Browse the repository at this point in the history
  • Loading branch information
Taucher2003 committed May 10, 2024
1 parent 767a921 commit b402d38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/create_key
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit b402d38

Please sign in to comment.