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

Breadcrumb

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

function DkimSigner::__construct

Parameters

string $pk The private key as a string or the path to the file containing the private key, should be prefixed with file:// (in PEM format):

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

File

vendor/symfony/mime/Crypto/DkimSigner.php, line 39

Class

DkimSigner
@author Fabien Potencier <fabien@symfony.com>

Namespace

Symfony\Component\Mime\Crypto

Code

public function __construct(string $pk, string $domainName, string $selector, array $defaultOptions = [], string $passphrase = '') {
    if (!\extension_loaded('openssl')) {
        throw new \LogicException('PHP extension "openssl" is required to use DKIM.');
    }
    $this->key = openssl_pkey_get_private($pk, $passphrase) ?: throw new InvalidArgumentException('Unable to load DKIM private key: ' . openssl_error_string());
    $this->defaultOptions += [
        'algorithm' => self::ALGO_SHA256,
        'signature_expiration_delay' => 0,
        'body_max_length' => \PHP_INT_MAX,
        'body_show_length' => false,
        'header_canon' => self::CANON_RELAXED,
        'body_canon' => self::CANON_RELAXED,
        'headers_to_ignore' => [],
    ];
}
RSS feed
Powered by Drupal