Added bin/generate-crypto-key

This commit is contained in:
Alex Bilbie 2016-01-10 13:15:17 +00:00
parent fa3dc4e055
commit 8e04868320

14
bin/generate-crypto-key Normal file
View File

@ -0,0 +1,14 @@
#!/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');
}