// TSTInfo OID according to RFC 3161
int[] tSTInfoOid = new int[] { 1, 2, 840, 113549, 1, 9, 16, 1, 4 };
ContentInfo tSTInfoEncoded = new ContentInfo(tSTInfoOid,
ASN1OctetString.getInstance().encode(
TSTInfo.ASN1.encode(tSTInfo)));
SignedData tokenContent = new SignedData(1, Collections
.singletonList(new AlgorithmIdentifier(sha1)), tSTInfoEncoded,
null, null, Collections.singletonList(sigInfo));
ContentInfo timeStampToken = new ContentInfo(ContentInfo.SIGNED_DATA,
tokenContent);