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

Breadcrumb

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

function SMimeSigner::__construct

Parameters

string $certificate The path of the file containing the signing certificate (in PEM format):

string $privateKey The path of the file containing the private key (in PEM format):

string|null $privateKeyPassphrase A passphrase of the private key (if any):

string|null $extraCerts The path of the file containing intermediate certificates (in PEM format) needed by the signing certificate:

int|null $signOptions Bitwise operator options for openssl_pkcs7_sign() (@see https://secure.php.net/manual/en/openssl.pkcs7.flags.php):

File

vendor/symfony/mime/Crypto/SMimeSigner.php, line 34

Class

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

Namespace

Symfony\Component\Mime\Crypto

Code

public function __construct(string $certificate, string $privateKey, ?string $privateKeyPassphrase = null, ?string $extraCerts = null, ?int $signOptions = null) {
    if (!\extension_loaded('openssl')) {
        throw new \LogicException('PHP extension "openssl" is required to use SMime.');
    }
    $this->signCertificate = $this->normalizeFilePath($certificate);
    if (null !== $privateKeyPassphrase) {
        $this->signPrivateKey = [
            $this->normalizeFilePath($privateKey),
            $privateKeyPassphrase,
        ];
    }
    else {
        $this->signPrivateKey = $this->normalizeFilePath($privateKey);
    }
    $this->signOptions = $signOptions ?? \PKCS7_DETACHED;
    $this->extraCerts = $extraCerts ? realpath($extraCerts) : null;
}

API Navigation

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