]> WPIA git - gigi.git/commitdiff
UPD: Added issued and expires date to certificates display
authorJanis Streib <janis@dogcraft.de>
Tue, 13 Jan 2015 19:06:45 +0000 (20:06 +0100)
committerJanis Streib <janis@dogcraft.de>
Tue, 13 Jan 2015 19:06:45 +0000 (20:06 +0100)
src/org/cacert/gigi/output/CertificateIterable.java
src/org/cacert/gigi/output/CertificateTable.templ

index 261fef196245897d08abf9988398873460771c27..431b1c6ea4b924d4497ff8553012d1b699fa4fcc 100644 (file)
@@ -1,5 +1,8 @@
 package org.cacert.gigi.output;
 
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.cert.X509Certificate;
 import java.util.Map;
 
 import org.cacert.gigi.dbObjects.Certificate;
@@ -27,10 +30,17 @@ public class CertificateIterable implements IterableDataset {
         vars.put("serial", c.getSerial());
         vars.put("digest", c.getMessageDigest());
         vars.put("profile", c.getProfile().getVisibleName());
-
-        vars.put("issued", "TODO"); // TODO output dates
-        vars.put("revoked", "TODO");
-        vars.put("expire", "TODO");
+        X509Certificate cert;
+        try {
+            cert = c.cert();
+            vars.put("issued", DateSelector.getDateFormat().format(cert.getNotBefore()));
+            vars.put("expire", DateSelector.getDateFormat().format(cert.getNotAfter()));
+        } catch (IOException e) {
+            e.printStackTrace();
+        } catch (GeneralSecurityException e) {
+            e.printStackTrace();
+        }
+        vars.put("revoked", "TODO");// TODO output date
         return true;
     }
 }
index 29c53eb0f47359b76f6a6c0ad5e882902fcc52cd..1999897ec3c6c4b95b08da923f3dd8d0dd56135c 100644 (file)
@@ -1,16 +1,16 @@
 <form method="post">
 <table class="wrapper dataTable">
 <thead><tr>
-<td><?=_Renew/Revoke/Delete?></td>
-<td><?=_Status?></td>
-<td><?=_Email Address?></td>
-<td><?=_SerialNumber?></td>
-<td><?=_Digest?></td>
-<td><?=_Profile?></td>
-<td><?=_Issued?></td>
-<td><?=_Revoked?></td>
-<td><?=_Expires?></td>
-<td><?=_Login?></td>
+<th><?=_Renew/Revoke/Delete?></th>
+<th><?=_Status?></th>
+<th><?=_Email Address?></th>
+<th><?=_SerialNumber?></th>
+<th><?=_Digest?></th>
+<th><?=_Profile?></th>
+<th><?=_Issued?></th>
+<th><?=_Revoked?></th>
+<th><?=_Expires?></th>
+<th><?=_Login?></th>
 </tr></thead>
 <tbody>
 <? foreach($certs) {?>