예제 #1
0
        public override IList <X509Crl> GetCRLsFromSignature()
        {
            IList <X509Crl> list = new List <X509Crl>();

            // Add certificates contained in SignedData
            foreach (X509Crl crl in cmsSignedData.GetCrls
                         ("Collection").GetMatches(null))
            {
                list.Add(crl);
            }
            // Add certificates in CAdES-XL certificate-values inside SignerInfo attribute if present
            SignerInformation si = BCStaticHelpers.GetSigner(cmsSignedData, signerId);

            if (si != null && si.UnsignedAttributes != null && si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues] != null)
            {
                RevocationValues revValues = RevocationValues.GetInstance(si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues].AttrValues[0]);
                foreach (CertificateList crlObj in revValues.GetCrlVals())
                {
                    X509Crl crl = new X509Crl(crlObj);
                    list.Add(crl);
                }
            }

            return(list);
        }
예제 #2
0
        public override IList <X509Crl> GetCRLsFromSignature()
        {
            IList <X509Crl> list = new AList <X509Crl>();

            try
            {
                // Add certificates contained in SignedData
                foreach (X509Crl crl in cmsSignedData.GetCrls
                             ("Collection").GetMatches(null))
                {
                    list.AddItem(crl);
                }
                // Add certificates in CAdES-XL certificate-values inside SignerInfo attribute if present
                SignerInformation si = cmsSignedData.GetSignerInfos().GetFirstSigner(signerId);
                if (si != null && si.UnsignedAttributes != null && si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues] != null)
                {
                    RevocationValues revValues = RevocationValues.GetInstance(si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues].AttrValues[0]);
                    foreach (CertificateList crlObj in revValues.GetCrlVals())
                    {
                        X509Crl crl = new X509Crl(crlObj);
                        list.AddItem(crl);
                    }
                }
            }

            /*catch (StoreException e)
             * {
             *      throw new RuntimeException(e);
             * }*/
            catch (CrlException e)
            {
                throw new RuntimeException(e);
            }
            return(list);
        }
예제 #3
0
        public override IList <BasicOcspResp> GetOCSPResponsesFromSignature()
        {
            IList <BasicOcspResp> list = new List <BasicOcspResp>();
            // Add certificates in CAdES-XL certificate-values inside SignerInfo attribute if present
            SignerInformation si = BCStaticHelpers.GetSigner(cmsSignedData, signerId);

            if (si != null && si.UnsignedAttributes != null && si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues] != null)
            {
                RevocationValues revValues = RevocationValues.GetInstance(si.UnsignedAttributes[PkcsObjectIdentifiers.IdAAEtsRevocationValues].AttrValues[0]);
                foreach (BasicOcspResponse ocspObj in revValues.GetOcspVals())
                {
                    BasicOcspResp bOcspObj = new BasicOcspResp(ocspObj);
                    list.Add(bOcspObj);
                }
            }
            return(list);
        }