From dc8b86c13c769e6de9a5c38e3c67921b034a2394 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 14 Jul 2023 15:07:49 +0700 Subject: Refactoring in Asn1 --- crypto/src/asn1/crmf/PopoSigningKeyInput.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'crypto/src/asn1/crmf/PopoSigningKeyInput.cs') diff --git a/crypto/src/asn1/crmf/PopoSigningKeyInput.cs b/crypto/src/asn1/crmf/PopoSigningKeyInput.cs index 30d017475..f2517aa57 100644 --- a/crypto/src/asn1/crmf/PopoSigningKeyInput.cs +++ b/crypto/src/asn1/crmf/PopoSigningKeyInput.cs @@ -16,13 +16,11 @@ namespace Org.BouncyCastle.Asn1.Crmf { Asn1Encodable authInfo = (Asn1Encodable)seq[0]; - if (authInfo is Asn1TaggedObject) + if (authInfo is Asn1TaggedObject tagObj) { - Asn1TaggedObject tagObj = (Asn1TaggedObject)authInfo; if (tagObj.TagNo != 0) - { - throw new ArgumentException("Unknown authInfo tag: " + tagObj.TagNo, "seq"); - } + throw new ArgumentException("Unknown authInfo tag: " + tagObj.TagNo, nameof(seq)); + sender = GeneralName.GetInstance(tagObj.GetObject()); } else -- cgit 1.4.1