summary refs log tree commit diff
path: root/crypto/src/asn1/ocsp/TBSRequest.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-07-14 15:07:49 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-07-14 15:07:49 +0700
commitdc8b86c13c769e6de9a5c38e3c67921b034a2394 (patch)
treeb79eb20bc7ed797e7624ccb5ceb8293ed429751e /crypto/src/asn1/ocsp/TBSRequest.cs
parentRefactor using MapElements (diff)
downloadBouncyCastle.NET-ed25519-dc8b86c13c769e6de9a5c38e3c67921b034a2394.tar.xz
Refactoring in Asn1
Diffstat (limited to 'crypto/src/asn1/ocsp/TBSRequest.cs')
-rw-r--r--crypto/src/asn1/ocsp/TBSRequest.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/src/asn1/ocsp/TBSRequest.cs b/crypto/src/asn1/ocsp/TBSRequest.cs
index fd5f153d7..8e3373f87 100644
--- a/crypto/src/asn1/ocsp/TBSRequest.cs
+++ b/crypto/src/asn1/ocsp/TBSRequest.cs
@@ -57,10 +57,8 @@ namespace Org.BouncyCastle.Asn1.Ocsp
             int index = 0;
 
 			Asn1Encodable enc = seq[0];
-			if (enc is Asn1TaggedObject)
+			if (enc is Asn1TaggedObject o)
             {
-                Asn1TaggedObject o = (Asn1TaggedObject) enc;
-
 				if (o.TagNo == 0)
                 {
 					versionSet = true;
@@ -77,9 +75,10 @@ namespace Org.BouncyCastle.Asn1.Ocsp
                 version = V1;
             }
 
-			if (seq[index] is Asn1TaggedObject)
+			if (seq[index] is Asn1TaggedObject taggedObject)
             {
-                requestorName = GeneralName.GetInstance((Asn1TaggedObject) seq[index++], true);
+                index++;
+                requestorName = GeneralName.GetInstance(taggedObject, true);
             }
 
 			requestList = (Asn1Sequence) seq[index++];