Skip to content

Commit 16697c7

Browse files
committed
add newKey command for data encryption
1 parent 461b043 commit 16697c7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Ubiquity/devtools/cmd/Command.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,15 @@ public static function displayAcls() {
575575
'Display all defined roles with ACL annotations' => 'Ubiquity aclDisplay role'
576576
], 'security');
577577
}
578+
579+
public static function newEncryptionKey(){
580+
return new Command('new-key', 'cypher', 'Generate a new encryption key using a cipher.', [
581+
'new:key',
582+
'newKey'
583+
], [], [
584+
'Generate a key for AES-128' => 'Ubiquity new-key 128'
585+
], 'security');
586+
}
578587

579588
protected static function getCustomCommandInfos() {
580589
$result = [];
@@ -584,6 +593,9 @@ protected static function getCustomCommandInfos() {
584593
$result[] = $o->getCommand();
585594
}
586595
}
596+
if(\class_exists('\\Ubiquity\\security\\data\\EncryptionManager',true)){
597+
$result[]=self::newEncryptionKey();
598+
}
587599
return $result;
588600
}
589601

0 commit comments

Comments
 (0)