Ejemplo n.º 1
0
 /**
  * @medium
  */
 function testGetUserKeys()
 {
     $keys = Encryption\Keymanager::getUserKeys($this->view, $this->userId);
     $resPublic = openssl_pkey_get_public($keys['publicKey']);
     $this->assertTrue(is_resource($resPublic));
     $sslInfoPublic = openssl_pkey_get_details($resPublic);
     $this->assertArrayHasKey('key', $sslInfoPublic);
     $privateKey = Encryption\Crypt::decryptPrivateKey($keys['privateKey'], $this->pass);
     $resPrivate = openssl_pkey_get_private($privateKey);
     $this->assertTrue(is_resource($resPrivate));
     $sslInfoPrivate = openssl_pkey_get_details($resPrivate);
     $this->assertArrayHasKey('key', $sslInfoPrivate);
 }