summary refs log tree commit diff
path: root/crypto/src/asn1/crmf/PopoSigningKey.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/crmf/PopoSigningKey.cs
parentRefactor using MapElements (diff)
downloadBouncyCastle.NET-ed25519-dc8b86c13c769e6de9a5c38e3c67921b034a2394.tar.xz
Refactoring in Asn1
Diffstat (limited to 'crypto/src/asn1/crmf/PopoSigningKey.cs')
-rw-r--r--crypto/src/asn1/crmf/PopoSigningKey.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/src/asn1/crmf/PopoSigningKey.cs b/crypto/src/asn1/crmf/PopoSigningKey.cs
index 93e14e30d..caa226b56 100644
--- a/crypto/src/asn1/crmf/PopoSigningKey.cs
+++ b/crypto/src/asn1/crmf/PopoSigningKey.cs
@@ -16,14 +16,13 @@ namespace Org.BouncyCastle.Asn1.Crmf
         {
             int index = 0;
 
-            if (seq[index] is Asn1TaggedObject)
+            if (seq[index] is Asn1TaggedObject tagObj)
             {
-                Asn1TaggedObject tagObj
-                    = (Asn1TaggedObject) seq[index++];
+                index++;
+
                 if (tagObj.TagNo != 0)
-                {
-                    throw new ArgumentException( "Unknown PopoSigningKeyInput tag: " + tagObj.TagNo, "seq");
-                }
+                    throw new ArgumentException( "Unknown PopoSigningKeyInput tag: " + tagObj.TagNo, nameof(seq));
+
                 poposkInput = PopoSigningKeyInput.GetInstance(tagObj.GetObject());
             }
             algorithmIdentifier = AlgorithmIdentifier.GetInstance(seq[index++]);