Exemplo n.º 1
0
 public TimestampVerificationResult(TimestampToken token)
 {
     if (token != null && token.GetTimeStamp() != null)
     {
         var signers = token.GetTimeStamp().ToCmsSignedData().GetSignerInfos().GetSigners().GetEnumerator();
         signers.MoveNext();
         signatureAlgorithm = ((SignerInformation)signers.Current).EncryptionAlgOid;
         serialNumber       = token.GetTimeStamp().TimeStampInfo.SerialNumber.ToString();
         creationTime       = token.GetTimeStamp().TimeStampInfo.GenTime;
         issuerName         = token.GetSignerSubjectName().ToString();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Validate the timestamp
        /// </summary>
        public virtual void ValidateTimestamp(TimestampToken timestamp, ICertificateSource optionalSource, ICrlSource optionalCRLSource, IOcspSource optionalOCPSSource, IList <CertificateAndContext> usedCerts)
        {
            if (timestamp is null)
            {
                throw new ArgumentNullException(nameof(timestamp));
            }

            AddNotYetVerifiedToken(timestamp);
            Validate(
                timestamp.GetTimeStamp().TimeStampInfo.GenTime,
                new CompositeCertificateSource(timestamp.GetWrappedCertificateSource(), optionalSource),
                optionalCRLSource,
                optionalOCPSSource,
                usedCerts);
        }