#!/usr/bin/perl
#$Id: key2ds 999 2012-06-28 09:38:55Z willem $
use strict;
use Net::DNS;
# A little util to convert DNSKEY records to DS records
# From stdin to stdout
#
# Author: Miek Gieben, NLnetLabs
my $key;
while (<>) { $key .= $_ };
my $keyrr = new Net::DNS::RR($key);
my $dssha256 = Net::DNS::RR::DS->create($keyrr, digtype => "SHA256");
my $dssha1 = create Net::DNS::RR::DS($keyrr, digtype => "SHA1");
print $dssha1->string,"\n";
print $dssha256->string,"\n";
exit 0;
=head1 NAME
key2ds - Utility to convert a DNSSEC KEY to a DS record
=head1 SYNOPSIS
C<key2ds>
=head1 DESCIPTION
C<key2ds> reads the key data from STDIN and print the corresponding
DS record on STDOUT.
=head1 COPYRIGHT
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
0;