mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-29 12:32:45 +00:00
EC: make secret field in savePrivateKey optional
This commit is contained in:
parent
5c8966334e
commit
f928536632
@ -176,8 +176,8 @@ abstract class OpenSSH extends Progenitor
|
||||
BigInteger $privateKey,
|
||||
BaseCurve $curve,
|
||||
array $publicKey,
|
||||
string $secret,
|
||||
$password,
|
||||
?string $secret = null,
|
||||
?string $password = null,
|
||||
array $options = []
|
||||
): string {
|
||||
if ($curve instanceof Ed25519) {
|
||||
|
@ -164,7 +164,7 @@ abstract class PKCS1 extends Progenitor
|
||||
*
|
||||
* @param Integer[] $publicKey
|
||||
*/
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, string $secret, ?string $password = null, array $options = []): string
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $secret = null, ?string $password = null, array $options = []): string
|
||||
{
|
||||
self::initialize_static_variables();
|
||||
|
||||
|
@ -203,7 +203,7 @@ abstract class PKCS8 extends Progenitor
|
||||
*
|
||||
* @param Integer[] $publicKey
|
||||
*/
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, string $secret, ?string $password = null, array $options = []): string
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $secret = null, ?string $password = null, array $options = []): string
|
||||
{
|
||||
self::initialize_static_variables();
|
||||
|
||||
|
@ -89,7 +89,7 @@ abstract class PuTTY extends Progenitor
|
||||
*
|
||||
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
||||
*/
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, string $secret, ?string $password = null, array $options = []): string
|
||||
public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, ?string $secret = null, ?string $password = null, array $options = []): string
|
||||
{
|
||||
self::initialize_static_variables();
|
||||
|
||||
|
@ -90,7 +90,7 @@ abstract class libsodium
|
||||
*
|
||||
* @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
|
||||
*/
|
||||
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, string $secret, ?string $password = null): string
|
||||
public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, ?string $secret = null, ?string $password = null): string
|
||||
{
|
||||
if (!isset($secret)) {
|
||||
throw new \RuntimeException('Private Key does not have a secret set');
|
||||
|
Loading…
Reference in New Issue
Block a user