protected static void additionalChecks(
     X509AttributeCertificate attrCert, ExtendedPKIXParameters pkixParams)
     throws CertPathValidatorException {
   // 1
   for (Iterator it = pkixParams.getProhibitedACAttributes().iterator(); it.hasNext(); ) {
     String oid = (String) it.next();
     if (attrCert.getAttributes(oid) != null) {
       throw new CertPathValidatorException(
           "Attribute certificate contains prohibited attribute: " + oid + ".");
     }
   }
   for (Iterator it = pkixParams.getNecessaryACAttributes().iterator(); it.hasNext(); ) {
     String oid = (String) it.next();
     if (attrCert.getAttributes(oid) == null) {
       throw new CertPathValidatorException(
           "Attribute certificate does not contain necessary attribute: " + oid + ".");
     }
   }
 }