<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="at.knowcenter.wag.egov.egiz.sig.SignatureResponse" %>

<%
	List results = (List) request.getAttribute("results");
	Object bb = request.getAttribute("backbutton");
	String btlurl = (String)request.getAttribute("btlurl");
	boolean backbutton = true;
	if (bb != null && bb.equals("false")) {
	  backbutton = false;
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
	  <title>PDF-Signaturen</title>
	</head>
	<body>
		<h1>PDF-Signaturen</h1>
		<h2>Pr&uuml;fergebnis</h2>
		<%
			Iterator resit = results.iterator();
			while (resit.hasNext()) {
				SignatureResponse result = (SignatureResponse) resit.next();
		%>
		
		<div class="pdfasverticalspace"></div>
		<fieldset class="pdfasresultfieldset">
			<legend><b>Signatur-Check</b></legend>
			<div class="<%= "0".equals(result.getSignatureCheckCode()) ? "pdfasok" : "pdfasnok" %>"><%= result.getSignatureCheckInfo() %></div>
		</fieldset>

		<div class="pdfassmallverticalspace"></div>
		<fieldset class="pdfasresultfieldset">
			<legend><b>Zertifikat</b></legend>
			<table class="pdfaslisttable" cellpadding="1" cellspacing="1">
				<tr><td class="pdfascaption">Signator:</td><td class="pdfasvalue"><%= result.getX509SubjectName() %></td></tr>
				<tr><td class="pdfascaption">Aussteller:</td><td class="pdfasvalue"><%= result.getX509IssuerName() %></td></tr>
				<tr><td class="pdfascaption">Seriennummer:</td><td class="pdfasvalue"><%= result.getX509SerialNumber() %></td></tr>
				<%
					List public_properties = result.getPublicProperties();
					Iterator propit = public_properties.iterator();
					while (propit.hasNext()) {
						String public_property = (String) propit.next();
				%>
				<tr><td class="pdfascaption">Eigenschaft:</td><td class="pdfasvalue"><%= public_property %></td></tr>
				<%
					}
				%>
				<tr><td class="pdfascaption">Zertifikat:</td><td class="<%= "0".equals(result.getCertificateCheckCode()) ? "pdfasok" : "pdfasnok" %>"><%= result.getCertificateCheckInfo() %></td></tr>
			</table>
		</fieldset>

		<div class="pdfassmallverticalspace"></div>
		<fieldset class="pdfasresultfieldset">
			<legend><b>Manifest-Check</b></legend>
			<div class="<%= "0".equals(result.getSignatureManifestCheckCode()) ? "pdfasok" : "pdfasnok" %>"><%= result.getSignatureManifestCheckInfo() %></div>
		</fieldset>

		<%
			if (resit.hasNext()) {
		%>
		<br />
		<%
			}
		}
		%>
		<div class="pdfasverticalspace"></div>
		<% if (backbutton) { %>
			<a href="<%= request.getContextPath() %>/jsp/verifyupload.jsp">zur&uuml;ck</a>
		<% } %>
		<% if (btlurl != null) { %>
			<a href="<%=btlurl%>">zur&uuml;ck zur Liste</a>
		<% } %>
	</body>
</html>