summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/asn1/Asn1OctetString.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/src/asn1/Asn1OctetString.cs b/crypto/src/asn1/Asn1OctetString.cs
index 9104c9ad3..d68d093e2 100644
--- a/crypto/src/asn1/Asn1OctetString.cs
+++ b/crypto/src/asn1/Asn1OctetString.cs
@@ -129,15 +129,10 @@ namespace Org.BouncyCastle.Asn1
 			return Arrays.GetHashCode(GetOctets());
         }
 
-		protected override bool Asn1Equals(
-			Asn1Object asn1Object)
+		protected override bool Asn1Equals(Asn1Object asn1Object)
 		{
-			DerOctetString other = asn1Object as DerOctetString;
-
-			if (other == null)
-				return false;
-
-			return Arrays.AreEqual(GetOctets(), other.GetOctets());
+            return asn1Object is Asn1OctetString that
+                && Arrays.AreEqual(this.GetOctets(), that.GetOctets());
 		}
 
 		public override string ToString()