return response;
}
private TimeStampTokenGenerator createTokenGenerator(TimeStampRequest request) {
JcaSignerInfoGeneratorBuilder sigBuilder;
try {
sigBuilder = new JcaSignerInfoGeneratorBuilder(
new JcaDigestCalculatorProviderBuilder().setProvider("BC").build());
} catch (OperatorCreationException e) {
throw new RuntimeException("Could not create signature info generator", e);
}
AttributeTable attributes = new AttributeTable(new Hashtable<String, String>());
sigBuilder.setSignedAttributeGenerator(
new DefaultSignedAttributeTableGenerator(attributes));
sigBuilder.setUnsignedAttributeGenerator(new SimpleAttributeTableGenerator(attributes));
SignerInfoGenerator signerInfoGen;
try {
signerInfoGen = sigBuilder.build(new JcaContentSignerBuilder("SHA1withRSA")
.setProvider("BC")
.build(keystore.getPrivateKey()),
keystore.getCertificate());
} catch (Exception e) {
throw new RuntimeException("Could not create signer info generator", e);