Since the RFC 5544 is based on CMS objects you need to wrap the TimeStampedData
object into a ContentInfo
with the timestamped-data object identifier as defined in the RFC.
You should call:
TimeStampedData timeStampedData = new TimeStampedData(uri, null, asn1OctetString, evid);
ContentInfo contentInfo = new ContentInfo(CmsObjectIdentifiers.timestampedData, timeStampedData);
Byte[] fileData = contentInfo.GetEncoded();
And then store this byte array into a file.