mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-25 22:49:49 +05:30
Added bin/generate-crypto-key
This commit is contained in:
parent
fa3dc4e055
commit
8e04868320
14
bin/generate-crypto-key
Normal file
14
bin/generate-crypto-key
Normal 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');
|
||||
}
|
Loading…
Reference in New Issue
Block a user