minimal-examples-lowlevel/crypto/minimal-crypto-dnssec/README.md
This standalone utility dynamically calls into the lws-dht-dnssec plugin to generate compliant Domain Name System Security Extensions (DNSSEC) cryptography keys intuitively, relying on the <domain> to format matching files automatically.
It requires libwebsockets built utilizing:
-DLWS_WITH_DHT_BACKEND=1
-DLWS_WITH_GENCRYPTO=1
-DLWS_WITH_JOSE=1
-DLWS_WITH_PLUGINS=1
keygen)Generates cryptographically secure Key Signing Key (KSK) and Zone Signing Key (ZSK) pairs simultaneously, natively leveraging lws_gencrypto.
Usage: lws-crypto-dnssec keygen [--type <RSA|EC>] [--bits <size>] [--curve <curve>] <domain>
--type: Generates keys natively compatible with DNSSEC mapping:
RSA (maps to Algorithm 8: RSASHA256)EC (maps to Algorithm 13: ECDSAP256SHA256, default algorithm for curve P-256)--bits: Specifies the bitlength for RSA algorithms (e.g., 1024, 2048).Keys are automatically written following the target <domain>:
<domain>.<ksk|zsk>.private.jwk: The private key exported as a JSON Web Key.<domain>.<ksk|zsk>.key: The public DNSKEY formatted directly for inclusion within standard BIND zone files.importnsd)Allows importing an existing domain from standard BIND/NSD setups by ingesting existing .private and .key files into standard JWK format.
Usage: lws-crypto-dnssec importnsd <domain> <key1-prefix> [key2-prefix]
Kexample.com.+013+12345.private and .key)KSK or ZSK implicitly based on DNSKEY parameters (flags 256 or 257)keygen:
<domain>.<ksk|zsk>.private.jwk<domain>.<ksk|zsk>.keydsfromkey, saving it as <domain>.dnssec.txt.dsfromkey)Constructs a DS (Delegation Signer) record fingerprint to establish the chain of trust with the parent registrar.
Usage: lws-crypto-dnssec dsfromkey [--hash <hash>] <domain>
<domain>.ksk.key path recursively.signzone)Verifies and cryptographically signs a raw zone file, incorporating both your KSK and ZSK signatures using lws_jose.
Usage: lws-crypto-dnssec signzone [--duration <hours>] <domain>
<domain>.zone (The user-provided mock base-zone).YYYYMMDDnn format natively.<domain>.ksk.private.jwk and <domain>.zsk.private.jwk.<domain>.zone.signed containing all initial A, NS, SOA records and appending the newly compiled DNSKEY and RRSIG combinations.<domain>.zone.signed.jws representing the completed JSON Web Signature payload securely ingestible into the DHT network.