Verify the RRSIG
A validator rebuilds the signed data, checks the time window and verifies the signature: the first Ed25519 example of RFC 8080 verifies with 3 labels and fails with 2.
The question
A validator holds an RRset and its RRSIG. What does it check before it says that the records are valid, and in what order?
It checks that the time of its clock lies in the validity period of the signature and finds the DNSKEY by key tag, algorithm and signer name (RFC 4035, 5.3.1), rebuilds the signed data from the RRset and the RRSIG (5.3.2) and checks the signature with that key (5.3.3).
This page checks one Ed25519 signature, of the first published example of RFC 8080, section 6.1, and then judges constructed ones. Ed25519 signatures are 64 raw bytes (RFC 8080, section 4).
Ed25519 is an elliptic-curve signature, the subject of Elliptic Curves Point by Point; this page does not teach it.
Work it by hand
The signed data of the previous lesson is the input, and the result is yes or no: the signature either matches the data under the key or it does not, and one changed byte of the data, the TTL or a label included, makes it fail.
A signature can be valid and still not usable: the time of the check must not be before the inception and not after the expiration. RFC 4034, 3.1.5, says that the record must not be used for authentication prior to the inception date and after the expiration date, so a time equal to either end is inside the period.
For the exercise this page fixes one order: the time is checked first, then the signature. A signature with a bad time is reported by its time.
Run it
A real validator has only the public key of the DNSKEY. The page's Key.verify needs a key object made from the private key, so the page uses the private key that RFC 8080, section 6.1, prints (test material, public, labelled in the input). The program signs the published data and compares the result with the published signature; then it verifies the published signature over the data of the previous lesson (line 3) and over the same data with Labels 2 (line 4).

Watch the steps (recorded video)
Public test material, generated for this lesson. Never use it for anything real.
let key = ssl.parse_key(signer_key);
let sig = key.sign("SHA256", ssl.unhex(data3));
let again = key.verify("SHA256", ssl.unhex(data3), published);
let other = key.verify("SHA256", ssl.unhex(data2), published);
let rows = str_list();
rows.add("signature bytes|" + str(hex_len(sig)));
rows.add("same as published|" + str(sig == published));
rows.add("published, labels 3|" + str(again));
rows.add("published, labels 2|" + str(other));
let answer = rows;
{
"answer": [
"signature bytes|64",
"same as published|true",
"published, labels 3|true",
"published, labels 2|false"
]
}The signature the program computes is the published one, the same on every run, because Ed25519 signatures are not randomised.
The name SHA256 in the call is ignored for Ed25519: any name, here SHA512, gives the same bytes. The published signature verifies over the data with Labels 3 and not over the data with Labels 2, the value that RFC 4034, 3.1.3 gives for an owner of two labels. The page reports this and does not guess why. A key text that is not a private key stops the run at line 1 with the message that begins "Ssl.parse_key: cannot read private key".
Your turn
A validator model gets the signed data, the signature and its clock. The program below is meant to return valid, not yet valid, expired or bad signature for the key in signer_key (test material), the signed data in data (hex), the signature in sig (hex), the time now and the validity period inception and expiration, all in seconds since 1970. The time is checked first, as the page says.
Decide whether it does, and find the candidates that do. Check runs each candidate on the data shown and on six others. The records and signatures are constructed for this page.

Public test material, generated for this lesson. Never use it for anything real.
let key = ssl.parse_key(signer_key);
let good = key.verify("SHA256", ssl.unhex(data), sig);
let answer = "valid";
if (!good) { answer = "bad signature"; }
if (now >= expiration) { answer = "expired"; }
if (now <= inception) { answer = "not yet valid"; }
{
"answer": "not yet valid"
}Return valid, not yet valid, expired or bad signature. The time is checked first: a time before the inception gives not yet valid and a time after the expiration gives expired; a time equal to the inception or the expiration is inside the period. Inside the period the result is valid when the signature verifies over the data and bad signature otherwise.
Read the result carefully
A valid result says that the data was signed by the holder of this test key, within its period, as far as a model on one page can tell. It does not say that the key belongs to the zone, that a name that did not answer does not exist, or that the data is correct: the rest of the chain is the next lesson's subject. A real validator has only the public key and does not use a private key.
The clock in the exercise is an input; the page reads no real time. The signed data are constructed records under names ending in .test and the signatures were made with the published test key; nothing here is a statement about a real zone.
This model compares plain numbers and checks only the time and the signature; a real validator uses serial number arithmetic (RFC 4034, 3.1.5) and also checks the type covered, the signer's name and the Labels field (RFC 4035, 5.3.1).
Recap
- A validator rebuilds the signed data, checks the time window and verifies the signature with the DNSKEY.
- A changed byte anywhere in the signed data makes the signature fail.
- A signature outside its validity period is rejected even when it is good.
- Ed25519 signatures are 64 bytes and are the same on every run for a fixed key and data.