コード例 #1
0
        /// <summary>
        /// Validate the document and all its signatures
        /// </summary>
        /// <returns>
        /// the validation report
        /// </returns>
        public ValidationReport ValidateDocument(Document document, bool checkIntegrity = true, Document externalContent = null)
        {
            var cmsSignedData            = GetCmsSignedData(document);
            var verificationTime         = DateTime.Now;
            var timeInformation          = new TimeInformation(verificationTime);
            var signatureInformationList = new List <SignatureInformation>();
            var context = new SignatureValidationContext();

            foreach (IAdvancedSignature signature in GetSignatures(cmsSignedData))
            {
                var logger         = loggerFactory();
                var validationInfo = ValidateSignature(signature, signature.SigningTime?.Value ?? DateTime.Now, logger, context, checkIntegrity, externalContent);
                validationInfo.ValidationLog = logger.GetEntries();

                signatureInformationList.Add(validationInfo);
            }
            return(new ValidationReport(timeInformation, signatureInformationList));
        }
コード例 #2
0
 public ValidationReport(TimeInformation timeInformation, IList <SignatureInformation> signatureInformationList)
 {
     TimeInformation          = timeInformation;
     SignatureInformationList = signatureInformationList;
 }