Beispiel #1
0
 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);
 }
Beispiel #2
0
 /**
  * Получаем 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;
 }