mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-05 21:17:53 +00:00
- add __toString magic method to Crypt_RSA
This commit is contained in:
parent
8f2994349c
commit
6e1b79ba24
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user