summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Scheel <alexander.scheel@keyfactor.com>2024-02-12 10:04:28 -0500
committerAlexander Scheel <alexander.scheel@keyfactor.com>2024-02-12 11:08:13 -0500
commited8f2f730a2bd5c900a08f2b27e396cc6e31cef5 (patch)
tree71075cf90b81e2465ce2db73d51d69c246bcfff0
parentAdded test for PKCS7 signed content parsing #310 #232 (diff)
downloadBouncyCastle.NET-ed25519-ed8f2f730a2bd5c900a08f2b27e396cc6e31cef5.tar.xz
Verifying read of MS PKCS#7 SignedData
Signed-off-by: Alexander Scheel <alexander.scheel@keyfactor.com>
-rw-r--r--crypto/test/src/cms/test/SignedDataTest.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/test/src/cms/test/SignedDataTest.cs b/crypto/test/src/cms/test/SignedDataTest.cs
index 78a5015b2..78d472400 100644
--- a/crypto/test/src/cms/test/SignedDataTest.cs
+++ b/crypto/test/src/cms/test/SignedDataTest.cs
@@ -1493,6 +1493,26 @@ namespace Org.BouncyCastle.Cms.Tests
 			VerifySignatures(sig);
 		}
 
+		[Test]
+		public void TestMsPkcs7()
+		{
+			var data = GetInput("Pkcs7SignedContent.p7b");
+			var sData = new CmsSignedData(data);
+
+			var certStore = sData.GetCertificates();
+			var signers = sData.GetSignerInfos();
+			var c = signers.GetSigners();
+
+			foreach (var signer in c)
+			{
+				var certCollection = certStore.EnumerateMatches(signer.SignerID);
+				foreach (var cert in certCollection)
+				{
+					signer.Verify(cert);
+				}
+			}
+		}
+
         private static void DoTestSample(string sigName)
         {
             CmsSignedData sig = new CmsSignedData(GetInput(sigName));