No default passphrase for self-signed #259

This commit is contained in:
the-djmaze 2024-02-19 15:28:03 +01:00
parent f53d9ed6c3
commit f181863d50

View file

@ -32,11 +32,12 @@ trait SMime
*/ */
$sName = $this->GetActionParam('name', '') ?: $oAccount->Name(); $sName = $this->GetActionParam('name', '') ?: $oAccount->Name();
$sEmail = $this->GetActionParam('email', '') ?: $oAccount->Email(); $sEmail = $this->GetActionParam('email', '') ?: $oAccount->Email();
$sPassphrase = $this->GetActionParam('passphrase', '');
$cert = new Certificate(); $cert = new Certificate();
$cert->distinguishedName['commonName'] = $sName; $cert->distinguishedName['commonName'] = $sName;
$cert->distinguishedName['emailAddress'] = $sEmail; $cert->distinguishedName['emailAddress'] = $sEmail;
$result = $cert->createSelfSigned('demo'); $result = $cert->createSelfSigned($sPassphrase);
return $this->DefaultResponse($result ?: false); return $this->DefaultResponse($result ?: false);
} }