for private key's, load works but loadFormat would be better

This commit is contained in:
terrafrost 2019-06-28 09:30:46 -05:00
parent eb659a5544
commit cb1e6b285c
3 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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) {

View File

@ -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)