protected function createMessageInstance()
    {
        $hasSigner = $this->signer->hasSigner();
        $class     = $hasSigner ? '\Swift_SignedMessage' : '\Swift_Message';

        $message = new $class();

        if ($hasSigner) {
            $message->attachSigner($this->signer->createSigner());
        }

        return $message;
    }