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)