Documentation
¶
Overview ¶
Package dnssec provides DNSSEC keypair management and RRSIG generation for zonegit zones. v0.6 ships Ed25519 (RFC 8080, algorithm 15) — the smallest, fastest, simplest DNSSEC algorithm. Adding RSA or ECDSA in the future is a matter of plumbing additional Algorithm cases through the same surfaces (generation, key file marshalling, RRSIG.Sign).
Key material lives in a "keys directory" — by default <repo>/keys/ — as four files per zone:
<zone>.ksk.key Ed25519 private key, base64 (mode 0600) <zone>.ksk.pub Ed25519 public key, base64 (mode 0644) <zone>.zsk.key Ed25519 private key, base64 (mode 0600) <zone>.zsk.pub Ed25519 public key, base64 (mode 0644)
The on-disk format is the same as pkg/sign uses for commit-signing keys, so a future operator can adopt the same KMS adapters transparently when v0.7 adds remote-key support.
Index ¶
Constants ¶
const Algorithm = dns.ED25519
Algorithm 15 — Ed25519. The only algorithm v0.6 supports.
Variables ¶
This section is empty.
Functions ¶
func SignRRset ¶
func SignRRset(rrs []dns.RR, zone string, key Keypair, isKSK bool, inception, expiration uint32) (*dns.RRSIG, error)
SignRRset returns an RRSIG covering rrs, signed by key. Use the KSK only for the DNSKEY RRset; the ZSK signs everything else.
inception and expiration are unix timestamps. A typical validity window is 7–30 days; callers passing zero get a 30-day default starting now.
Types ¶
type Keypair ¶
type Keypair struct {
Public ed25519.PublicKey
Private ed25519.PrivateKey
}
Keypair holds one DNSSEC key (KSK or ZSK).
type ZoneKeys ¶
ZoneKeys holds both keys for a zone. By DNSSEC convention KSK signs only the DNSKEY RRset; ZSK signs everything else. Splitting the two lets operators rotate ZSKs frequently while keeping the KSK pinned in the parent zone's DS record.
func LoadFromDir ¶
LoadFromDir reads zone keys previously written by WriteToDir.
func (*ZoneKeys) DNSKEYs ¶
DNSKEYs returns the (KSK, ZSK) DNSKEY RRs derived from the keypair, ready to be staged via Repo.Set.
func (*ZoneKeys) WriteToDir ¶
WriteToDir persists zk to dir using the per-zone filenames above. dir is created if necessary. Existing files are overwritten — callers that care must check existence themselves first.