summary refs log tree commit diff
path: root/crypto/src/asn1/tsp/TimeStampResp.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/tsp/TimeStampResp.cs')
-rw-r--r--crypto/src/asn1/tsp/TimeStampResp.cs26
1 files changed, 9 insertions, 17 deletions
diff --git a/crypto/src/asn1/tsp/TimeStampResp.cs b/crypto/src/asn1/tsp/TimeStampResp.cs
index f5186ca4f..3dde0dfce 100644
--- a/crypto/src/asn1/tsp/TimeStampResp.cs
+++ b/crypto/src/asn1/tsp/TimeStampResp.cs
@@ -12,24 +12,16 @@ namespace Org.BouncyCastle.Asn1.Tsp
 		private readonly PkiStatusInfo	pkiStatusInfo;
 		private readonly ContentInfo	timeStampToken;
 
-		public static TimeStampResp GetInstance(
-			object o)
-		{
-			if (o == null || o is TimeStampResp)
-			{
-				return (TimeStampResp) o;
-			}
-
-			if (o is Asn1Sequence)
-			{
-				return new TimeStampResp((Asn1Sequence) o);
-			}
-
-			throw new ArgumentException(
-				"Unknown object in 'TimeStampResp' factory: " + Platform.GetTypeName(o));
-		}
+        public static TimeStampResp GetInstance(object obj)
+        {
+            if (obj is TimeStampResp)
+                return (TimeStampResp)obj;
+            if (obj == null)
+                return null;
+            return new TimeStampResp(Asn1Sequence.GetInstance(obj));
+        }
 
-		private TimeStampResp(
+        private TimeStampResp(
 			Asn1Sequence seq)
 		{
 			this.pkiStatusInfo = PkiStatusInfo.GetInstance(seq[0]);