Provides routines to set or retrieve the signature part of a signed message.

public __construct(ZBateson\MailMimeParser\Message\Factory\IMimePartFactory $mimePartFactory, ZBateson\MailMimeParser\Message\Factory\IUUEncodedPartFactory $uuEncodedPartFactory, ZBateson\MailMimeParser\Message\Helper\GenericHelper $genericHelper, ZBateson\MailMimeParser\Message\Helper\MultipartHelper $multipartHelper)
public getSignedMessageAsString(ZBateson\MailMimeParser\IMessage $message)

Returns a string containing the entire body (content) of a signed message for verification or calculating a signature.

Non-CRLF new lines are replaced to always be CRLF.

  • return string or null if the message doesn't have any children
public getSignedMessageStream(ZBateson\MailMimeParser\IMessage $message)

Returns a stream that can be used to read the content part of a signed message, which can be used to sign an email or verify a signature.

The method simply returns the stream for the first child. No verification of whether the message is in fact a signed message is performed.

Note that unlike getSignedMessageAsString, getSignedMessageStream doesn't replace new lines.

  • return \Psr\Http\Message\StreamInterface or null if the message doesn't have any children
public overwrite8bitContentEncoding(ZBateson\MailMimeParser\IMessage $message)

Loops over parts of the message and sets the content-transfer-encoding header to quoted-printable for text/* mime parts, and to base64 otherwise for parts that are '8bit' encoded.

Used for multipart/signed messages which doesn't support 8bit transfer encodings.

public setMessageAsMultipartSigned(ZBateson\MailMimeParser\IMessage $message, $micalg, $protocol)

The passed message is set as multipart/signed, and a new part is created below it with content headers, content and children copied from the message.

  • param string $micalg
  • param string $protocol
public setSignature(ZBateson\MailMimeParser\IMessage $message, $body)

Sets the signature of the message to $body, creating a signature part if one doesn't exist.

  • param string $body
protected ZBateson\MailMimeParser\Message\Helper\AbstractHelper::$mimePartFactory = NULL
  • var \IMimePartFactory to create parts for attachments/content
protected ZBateson\MailMimeParser\Message\Helper\AbstractHelper::$uuEncodedPartFactory = NULL
  • var \IUUEncodedPartFactory to create parts for attachments
private $genericHelper = NULL
  • var \GenericHelper a GenericHelper instance
private $multipartHelper = NULL
  • var \MultipartHelper a MultipartHelper instance
© 2024 Bruce Wells
Search Namespaces \ Classes