{
throw new CertPathValidatorException("Subtree check for certificate subject failed.", e, certPath,
index);
}
GeneralNames altName = null;
try
{
altName = GeneralNames.getInstance(CertPathValidatorUtilities.getExtensionValue(cert,
RFC3280CertPathUtilities.SUBJECT_ALTERNATIVE_NAME));
}
catch (Exception e)
{
throw new CertPathValidatorException("Subject alternative name extension could not be decoded.", e,
certPath, index);
}
Vector emails = new X509Name(dns).getValues(X509Name.EmailAddress);
for (Enumeration e = emails.elements(); e.hasMoreElements();)
{
String email = (String)e.nextElement();
GeneralName emailAsGeneralName = new GeneralName(GeneralName.rfc822Name, email);
try
{
nameConstraintValidator.checkPermitted(emailAsGeneralName);
nameConstraintValidator.checkExcluded(emailAsGeneralName);
}
catch (PKIXNameConstraintValidatorException ex)
{
throw new CertPathValidatorException(
"Subtree check for certificate subject alternative email failed.", ex, certPath, index);
}
}
if (altName != null)
{
GeneralName[] genNames = null;
try
{
genNames = altName.getNames();
}
catch (Exception e)
{
throw new CertPathValidatorException("Subject alternative name contents could not be decoded.", e,
certPath, index);