Microsoft.Xades.XadesSignedXml.CheckObjectReferencesInCommitmentTypeIndication C# (CSharp) Method

CheckObjectReferencesInCommitmentTypeIndication() public method

Check if each ObjectReference in CommitmentTypeIndication points to Reference element
public CheckObjectReferencesInCommitmentTypeIndication ( ) : bool
return bool
        public virtual bool CheckObjectReferencesInCommitmentTypeIndication()
        {
            CommitmentTypeIndicationCollection commitmentTypeIndicationCollection;
            CommitmentTypeIndication commitmentTypeIndication;
            bool objectReferenceOK;
            bool retVal;

            retVal = true;
            commitmentTypeIndicationCollection = this.XadesObject.QualifyingProperties.SignedProperties.SignedDataObjectProperties.CommitmentTypeIndicationCollection;
            if (commitmentTypeIndicationCollection.Count > 0)
            {
                for (int commitmentTypeIndicationCounter = 0; (retVal == true) && (commitmentTypeIndicationCounter < commitmentTypeIndicationCollection.Count); commitmentTypeIndicationCounter++)
                {
                    commitmentTypeIndication = commitmentTypeIndicationCollection[commitmentTypeIndicationCounter];
                    objectReferenceOK = true;
                    foreach (ObjectReference objectReference in commitmentTypeIndication.ObjectReferenceCollection)
                    {
                        objectReferenceOK &= this.CheckObjectReference(objectReference);
                    }
                    retVal = objectReferenceOK;
                }
                if (retVal == false)
                {
                    throw new CryptographicException("At least one ObjectReference in CommitmentTypeIndication did not point to a Reference");
                }
            }

            return retVal;
        }