diff --git a/phpseclib/Crypt/Common/PrivateKey.php b/phpseclib/Crypt/Common/PrivateKey.php index 00712328..bc0b9ede 100644 --- a/phpseclib/Crypt/Common/PrivateKey.php +++ b/phpseclib/Crypt/Common/PrivateKey.php @@ -26,5 +26,5 @@ interface PrivateKey //public function decrypt($ciphertext); public function getPublicKey(); public function toString($type, array $options = []); - public function withPassword($string); + public function withPassword($string = false); } diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 2e1620c1..daf54796 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -2615,7 +2615,7 @@ class X509 if ($signatureAlgorithm != 'id-RSASSA-PSS') { $signatureAlgorithm = ['algorithm' => $signatureAlgorithm]; } else { - $r = PSS::load($issuer->privateKey->toString('PSS')); + $r = PSS::load($issuer->privateKey->withPassword()->toString('PSS')); $signatureAlgorithm = [ 'algorithm' => 'id-RSASSA-PSS', 'parameters' => PSS::savePSSParams($r)