- add __toString magic method to Crypt_RSA

This commit is contained in:
terrafrost 2012-07-26 13:14:18 -05:00
parent 8f2994349c
commit 6e1b79ba24

View File

@ -1465,6 +1465,21 @@ class Crypt_RSA {
return $temp;
}
/**
* __toString() magic method
*
* @access public
*/
function __toString()
{
$key = $this->getPrivateKey($this->privateKeyFormat);
if ($key !== false) {
return $key;
}
$key = $this->getPublicKey($this->publicKeyFormat);
return $key !== false ? $key : '';
}
/**
* Generates the smallest and largest numbers requiring $bits bits
*