summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 23:35:40 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-06-27 23:35:40 +0700
commita9ee4c34747ea0f52fdd35fd96fd27a1ca6f5fe5 (patch)
treec7773c6c74138297d468899bc50a0621d976c0c3 /crypto/test
parentUpdate alternative names from bc-java (diff)
downloadBouncyCastle.NET-ed25519-a9ee4c34747ea0f52fdd35fd96fd27a1ca6f5fe5.tar.xz
Add extra IAN,SAN extension accessors
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/test/CertTest.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/crypto/test/src/test/CertTest.cs b/crypto/test/src/test/CertTest.cs
index 84b29ab89..7fb2c89c1 100644
--- a/crypto/test/src/test/CertTest.cs
+++ b/crypto/test/src/test/CertTest.cs
@@ -1221,9 +1221,19 @@ namespace Org.BouncyCastle.Tests
                 Fail("failed extended key usage test");
             }
 
+            foreach (var gn in cert.GetSubjectAlternativeNameExtension().GetNames())
+            {
+                if (gn.TagNo != GeneralName.Rfc822Name ||
+                    !((IAsn1String)gn.Name).GetString().Equals("test@test.test"))
+                {
+                    Fail("failed subject alternative name extension test");
+                }
+            }
+
             foreach (var gn in cert.GetSubjectAlternativeNames())
             {
-                if (!gn[1].Equals("test@test.test"))
+                if (!gn[0].Equals(GeneralName.Rfc822Name) ||
+                    !gn[1].Equals("test@test.test"))
                 {
                     Fail("failed subject alternative names test");
                 }