Created
August 17, 2017 13:25
-
-
Save nitschmann/0da9bff7f7bc05f7bc1f9975673fd86d to your computer and use it in GitHub Desktop.
Ruby script to generate OpenSSL Key-Pairs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "openssl" | |
# could also be different | |
key_length = 4096 | |
new_key = OpenSSL::PKey::RSA.generate(key_length) | |
public_key = new_key.public_key | |
public_key_string = public_key.to_s | |
private_key = new_key.private_key | |
private_key_string = private_key.to_s | |
# continue work with the keys here | |
# put them either to the command line or neither write them into a file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment