summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorDavid Hook <dgh@bouncycastle.org>2015-10-17 12:34:45 +1100
committerDavid Hook <dgh@bouncycastle.org>2015-10-17 12:34:45 +1100
commit63d20b868c912396089f9f0fbe006f85e33c86d4 (patch)
tree4f1460f57bdb331f45f0367e6e80c7cf32fcd7fb /crypto/test
parentAdded test of SignerInfoGenerator (diff)
downloadBouncyCastle.NET-ed25519-63d20b868c912396089f9f0fbe006f85e33c86d4.tar.xz
added DSA tests for SHA-2
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/cms/test/SignedDataTest.cs28
1 files changed, 27 insertions, 1 deletions
diff --git a/crypto/test/src/cms/test/SignedDataTest.cs b/crypto/test/src/cms/test/SignedDataTest.cs
index 10f701e90..2b5d147f6 100644
--- a/crypto/test/src/cms/test/SignedDataTest.cs
+++ b/crypto/test/src/cms/test/SignedDataTest.cs
@@ -738,7 +738,31 @@ namespace Org.BouncyCastle.Cms.Tests
 			EncapsulatedTest(SignKP, SignCert, CmsSignedDataGenerator.DigestRipeMD256);
 		}
 
-		[Test]
+        [Test]
+        public void TestSha224WithDsaEncapsulated()
+        {
+            EncapsulatedTest(SignDsaKP, SignDsaCert, CmsSignedDataGenerator.DigestSha224);
+        }
+
+        [Test]
+        public void TestSha256WithDsaEncapsulated()
+        {
+            EncapsulatedTest(SignDsaKP, SignDsaCert, CmsSignedDataGenerator.DigestSha256);
+        }
+
+        [Test]
+        public void TestSha384WithDsaEncapsulated()
+        {
+            EncapsulatedTest(SignDsaKP, SignDsaCert, CmsSignedDataGenerator.DigestSha384);
+        }
+
+        [Test]
+        public void TestSha512WithDsaEncapsulated()
+        {
+            EncapsulatedTest(SignDsaKP, SignDsaCert, CmsSignedDataGenerator.DigestSha512);
+        }
+
+        [Test]
 		public void TestECDsaEncapsulated()
 		{
 			EncapsulatedTest(SignECDsaKP, SignECDsaCert, CmsSignedDataGenerator.DigestSha1);
@@ -998,6 +1022,8 @@ namespace Org.BouncyCastle.Cms.Tests
 				certEnum.MoveNext();
 				X509Certificate cert = (X509Certificate) certEnum.Current;
 
+                Assert.AreEqual(digestAlgorithm, signer.DigestAlgOid);
+
 				Assert.IsTrue(signer.Verify(cert));
 			}