HashSet authorizedcertprofilesids = new HashSet(info.getAuthorizedEndEntityCertificateProfileNames().entrySet());  if(profile != null){  if(profile instanceof EIDProfile){ Collection availablecertprofileids = ((EIDProfile) profile).getAllCertificateProfileIds(); returnval = authorizedcertprofilesids.containsAll(availablecertprofileids); }else{  returnval = false; } }
HashSet authorizedcertprofiles = new HashSet(certificatesession.getAuthorizedCertificateProfileIds(administrator, SecConst.CERTTYPE_HARDTOKEN));  if(profile instanceof EIDProfile){ if(authorizedcertprofiles.containsAll(((EIDProfile) profile).getAllCertificateProfileIds())){ returnval = true; } }else{  }
    private boolean authorizedToProfile(HardTokenProfile profile, boolean editcheck){      boolean returnval = false;        boolean allexists = false;        try{                  try{          authorizationsession.isAuthorizedNoLog(administrator, "/super_administrator");          return true;          }catch(AuthorizationDeniedException ade){}                if(editcheck)                  authorizationsession.isAuthorizedNoLog(administrator, "/hardtoken_functionality/edit_hardtoken_profiles");                  HashSet authorizedcertprofilesids = new HashSet(info.getAuthorizedEndEntityCertificateProfileNames().entrySet());               if(profile != null){                    if(profile instanceof EIDProfile){			Collection availablecertprofileids = ((EIDProfile) profile).getAllCertificateProfileIds();			returnval = authorizedcertprofilesids.containsAll(availablecertprofileids);               }else{          		      	        // Implement other card types	        returnval = false; 	      }                                   }      }catch(AuthorizationDeniedException e){}               return returnval;      }    