DKIM Header V1 Factory (Dkim/HeaderV1Factory.php)

genkgo/mail · src/Dkim/HeaderV1Factory.php · php · MIT
email, security, lang:php, tag:dkim

Generates DKIM signature headers for email messages while ignoring specific header fields. Use when implementing email authentication and cryptographic signing.

// Source: https://github.com/genkgo/mail | License: MIT | Copyright 2017 Genkgo
// Provided via justclaw.it.com; keep this notice with the code.
<?php
declare(strict_types=1);

namespace Genkgo\Mail\Dkim;

use Genkgo\Mail\Header\HeaderName;
use Genkgo\Mail\Header\HeaderValue;
use Genkgo\Mail\Header\HeaderValueParameter;
use Genkgo\Mail\HeaderInterface;
use Genkgo\Mail\MessageInterface;

final class HeaderV1Factory
{
    public const HEADER_NAME = 'DKIM-Signature';

    /**
     * @var array<string, bool>
     */
    private const HEADERS_IGNORED = [
        'return-path' => true,
        'received' => true,
        'comments' => true,
        'keywords' => true,
        'bcc' => true,
        'resent-bcc' => true,
    ];

    /**
     * @var SignInterface
     */
    private $sign;

    /

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key