feat: able to make rsa/ed ssh keys

This commit is contained in:
Andras Bacsai
2024-04-03 13:45:49 +02:00
parent 82f74e2264
commit 22a1d3882e
4 changed files with 41 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ class Create extends Component
'value' => 'private Key',
];
public function generateNewKey()
public function generateNewRSAKey()
{
try {
$this->rateLimit(10);
@@ -37,6 +37,17 @@ class Create extends Component
return handleError($e, $this);
}
}
public function generateNewEDKey()
{
try {
$this->rateLimit(10);
$this->name = generate_random_name();
$this->description = 'Created by Coolify';
['private' => $this->value, 'public' => $this->publicKey] = generateSSHKey('ed25519');
} catch(\Throwable $e) {
return handleError($e, $this);
}
}
public function updated($updateProperty)
{
if ($updateProperty === 'value') {