summary refs log tree commit diff
path: root/crypto/src/asn1/pkcs/PBEParameter.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-01-27 01:58:23 +0700
commite71fe27c302d36e6355d9da12f3d9ec51540825a (patch)
tree6aa065f627d14e659e68ae0cbe355b656af3e40f /crypto/src/asn1/pkcs/PBEParameter.cs
parentAdd CrlID.GetInstance methods, obsolete public constructor (diff)
downloadBouncyCastle.NET-ed25519-e71fe27c302d36e6355d9da12f3d9ec51540825a.tar.xz
Misc. cleanup after bc-fips-csharp updates
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)
 		{