oauth2-server/bin/generate-crypto-key
2016-01-10 13:15:43 +00:00

14 lines
372 B
PHP
Executable File

#!/bin/env php
<?php
require(__DIR__.'/../vendor/autoload.php');
try {
$key = Crypto::CreateNewRandomKey();
echo sprintf('Created a new crypto key: %s', bin2hex($key)), PHP_EOL;
exit(0);
} catch (CryptoTestFailedException $ex) {
exit('Cannot safely create a key');
} catch (CannotPerformOperationException $ex) {
exit('Cannot safely create a key');
}