}
public TimeStampResponse timestamp(TimeStampRequest timestampRequest) {
TimeStampTokenGenerator tokenGenerator = createTokenGenerator(timestampRequest);
TimeStampResponseGenerator respGen = new TimeStampResponseGenerator(
tokenGenerator, TSPAlgorithms.ALLOWED);
Date tsDate = new Date();
TimeStampResponse response;
try {
response = respGen.generate(timestampRequest, keystore.getCertificate().getSerialNumber(), tsDate);
} catch (Exception e) {
throw new RuntimeException("Could not generate timestamp response", e);
}
return response;