sign.sh 1.2 KB
Newer Older
Mark Andrews's avatar
Mark Andrews committed
1 2
#!/bin/sh -e
#
3
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
4
#
5 6 7
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 9 10
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
Mark Andrews's avatar
Mark Andrews committed
11

12
. ../../conf.sh
Mark Andrews's avatar
Mark Andrews committed
13

14
zone1=good
Mark Andrews's avatar
Mark Andrews committed
15 16
infile1=good.db.in
zonefile1=good.db
17
zone2=bad
Mark Andrews's avatar
Mark Andrews committed
18 19 20
infile2=bad.db.in
zonefile2=bad.db

21 22 23 24
keyname11=`$KEYGEN -q -a RSASHA256 -b 1024 -n zone $zone1`
keyname12=`$KEYGEN -q -a RSASHA256 -b 2048 -n zone -f KSK $zone1`
keyname21=`$KEYGEN -q -a RSASHA256 -b 1024 -n zone $zone2`
keyname22=`$KEYGEN -q -a RSASHA256 -b 2048 -n zone -f KSK $zone2`
Mark Andrews's avatar
Mark Andrews committed
25 26 27 28

cat $infile1 $keyname11.key $keyname12.key >$zonefile1
cat $infile2 $keyname21.key $keyname22.key >$zonefile2

29 30
$SIGNER -P -g -o $zone1 $zonefile1 > /dev/null
$SIGNER -P -g -o $zone2 $zonefile2 > /dev/null
Mark Andrews's avatar
Mark Andrews committed
31

32 33
DSFILENAME1=dsset-${zone1}${TP}
DSFILENAME2=dsset-${zone2}${TP}
34 35
$DSFROMKEY -a SHA-256 $keyname12 > $DSFILENAME1
$DSFROMKEY -a SHA-256 $keyname22 > $DSFILENAME2
Mark Andrews's avatar
Mark Andrews committed
36

37
algo=SHA-384
Mark Andrews's avatar
Mark Andrews committed
38

39 40 41
$DSFROMKEY -a $algo $keyname12 >> $DSFILENAME1
$DSFROMKEY -a $algo $keyname22 > $DSFILENAME2