class KEYRecordValidator implements DnsRecordValidatorInterface (View source)

KEY record validator

Note: The KEY record type has been obsoleted by RFC 4034 and replaced by the DNSKEY record type for DNS Security Extensions (DNSSEC). New deployments should use DNSKEY instead.

The KEY record was originally designed to store public keys for use with various security protocols. Its structure allows for storing different types of keys with associated protocol information.

Format:

Where:

  • flags: A 16-bit unsigned integer (0-65535) containing various bit flags Common flag values:
    • 0: Use of the key is prohibited for authentication
    • 256 (0x0100): Key is not for use with DNSSEC (i.e., a user key)
    • 257 (0x0101): Key is a DNSSEC zone key
  • protocol: An 8-bit integer (0-255) indicating the protocol for which the key is used
    • 3: DNSSEC (most common)
  • algorithm: An 8-bit integer (0-255) identifying the public key's cryptographic algorithm Common algorithm values:
    • 1: RSA/MD5
    • 2: Diffie-Hellman
    • 3: DSA/SHA1
    • 5: RSA/SHA-1
    • 8: RSA/SHA-256
  • public key: Base64 encoded key material

Example: 256 3 5 AQPSKmynfzW4kyBv015MUG2DeIQ3Cbl+BBZH4b/0PY1kxkmvHjcZc8nocffttoalYz93wXFSYqO0mx8LoMQ3XDHLcuq5K2bNiLFuhz5ty9d/GSDUDtl74bQBrUu/zW5tOQ==

Methods

__construct(ConfigurationManager $config)

No description

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

Validates KEY record content

Details

__construct(ConfigurationManager $config)

No description

Parameters

ConfigurationManager $config

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

Validates KEY record content

KEY format: Example: 256 3 5 AQPSKmynfzW4kyBv015MUG2DeIQ3Cbl+BBZH4b/0PY1kxkmvHjcZc8nocffttoalYz93wXFSYqO0mx8LoMQ3XDHLcuq5K2bNiLFuhz5ty9d/GSDUDtl74bQBrUu/zW5tOQ==

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