class DSRecordValidator implements DnsRecordValidatorInterface (View source)

Validator for DS (Delegation Signer) DNS records

DS records are a critical component of DNSSEC and provide a secure delegation mechanism from a parent zone to a child zone. They contain a digest of a DNSKEY record in the child zone, allowing the parent zone to validate the child's keys.

Format:

  • key-tag: A 16-bit numerical identifier (1-65535) for the referenced DNSKEY
  • algorithm: DNSSEC algorithm number (1-16, same as DNSKEY record)
  • digest-type: Hash algorithm used (1=SHA-1, 2=SHA-256, 4=SHA-384)
  • digest: Hexadecimal representation of the hash with length based on digest type
    • SHA-1: 40 hex characters
    • SHA-256: 64 hex characters
    • SHA-384: 96 hex characters

Special case for CDS records (RFC 8078):

  • "0 0 0 00" is a special deletion record to signal removal of DS at parent

Methods

__construct(ConfigurationManager $config)

Constructor

validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validate DS record

validateDSRecordContent(string $content)

Validate DS record content format for public use

Details

__construct(ConfigurationManager $config)

Constructor

Parameters

ConfigurationManager $config

ValidationResult validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validate DS record

Parameters

string $content

The content part of the record

string $name

The name part of the record

mixed $prio

The priority value (if applicable)

int|string|null $ttl

The TTL value

int $defaultTTL

The default TTL to use if not specified

mixed ...$args

Additional validator-specific parameters

Return Value

ValidationResult

ValidationResult containing validated data or error messages

ValidationResult validateDSRecordContent(string $content)

Validate DS record content format for public use

Parameters

string $content

DS record content

Return Value

ValidationResult

ValidationResult containing validation status or error message