Swift_Signers_SMimeSigner::signMessage PHP Method

signMessage() public method

Change the Swift_Message to apply the signing.
public signMessage ( Swift_Message $message ) : Swift_Signers_SMimeSigner
$message Swift_Message
return Swift_Signers_SMimeSigner
    public function signMessage(Swift_Message $message)
    {
        if (null === $this->signCertificate && null === $this->encryptCert) {
            return $this;
        }
        // Store the message using ByteStream to a file{1}
        // Remove all Children
        // Sign file{1}, parse the new MIME headers and set them on the primary MimeEntity
        // Set the singed-body as the new body (without boundary)
        $messageStream = new Swift_ByteStream_TemporaryFileByteStream();
        $this->toSMimeByteStream($messageStream, $message);
        $message->setEncoder(Swift_DependencyContainer::getInstance()->lookup('mime.rawcontentencoder'));
        $message->setChildren(array());
        $this->streamToMime($messageStream, $message);
    }