Created
March 31, 2014 08:14
-
-
Save coelho/9887580 to your computer and use it in GitHub Desktop.
Generate key pairs for Votifier
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
<?php | |
$keyPair = openssl_pkey_new(array('private_key_bits' => 2048)); | |
// Private key | |
openssl_pkey_export($keyPair, $privateKey); | |
// Public key | |
$publicKey = openssl_pkey_get_details($keyPair); | |
$publicKey = $publicKey["key"]; | |
file_put_contents("private.config.php", "<?php\r\n\r\n\$config[\"privateKey\"] = \"" . $privateKey . "\";"); | |
file_put_contents("public.key", $publicKey); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment