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\CryptoCode
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' => [],
];
}