RSA: code cleanup

This commit is contained in:
terrafrost 2016-07-28 13:08:47 -05:00
parent 06ed64ef3d
commit c12500cace

View File

@ -794,11 +794,7 @@ class RSA
return false; return false;
} }
$oldFormat = $this->privateKeyFormat; return $type::savePrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients, $this->password);
$this->privateKeyFormat = $type;
$temp = $type::savePrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients, $this->password);
$this->privateKeyFormat = $oldFormat;
return $temp;
} }
/** /**
@ -969,11 +965,7 @@ class RSA
return false; return false;
} }
$oldFormat = $this->publicKeyFormat; return $type::savePublicKey($this->modulus, $this->publicExponent);
$this->publicKeyFormat = $type;
$temp = $type::savePublicKey($this->modulus, $this->publicExponent);
$this->publicKeyFormat = $oldFormat;
return $temp;
} }
/** /**
@ -1161,9 +1153,9 @@ class RSA
/** /**
* Determines the private key format * Determines the private key format
* *
* @see self::createKey() * @see self::__toString()
* @access public * @access public
* @param int $format * @param string $format
*/ */
function setPrivateKeyFormat($format) function setPrivateKeyFormat($format)
{ {
@ -1173,9 +1165,9 @@ class RSA
/** /**
* Determines the public key format * Determines the public key format
* *
* @see self::createKey() * @see self::__toString()
* @access public * @access public
* @param int $format * @param string $format
*/ */
function setPublicKeyFormat($format) function setPublicKeyFormat($format)
{ {