From bd81097fef0596b07fc5ee31ff459a4f90137863 Mon Sep 17 00:00:00 2001 From: JoshLozensky <103777376+JoshLozensky@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:35:24 -0700 Subject: [PATCH] Remove if that targets all supported .Net versions (#2673) --- src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs b/src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs index 7b3fa3ef05..11fe431374 100644 --- a/src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs +++ b/src/Microsoft.IdentityModel.Tokens/RsaSecurityKey.cs @@ -76,14 +76,7 @@ public override bool HasPrivateKey { // imitate signing byte[] hash = new byte[20]; -#if NET462 || NET472 || NETSTANDARD2_0 || NET6_0_OR_GREATER Rsa.SignData(hash, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); -#else - if (Rsa is RSACryptoServiceProvider rsaCryptoServiceProvider) - rsaCryptoServiceProvider.SignData(hash, SecurityAlgorithms.Sha256); - else - Rsa.DecryptValue(hash); -#endif _hasPrivateKey = true; } catch (CryptographicException)