sign.sh revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrewskeyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 1024 -n zone $zone`
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrews$SIGNER -P -g -r $RANDFILE -o $zone $zonefile > /dev/null
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrews# Configure the resolving server with a trusted key.
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrewscat $keyname.key | grep -v '^; ' | $PERL -n -e '
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrewslocal ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrewslocal $key = join("", @rest);
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrewstrusted-keys {
7865ea9545f28f12f046b32d24c989e8441b9812Mark Andrews "$dn" $flags $proto $alg "$key";