public void CheckSignature(X509Certificate2Collection extraStore, bool verifySignatureOnly) { if (this.m_safeCryptMsgHandle == null || this.m_safeCryptMsgHandle.IsInvalid) { throw new InvalidOperationException(SecurityResources.GetResourceString("Cryptography_Cms_MessageNotSigned")); } if (extraStore == null) { throw new ArgumentNullException("extraStore"); } MySignedCms.CheckSignatures(this.SignerInfos, extraStore, verifySignatureOnly); }
private static void CheckSignatures(SignerInfoCollection signers, X509Certificate2Collection extraStore, bool verifySignatureOnly) { if (signers == null || signers.Count < 1) { throw new CryptographicException(-2146885618); } foreach (SignerInfo signerInfo in signers) { signerInfo.CheckSignature(extraStore, verifySignatureOnly); if (signerInfo.CounterSignerInfos.Count > 0) { MySignedCms.CheckSignatures(signerInfo.CounterSignerInfos, extraStore, verifySignatureOnly); } } }