- public static void main(String[] args) throws IOException {
- TreeSet<String> pt = new TreeSet<>();
- TreeSet<String> req = new TreeSet<>();
- LinkedList<CertificateProfile> cps = new LinkedList<>();
- for (CertificateProfile cp : byId.values()) {
- cps.add(cp);
- for (PropertyTemplate p : cp.pt) {
- pt.add(p.inc);
- }
- req.addAll(Arrays.asList(cp.req));
- }
- PrintWriter pw = new PrintWriter("profiles.html");
- pw.println("<!DOCTYPE html><html><head><title>Profiles</title>");
- pw.println("<style>.split{background-color:#000;margin:0;cell-spacing:0}td{text-align:center}</style>");
- pw.println("</head>");
- pw.println("<body><table border='1'>");
- pw.println("<tr><td>id</td><td> </td>");
- for (String p : pt) {
- pw.println("<th>" + p + "</th>");
- }
- pw.println("<th class='split'></th>");
- for (String p : req) {
- pw.println("<th class='req'>" + p + "</th>");
- }
- pw.println("</tr>");
- for (CertificateProfile certificateProfile : cps) {
- pw.println("<tr>");
- pw.println("<td>" + certificateProfile.id + "</td>");
- pw.println("<td>" + certificateProfile.keyName + "</td>");
- outer:
- for (String p : pt) {
- for (PropertyTemplate t : certificateProfile.pt) {
- if (t.inc.equals(p)) {
- pw.println("<td>" + (t.required ? (t.multiple ? "+" : "y") : (t.multiple ? "*" : "?")) + "</td>");
- continue outer;
- }
- }
- pw.println("<td></td>");
+ public boolean canBeIssuedBy(CertificateOwner owner, User actor) {
+ if (pt.containsKey("orga")) {
+ if ( !(owner instanceof Organisation)) {
+ return false;