public TimeStampTokenEvidence(TimeStampAndCrl timeStampAndCrl)
 {
     timeStampAndCrls = new TimeStampAndCrl[1]
     {
         timeStampAndCrl
     };
 }
    private TimeStampTokenEvidence(Asn1Sequence seq)
    {
        timeStampAndCrls = new TimeStampAndCrl[seq.Count];
        int num = 0;

        foreach (Asn1Encodable item in seq)
        {
            timeStampAndCrls[num++] = TimeStampAndCrl.GetInstance(item.ToAsn1Object());
        }
    }
示例#3
0
        private TimeStampTokenEvidence(Asn1Sequence seq)
        {
            this.timeStampAndCrls = new TimeStampAndCrl[seq.Count];

            int count = 0;

            foreach (Asn1Encodable ae in seq)
            {
                this.timeStampAndCrls[count++] = TimeStampAndCrl.GetInstance(ae.ToAsn1Object());
            }
        }
示例#4
0
        private byte[] GenerateTSRFile(byte[] originalContent, string fileName, byte[] timestampResponse)
        {
            DerIA5String derIA5String = null;

            if (!string.IsNullOrEmpty(fileName))
            {
                derIA5String = new DerIA5String(fileName);
            }
            BerOctetString    berOctetStrings   = new BerOctetString(originalContent);
            TimeStampResponse timeStampResponse = new TimeStampResponse(timestampResponse);
            TimeStampAndCrl   timeStampAndCrl   = new TimeStampAndCrl(timeStampResponse.TimeStampToken.ToCmsSignedData().ContentInfo);
            Evidence          evidence          = new Evidence(new TimeStampTokenEvidence(timeStampAndCrl));
            TimeStampedData   timeStampedDatum  = new TimeStampedData(derIA5String, null, berOctetStrings, evidence);

            return((new ContentInfo(CmsObjectIdentifiers.timestampedData, timeStampedDatum)).GetEncoded());
        }
示例#5
0
        public CryptoFile create(CryptoFile p7mFile, CryptoFile[] tsrFiles)
        {
            List <TimeStampAndCrl> tsCRLLst       = new List <TimeStampAndCrl>();
            Asn1OctetString        p7mOctecString = (Asn1OctetString) new DerOctetString(p7mFile.Content).ToAsn1Object();

            foreach (CryptoFile tsrFile in tsrFiles)
            {
                TimeStampResponse tsr   = new TimeStampResponse(tsrFile.Content);
                TimeStampAndCrl   tsCRL = new TimeStampAndCrl(tsr.TimeStampToken.ToCmsSignedData().ContentInfo);
                tsCRLLst.Add(tsCRL);
            }
            Evidence        ev     = new Evidence(new TimeStampTokenEvidence(tsCRLLst.ToArray()));
            TimeStampedData newTSD = new TimeStampedData(null, null, p7mOctecString, ev);
            ContentInfo     info   = new ContentInfo(CmsObjectIdentifiers.timestampedData, newTSD.ToAsn1Object());
            CryptoFile      retval = new CryptoFile {
                Content = info.GetDerEncoded(), Name = "default.tsd", MessageFileType = fileType.Binary
            };

            return(retval);
        }
 public TimeStampTokenEvidence(TimeStampAndCrl timeStampAndCrl)
 {
     this.timeStampAndCrls = new TimeStampAndCrl[]{ timeStampAndCrl };
 }
 public TimeStampTokenEvidence(TimeStampAndCrl[] timeStampAndCrls)
 {
     this.timeStampAndCrls = timeStampAndCrls;
 }