summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/util/io/pem/PemReader.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/src/util/io/pem/PemReader.cs b/crypto/src/util/io/pem/PemReader.cs
index bf712b6de..61e132fa7 100644
--- a/crypto/src/util/io/pem/PemReader.cs
+++ b/crypto/src/util/io/pem/PemReader.cs
@@ -39,11 +39,14 @@ namespace Org.BouncyCastle.Utilities.IO.Pem
 			{
 				line = line.Substring(BeginString.Length);
 				int index = line.IndexOf('-');
-				string type = line.Substring(0, index);
 
-				if (index > 0)
-					return LoadObject(type);
-			}
+                if (index > 0 && Platform.EndsWith(line, "-----") && (line.Length - index) == 5)
+                {
+                    string type = line.Substring(0, index);
+
+                    return LoadObject(type);
+                }
+            }
 
 			return null;
 		}