private void checkExcludedDNS(ISet excluded, String dns)
// throws PkixNameConstraintValidatorException
{
if (excluded.IsEmpty)
{
return;
}
IEnumerator it = excluded.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
// is sub domain or the same
if (WithinDomain(dns, str) || (Platform.CompareIgnoreCase(dns, str) == 0))
{
throw new PkixNameConstraintValidatorException(
"DNS is from an excluded subtree.");
}
}
}