]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/pages/main/CertStatusRequestForm.java
add: display on cert status check if cert is valid and expired
[gigi.git] / src / club / wpia / gigi / pages / main / CertStatusRequestForm.java
index 88e1264b7ed34cb2e0107e4726dc2f2d60abc6bc..dd863176f52cd6e3b97f82c7486110f4cc17fa2b 100644 (file)
@@ -1,6 +1,7 @@
 package club.wpia.gigi.pages.main;
 
 import java.io.PrintWriter;
+import java.util.Date;
 import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -49,6 +50,9 @@ public class CertStatusRequestForm extends Form {
             java.util.Date revocationDate = c.getRevocationDate();
             throw new PermamentFormException(new GigiApiException(SprintfCommand.createSimple("Certificate has been revoked on {0}.", revocationDate)));
         }
+        if (c.getExpiryDate().before(new Date())) {
+            return new SuccessMessageResult((SprintfCommand.createSimple("Certificate is valid but has expired on {0}.", c.getExpiryDate())));
+        }
 
         return new SuccessMessageResult(new TranslateCommand("Certificate is valid."));
     }