Beispiel #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();
     }
 }
Beispiel #2
0
 private void CheckTimeStampCertPath(TimestampToken t, TimestampVerificationResult result, IValidationContext ctx, IAdvancedSignature signature)
 {
     try
     {
         result.CertPathUpToTrustedList.SetStatus(ResultStatus.INVALID, "$UI_Signatures_ValidationText_CannotReachTSL");
         ctx.ValidateTimestamp(t, signature.CertificateSource, signature.CRLSource, signature.OCSPSource, result.UsedCerts);
         var tsSignerSubjectName = t.GetSignerSubjectName();
         foreach (CertificateAndContext c in ctx.NeededCertificates)
         {
             if (c.Certificate.SubjectDN.Equals(tsSignerSubjectName))
             {
                 if (ctx.GetParentFromTrustedList(c) != null)
                 {
                     result.CertPathUpToTrustedList.SetStatus(ResultStatus.VALID, null);
                     break;
                 }
             }
         }
     }
     catch (IOException)
     {
         result.CertPathUpToTrustedList.SetStatus(ResultStatus.UNDETERMINED, "$UI_Signatures_ValidationText_ExceptionWhileVerifying");
     }
 }