xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/synthfromdnssec/ns1/sign.sh (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1#!/bin/sh -e
2
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# SPDX-License-Identifier: MPL-2.0
6#
7# This Source Code Form is subject to the terms of the Mozilla Public
8# License, v. 2.0.  If a copy of the MPL was not distributed with this
9# file, you can obtain one at https://mozilla.org/MPL/2.0/.
10#
11# See the COPYRIGHT file distributed with this work for additional
12# information regarding copyright ownership.
13
14# shellcheck source=conf.sh
15. "$SYSTEMTESTTOP/conf.sh"
16
17zone=example
18infile=example.db.in
19zonefile=example.db
20
21keyname=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -n zone $zone)
22cat "$infile" "$keyname.key" > "$zonefile"
23
24$SIGNER -P -o $zone $zonefile > /dev/null
25
26zone=dnamed
27infile=dnamed.db.in
28zonefile=dnamed.db
29
30keyname=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -n zone $zone)
31cat "$infile" "$keyname.key" > "$zonefile"
32
33$SIGNER -P -o $zone $zonefile > /dev/null
34
35zone=.
36infile=root.db.in
37zonefile=root.db
38
39keyname=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -b ${DEFAULT_BITS} -n zone $zone)
40cat "$infile" "$keyname.key" > "$zonefile"
41
42$SIGNER -P -g -o $zone $zonefile > /dev/null
43
44# Configure the resolving server with a static key.
45keyfile_to_static_ds "$keyname" > trusted.conf
46