public class TimeStampTokenGenerator extends Object
final ESSCertID essCertid = new ESSCertID(certHashSha1, issuerSerial); final ESSCertIDv2 essCertidV2 = new ESSCertIDv2(certHashSha256, issuerSerial); signerInfoGenBuilder.setSignedAttributeGenerator(new CMSAttributeTableGenerator() { public AttributeTable getAttributes(Map parameters) throws CMSAttributeTableGenerationException { CMSAttributeTableGenerator attrGen = new DefaultSignedAttributeTableGenerator(); AttributeTable table = attrGen.getAttributes(parameters); table = table.add(PKCSObjectIdentifiers.id_aa_signingCertificate, new SigningCertificate(essCertid)); table = table.add(PKCSObjectIdentifiers.id_aa_signingCertificateV2, new SigningCertificateV2(essCertidV2)); return table; } });
Constructor and Description |
---|
TimeStampTokenGenerator(SignerInfoGenerator signerInfoGen,
DigestCalculator digestCalculator,
org.bouncycastle.asn1.ASN1ObjectIdentifier tsaPolicy)
Basic Constructor - set up a calculator based on signerInfoGen with a ESSCertID calculated from
the signer's associated certificate using the sha1DigestCalculator.
|
TimeStampTokenGenerator(SignerInfoGenerator signerInfoGen,
DigestCalculator digestCalculator,
org.bouncycastle.asn1.ASN1ObjectIdentifier tsaPolicy,
boolean isIssuerSerialIncluded)
Basic Constructor - set up a calculator based on signerInfoGen with a ESSCertID calculated from
the signer's associated certificate using the sha1DigestCalculator.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeCertificates(org.bouncycastle.util.Store attrStore) |
void |
addCertificates(org.bouncycastle.util.Store certStore)
Add the store of X509 Certificates to the generator.
|
void |
addCRLs(org.bouncycastle.util.Store crlStore) |
TimeStampToken |
generate(TimeStampRequest request,
BigInteger serialNumber,
Date genTime)
Generate a TimeStampToken for the passed in request and serialNumber marking it with the passed in genTime.
|
void |
setAccuracyMicros(int accuracyMicros) |
void |
setAccuracyMillis(int accuracyMillis) |
void |
setAccuracySeconds(int accuracySeconds) |
void |
setOrdering(boolean ordering) |
void |
setTSA(org.bouncycastle.asn1.x509.GeneralName tsa) |
public TimeStampTokenGenerator(SignerInfoGenerator signerInfoGen, DigestCalculator digestCalculator, org.bouncycastle.asn1.ASN1ObjectIdentifier tsaPolicy) throws IllegalArgumentException, TSPException
signerInfoGen
- the generator for the signer we are using.digestCalculator
- calculator for to use for digest of certificate.tsaPolicy
- tasPolicy to send.IllegalArgumentException
- if calculator is not SHA-1 or there is no associated certificate for the signer,TSPException
- if the signer certificate cannot be processed.public TimeStampTokenGenerator(SignerInfoGenerator signerInfoGen, DigestCalculator digestCalculator, org.bouncycastle.asn1.ASN1ObjectIdentifier tsaPolicy, boolean isIssuerSerialIncluded) throws IllegalArgumentException, TSPException
signerInfoGen
- the generator for the signer we are using.digestCalculator
- calculator for to use for digest of certificate.tsaPolicy
- tasPolicy to send.isIssuerSerialIncluded
- should issuerSerial be included in the ESSCertIDs, true if yes, by default false.IllegalArgumentException
- if calculator is not SHA-1 or there is no associated certificate for the signer,TSPException
- if the signer certificate cannot be processed.public void addCertificates(org.bouncycastle.util.Store certStore)
certStore
- a Store containing X509CertificateHolder objectspublic void addCRLs(org.bouncycastle.util.Store crlStore)
crlStore
- a Store containing X509CRLHolder objects.public void addAttributeCertificates(org.bouncycastle.util.Store attrStore)
attrStore
- a Store containing X509AttributeCertificate objects.public void setAccuracySeconds(int accuracySeconds)
public void setAccuracyMillis(int accuracyMillis)
public void setAccuracyMicros(int accuracyMicros)
public void setOrdering(boolean ordering)
public void setTSA(org.bouncycastle.asn1.x509.GeneralName tsa)
public TimeStampToken generate(TimeStampRequest request, BigInteger serialNumber, Date genTime) throws TSPException
request
- the originating request.serialNumber
- serial number for the TimeStampTokengenTime
- token generation time.TSPException