protected function doRun()
 {
     $cryptTool = CryptTool::getInstance();
     $sendersThreemaId = $this->getArgumentThreemaId(self::argThreemaId);
     $id = $this->getArgumentThreemaId(self::argFrom);
     $secret = $this->getArgument(self::argSecret);
     $privateKey = $this->getArgumentPrivateKey(self::argPrivateKey);
     $nonce = $cryptTool->hex2bin($this->getArgument(self::argNonce));
     $messageId = $this->getArgument(self::argMessageId);
     $outputFolder = $this->getArgument(self::argOutputFolder);
     $box = $cryptTool->hex2bin($this->readStdIn());
     Common::required($box, $id, $secret, $privateKey, $nonce);
     $settings = new ConnectionSettings($id, $secret);
     $connector = new Connection($settings, $this->publicKeyStore);
     $helper = new E2EHelper($privateKey, $connector);
     $message = $helper->receiveMessage($sendersThreemaId, $messageId, $box, $nonce, $outputFolder);
     if (null === $message) {
         Common::e('invalid message');
         return;
     }
     if ($message->isSuccess()) {
         Common::l($message->getMessageId() . ' - ' . $message->getThreemaMessage());
         foreach ($message->getFiles() as $fileName => $filePath) {
             Common::l('   received file ' . $fileName . ' in ' . $filePath);
         }
     } else {
         Common::e('Error: ' . implode("\n", $message->getErrors()));
     }
 }