Add ability for jdnssec-signzone to find the necessary keys by either looking in the zone to find DNSKEY RRs, or by looking on disk for key files matching the zonename.
git-svn-id: https://svn.verisignlabs.com/jdnssec/tools/trunk@122 4cbd57fe-54e5-0310-bd9a-f30fe5ea5e6e
This commit is contained in:
@@ -138,4 +138,37 @@ public class ZoneUtils
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List findRRs(List records, Name name, int type)
|
||||
{
|
||||
List res = new ArrayList();
|
||||
for (Iterator i = records.iterator(); i.hasNext();)
|
||||
{
|
||||
Object o = i.next();
|
||||
|
||||
if (o instanceof Record)
|
||||
{
|
||||
Record r = (Record) o;
|
||||
if (r.getName().equals(name) && r.getType() == type)
|
||||
{
|
||||
res.add(r);
|
||||
}
|
||||
}
|
||||
else if (o instanceof RRset)
|
||||
{
|
||||
RRset r = (RRset) o;
|
||||
if (r.getName().equals(name) && r.getType() == type)
|
||||
{
|
||||
for (Iterator j = r.rrs(); j.hasNext();)
|
||||
{
|
||||
res.add(j.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user