TimeStampReq ::= SEQUENCE {
version INTEGER { v1(1) },
messageImprint MessageImprint,
--a hash algorithm OID and the hash value of the data to be
--time-stamped
reqPolicy TSAPolicyId OPTIONAL,
nonce INTEGER OPTIONAL,
certReq BOOLEAN DEFAULT FALSE,
extensions [0] IMPLICIT Extensions OPTIONAL
}
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(messageImprint);
if (tsaPolicy != null)
{
v.add(tsaPolicy);
}
if (nonce != null)
{
v.add(nonce);
}
if (certReq != null && certReq.isTrue())
{
v.add(certReq);
}
if (extensions != null)
{
v.add(new DERTaggedObject(false, 0, extensions));
}
return new DERSequence(v);