summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/openssl/test/ReaderTest.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/test/src/openssl/test/ReaderTest.cs b/crypto/test/src/openssl/test/ReaderTest.cs
index 78b06abc2..8cb66d6a6 100644
--- a/crypto/test/src/openssl/test/ReaderTest.cs
+++ b/crypto/test/src/openssl/test/ReaderTest.cs
@@ -3,6 +3,7 @@ using System.IO;
 
 using NUnit.Framework;
 
+using Org.BouncyCastle.Asn1;
 using Org.BouncyCastle.Asn1.Cms;
 using Org.BouncyCastle.Crypto;
 using Org.BouncyCastle.Crypto.Generators;
@@ -42,6 +43,23 @@ namespace Org.BouncyCastle.OpenSsl.Tests
             get { return "PEMReaderTest"; }
         }
 
+        [Test]
+        public void TestGost3410_2012()
+        {
+            string data =
+                "-----BEGIN PRIVATE KEY-----" +
+                "MEMCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIIBidanaO5G6Go8A" +
+                "thlDjR9rk4hij/PpjAQvXJr+zTqz" +
+                "-----END PRIVATE KEY-----";
+
+            using (var textReader = new StringReader(data))
+            {
+                var pemReader = new PemReader(textReader);
+                var pemObj = pemReader.ReadPemObject();
+                PrivateKeyFactory.CreateKey(pemObj.Content);
+            }
+        }
+
         public override void PerformTest()
         {
             IPasswordFinder pGet = new Password("secret".ToCharArray());