diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/ContentEncryptionAlgorithmTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/ContentEncryptionAlgorithmTests.cs
index 7842c0f7f40306..20a34d5d640a87 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/ContentEncryptionAlgorithmTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/ContentEncryptionAlgorithmTests.cs
@@ -12,7 +12,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests
public static partial class ContentEncryptionAlgorithmTests
{
public static bool SupportsRc2 => PlatformSupport.IsRC2Supported;
- public static bool SupportsRc4 => PlatformDetection.IsWindows;
+ public static bool SupportsRc4 => TargetFrameworkHelpers.TargetsWindows;
public static bool DoesNotSupportRc4 => !SupportsRc4;
[ConditionalFact(nameof(SupportsRc2))]
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/GeneralTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/GeneralTests.cs
index 2d4c1b8ac21931..0a3456d77a1227 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/GeneralTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/GeneralTests.cs
@@ -14,7 +14,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests
public static partial class GeneralTests
{
public static bool SupportsDiffieHellman { get; } = KeyAgreeRecipientInfoTests.SupportsDiffieHellman;
- public static bool SupportsRsaOaepCerts => PlatformDetection.IsWindows;
+ public static bool SupportsRsaOaepCerts => TargetFrameworkHelpers.TargetsWindows;
[Fact]
public static void DefaultEncryptionAlgorithm()
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyAgreeRecipientInfoTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyAgreeRecipientInfoTests.cs
index a929f1789f1a39..4e7c51b914fdc6 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyAgreeRecipientInfoTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyAgreeRecipientInfoTests.cs
@@ -15,7 +15,7 @@ public static partial class KeyAgreeRecipientInfoTests
internal static readonly AlgorithmIdentifier TripleDesAlgId =
new AlgorithmIdentifier(new Oid(Oids.TripleDesCbc, null));
- public static bool SupportsDiffieHellman => PlatformDetection.IsWindows;
+ public static bool SupportsDiffieHellman => TargetFrameworkHelpers.TargetsWindows;
public static bool DoesNotSupportDiffieHellman => !SupportsDiffieHellman;
[ConditionalFact(nameof(DoesNotSupportDiffieHellman))]
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaOaepCertTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaOaepCertTests.cs
index cac590c598da37..1af4b6e92a164f 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaOaepCertTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaOaepCertTests.cs
@@ -10,7 +10,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests
{
public static partial class KeyTransRecipientInfoRsaOaepCertTests
{
- public static bool SupportsRsaOaepCerts => PlatformDetection.IsWindows;
+ public static bool SupportsRsaOaepCerts => TargetFrameworkHelpers.TargetsWindows;
public static bool DoesNotSupportRsaOaepCerts => !SupportsRsaOaepCerts;
[ConditionalFact(nameof(SupportsRsaOaepCerts))]
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaPaddingModeTests.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaPaddingModeTests.cs
index 4bd3127958cc79..caf5d12ffc6963 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaPaddingModeTests.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/EnvelopedCms/KeyTransRecipientInfoRsaPaddingModeTests.cs
@@ -12,7 +12,7 @@ namespace System.Security.Cryptography.Pkcs.EnvelopedCmsTests.Tests
{
public static partial class KeyTransRecipientInfoRsaPaddingModeTests
{
- public static bool SupportsRsaOaepCerts => PlatformDetection.IsWindows;
+ public static bool SupportsRsaOaepCerts => TargetFrameworkHelpers.TargetsWindows;
[Theory]
[MemberData(nameof(TestKeyTransEncryptedKey_RsaAlgorithmTypes))]
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/System.Security.Cryptography.Pkcs.Tests.csproj b/src/libraries/System.Security.Cryptography.Pkcs/tests/System.Security.Cryptography.Pkcs.Tests.csproj
index a7e844895504ab..4525284f78b725 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/System.Security.Cryptography.Pkcs.Tests.csproj
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/System.Security.Cryptography.Pkcs.Tests.csproj
@@ -76,6 +76,12 @@
+
+
+
+
+
+
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.AnyOS.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.AnyOS.cs
new file mode 100644
index 00000000000000..64b71de0c1edb1
--- /dev/null
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.AnyOS.cs
@@ -0,0 +1,10 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Security.Cryptography.Pkcs.Tests
+{
+ internal class TargetFrameworkHelpers
+ {
+ internal static bool TargetsWindows => false;
+ }
+}
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.Windows.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.Windows.cs
new file mode 100644
index 00000000000000..050f9e00ff42d3
--- /dev/null
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/TargetFrameworkHelpers.Windows.cs
@@ -0,0 +1,10 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace System.Security.Cryptography.Pkcs.Tests
+{
+ internal class TargetFrameworkHelpers
+ {
+ internal static bool TargetsWindows => true;
+ }
+}