]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/dbObjects/Job.java
add: key-compromise revocation
[gigi.git] / src / club / wpia / gigi / dbObjects / Job.java
index 8941e38a74410e9addd9c2bb8310e0e93d1d1d26..4c4c753d9ab19bf2cb25c118cfd072edda67ff75 100644 (file)
@@ -45,9 +45,20 @@ public class Job implements IdCachable {
     }
 
     protected synchronized static Job revoke(Certificate targetId, RevocationType type) {
-        try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `certsRevoked` SET id=?, type=?::`revocationType`")) {
+        return revoke(targetId, type, null, null, null);
+    }
+
+    protected synchronized static Job revoke(Certificate targetId, String challenge, String signature, String message) {
+        return revoke(targetId, RevocationType.KEY_COMPROMISE, challenge, signature, message);
+    }
+
+    private synchronized static Job revoke(Certificate targetId, RevocationType type, String challenge, String signature, String message) {
+        try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `certsRevoked` SET id=?, type=?::`revocationType`, challenge=?, signature=?, message=?")) {
             ps.setInt(1, targetId.getId());
             ps.setEnum(2, type);
+            ps.setString(3, challenge);
+            ps.setString(4, signature);
+            ps.setString(5, message);
             ps.execute();
         }