package org.cryptonit.cloud.timestamping;

import org.bouncycastle.tsp.*;
import org.bouncycastle.util.Store;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.*;
import java.security.cert.X509Certificate;
/**
 * @author Mathias Brossard
 */
public class Authority {
    private static Logger LOGGER;
    KeyPair key;
    X509Certificate crt;
    Store certs;
    BigInteger serial;

    public TimeStampResponse timestamp(TimeStampRequest request) {
        TimeStampResponse response = null;
        return response;
    }

    public Authority(KeyPair key, X509Certificate crt, Store certs) {
        LOGGER = LoggerFactory.getLogger(Authority.class);
        
        this.key = key;
        this.crt = crt;
        this.certs = certs;
        this.serial = new BigInteger("1");
    }
}

@@ -36,16 +36,112 @@
 mping;%0A%0A
+import java.math.BigInteger;%0Aimport java.security.*;%0Aimport java.security.cert.X509Certificate;%0A
 import o
@@ -159,24 +159,24 @@
 stle.tsp.*;%0A
-
 import org.b
@@ -260,75 +260,9 @@
 ry;%0A
-import java.security.*;%0Aimport java.security.cert.X509Certificate;
 %0A
+
 /**%0A
@@ -318,16 +318,72 @@
 ority %7B%0A
+    private final BigInteger one = new BigInteger(%221%22);%0A
     priv
@@ -463,24 +463,24 @@
 tore certs;%0A
-
     BigInteg
@@ -491,16 +491,151 @@
 erial;%0A%0A
+    synchronized private BigInteger getNextSerial() %7B%0A        BigInteger s = serial;%0A        serial.add(one);%0A        return s;%0A    %7D%0A%0A
     publ

Add serial number incrementation method