mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-05-29 06:30:51 +00:00
for private key's, load works but loadFormat would be better
This commit is contained in:
parent
eb659a5544
commit
cb1e6b285c
|
@ -70,7 +70,7 @@ class PrivateKey extends DSA implements Common\PrivateKey
|
|||
|
||||
$key = $type::savePublicKey($this->p, $this->q, $this->g, $this->y);
|
||||
|
||||
return DSA::load($key, 'PKCS8')
|
||||
return DSA::loadFormat('PKCS8', $key)
|
||||
->withHash($this->hash->getHash())
|
||||
->withSignatureFormat($this->shortFormat);
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ class PrivateKey extends EC implements Common\PrivateKey
|
|||
$type = self::validatePlugin('Keys', 'PKCS8', 'savePublicKey');
|
||||
|
||||
$key = $type::savePublicKey($this->curve, $this->QA);
|
||||
$key = EC::load($key, 'PKCS8')
|
||||
$key = EC::loadFormat('PKCS8', $key)
|
||||
->withHash($this->hash->getHash())
|
||||
->withSignatureFormat($this->shortFormat);
|
||||
if ($this->curve instanceof TwistedEdwardsCurve) {
|
||||
|
|
|
@ -503,7 +503,7 @@ class PrivateKey extends RSA implements Common\PrivateKey
|
|||
}
|
||||
|
||||
$key = $type::savePublicKey($this->modulus, $this->publicExponent);
|
||||
return RSA::load($key, 'PKCS8')
|
||||
return RSA::loadFormat('PKCS8', $key)
|
||||
->withHash($this->hash->getHash())
|
||||
->withMGFHash($this->mgfHash->getHash())
|
||||
->withSaltLength($this->sLen)
|
||||
|
|
Loading…
Reference in New Issue
Block a user