summary refs log tree commit diff
path: root/crypto/src/asn1/pkcs/PBEParameter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/pkcs/PBEParameter.cs')
-rw-r--r--crypto/src/asn1/pkcs/PBEParameter.cs23
1 files changed, 8 insertions, 15 deletions
diff --git a/crypto/src/asn1/pkcs/PBEParameter.cs b/crypto/src/asn1/pkcs/PBEParameter.cs
index e8e7c5a82..31d9ad1f3 100644
--- a/crypto/src/asn1/pkcs/PBEParameter.cs
+++ b/crypto/src/asn1/pkcs/PBEParameter.cs
@@ -1,7 +1,6 @@
 using System;
 
 using Org.BouncyCastle.Math;
-using Org.BouncyCastle.Utilities;
 
 namespace Org.BouncyCastle.Asn1.Pkcs
 {
@@ -11,20 +10,14 @@ namespace Org.BouncyCastle.Asn1.Pkcs
 		private readonly Asn1OctetString	salt;
 		private readonly DerInteger			iterationCount;
 
-		public static PbeParameter GetInstance(object obj)
-		{
-			if (obj is PbeParameter || obj == null)
-			{
-				return (PbeParameter) obj;
-			}
-
-			if (obj is Asn1Sequence)
-			{
-				return new PbeParameter((Asn1Sequence) obj);
-			}
-
-			throw new ArgumentException("Unknown object in factory: " + Platform.GetTypeName(obj), "obj");
-		}
+        public static PbeParameter GetInstance(object obj)
+        {
+            if (obj == null)
+                return null;
+            if (obj is PbeParameter pbeParameter)
+                return pbeParameter;
+            return new PbeParameter(Asn1Sequence.GetInstance(obj));
+        }
 
 		private PbeParameter(Asn1Sequence seq)
 		{