Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / dnssec / ns1 / sign.sh
blob73ddc092c0f05ba49daea3db1e8c6d9a45dd1412
1 #!/bin/sh -e
3 # Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000-2003 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: sign.sh,v 1.30 2009/10/28 00:27:10 marka Exp
20 SYSTEMTESTTOP=../..
21 . $SYSTEMTESTTOP/conf.sh
23 RANDFILE=../random.data
25 zone=.
26 infile=root.db.in
27 zonefile=root.db
29 (cd ../ns2 && sh sign.sh )
31 cp ../ns2/dsset-example. .
32 cp ../ns2/dsset-dlv. .
34 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
36 cat $infile $keyname.key > $zonefile
38 $SIGNER -P -g -r $RANDFILE -o $zone $zonefile > /dev/null
40 # Configure the resolving server with a trusted key.
42 cat $keyname.key | grep -v '^; ' | $PERL -n -e '
43 local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
44 local $key = join("", @rest);
45 print <<EOF
46 trusted-keys {
47 "$dn" $flags $proto $alg "$key";
49 EOF
50 ' > trusted.conf
51 cp trusted.conf ../ns2/trusted.conf
52 cp trusted.conf ../ns3/trusted.conf
53 cp trusted.conf ../ns4/trusted.conf
54 cp trusted.conf ../ns6/trusted.conf
55 cp trusted.conf ../ns7/trusted.conf