public function testDecrypt() { $keys = System_Rsa_Keygen::Generate(); $rsa = new System_Rsa_Rsalib($keys['module'], $keys['public'], $keys['private']); $output = $rsa->encrypt($this->_testString); $output = $rsa->decrypt($output); $this->assertEquals($this->_testString, $output); }
/** * Получаем RSA ключи * * @return object */ public static function getKeys() { if (null === self::$_rsaKeys) { self::$_rsaKeys = (object) System_Rsa_Keygen::Generate(); $self = new self(); $self->_saveKeysToSession(self::$_rsaKeys); } return self::$_rsaKeys; }