Example #1
0
 /// <summary>
 /// For level -XL, every X509Crl values contained in the IValidationContext must be in the RevocationValues of the
 /// signature
 /// </summary>
 /// <param name="ctx"></param>
 /// <param name="refs"></param>
 /// <param name="signingCert"></param>
 /// <returns></returns>
 protected internal virtual bool EveryCRLValueOrRefAreThere <_T0>(IValidationContext ctx, IList <_T0> crlValuesOrRef, ICAdESLogger logger)
 {
     foreach (X509Crl crl in ctx.NeededCRL)
     {
         logger.Info("Looking for CRL ref issued by " + crl.IssuerDN);
         bool found = false;
         foreach (object valueOrRef in crlValuesOrRef)
         {
             if (valueOrRef is X509Crl)
             {
                 X509Crl sigCRL = (X509Crl)valueOrRef;
                 if (sigCRL.Equals(crl))
                 {
                     found = true;
                     break;
                 }
             }
             if (valueOrRef is CRLRef)
             {
                 CRLRef @ref = (CRLRef)valueOrRef;
                 if (@ref.Match(crl))
                 {
                     found = true;
                     break;
                 }
             }
         }
         logger.Info("Ref " + (found ? " found" : " not found"));
         if (!found)
         {
             return(false);
         }
     }
     return(true);
 }