Copied!

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

CloneableInstantiable
Methods
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) : ?string
 

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 null if the message doesn't have any children
public getSignedMessageStream(ZBateson\MailMimeParser\IMessage $message) : ?Psr\Http\Message\StreamInterface
 

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 ?\StreamInterface null if the message doesn't have any children
public overwrite8bitContentEncoding(ZBateson\MailMimeParser\IMessage $message) : static
 

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) : static
 

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) : static
 

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

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