Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SMime.php

function SMime::convertMessageToSMimePart

2 calls to SMime::convertMessageToSMimePart()
SMimeEncrypter::encrypt in vendor/symfony/mime/Crypto/SMimeEncrypter.php
SMimeSigner::sign in vendor/symfony/mime/Crypto/SMimeSigner.php

File

vendor/symfony/mime/Crypto/SMime.php, line 40

Class

SMime
@author Sebastiaan Stok <s.stok@rollerscapes.net>

Namespace

Symfony\Component\Mime\Crypto

Code

protected function convertMessageToSMimePart($stream, string $type, string $subtype) : SMimePart {
    rewind($stream);
    $headers = '';
    while (!feof($stream)) {
        $buffer = fread($stream, 78);
        $headers .= $buffer;
        // Detect ending of header list
        if (preg_match('/(\\r\\n\\r\\n|\\n\\n)/', $headers, $match)) {
            $headersPosEnd = strpos($headers, $headerBodySeparator = $match[0]);
            break;
        }
    }
    $headers = $this->getMessageHeaders(trim(substr($headers, 0, $headersPosEnd)));
    fseek($stream, $headersPosEnd + \strlen($headerBodySeparator));
    return new SMimePart($this->getStreamIterator($stream), $type, $subtype, $this->getParametersFromHeader($headers['content-type']));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal