2 # Create a signing key for a zone, add it, and sign the zone
4 require './bind8-lib.pl';
5 &error_setup($text{'zonekey_err'});
7 $zone = &get_zone_name($in{'index'}, $in{'view'});
8 $dom = $zone->{'name'};
9 &can_edit_zone($zone) ||
10 &error($text{'master_ecannot'});
11 $desc = &ip6int_to_net(&arpa_to_ip($dom));
13 # Validate inputs and compute size
14 ($ok, $size) = &compute_dnssec_key_size($in{'alg'}, $in{'size_def'},
16 &error($size) if (!$ok);
18 &ui_print_unbuffered_header($desc, $text{'zonekey_title'}, "",
19 undef, undef, undef, undef, &restart_links($zone));
22 &lock_file(&make_chroot(&absolute_path($zone->{'file'})));
23 print &text('zonekey_creating', $dom),"<br>\n";
24 $err = &create_dnssec_key($zone, $in{'alg'}, $size, $in{'single'});
26 print &text('zonekey_ecreate', $err),"<p>\n";
29 print $text{'zonekey_done'},"<p>\n";
32 print &text('zonekey_signing', $dom),"<br>\n";
33 $err = &sign_dnssec_zone($zone);
35 print &text('zonekey_esign', $err),"<p>\n";
38 print $text{'zonekey_done'},"<p>\n";
42 &unlock_file(&make_chroot(&absolute_path($zone->{'file'})));
43 &webmin_log("zonekeyon", undef, $dom);
44 &ui_print_footer("edit_master.cgi?index=$in{'index'}&view=$in{'view'}",
45 $text{'master_return'});