private void CheckPermittedDNS(ISet permitted, String dns)
//throws PkixNameConstraintValidatorException
{
if (permitted == null)
{
return;
}
IEnumerator it = permitted.GetEnumerator();
while (it.MoveNext())
{
String str = ((String)it.Current);
// is sub domain
if (WithinDomain(dns, str) || dns.ToUpper().Equals(str.ToUpper()))
{
return;
}
}
if (dns.Length == 0 && permitted.Count == 0)
{
return;
}
throw new PkixNameConstraintValidatorException(
"DNS is not from a permitted subtree.");
}