Add ability to set custom key length

This commit is contained in:
Rob Desilets committed 2022-02-10 15:05:18 -06:00
1 parent c25ba7fab9
commit bd83867dcf
2 files changed
+29 -24

No files matched your search

+2 -2
View File
@@ -51,11 +51,11 @@ class Helper
*
* @return string
*/
public static function getNewKey(): string
public static function getNewKey(int $keyLength): string
{
$key = openssl_pkey_new([
'private_key_bits' => 2048,
'private_key_bits' => $keyLength,
'private_key_type' => OPENSSL_KEYTYPE_RSA,
]);
openssl_pkey_export($key, $pem);