From 43a86662045721c9b97b1ed8490ce16ef27048d5 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 14 May 2021 13:27:47 +0300 Subject: [PATCH] Annotate some APIs in System.Security,Cryptography.* as unsupported on iOS/tvOS --- .../ref/System.Security.Cryptography.Algorithms.cs | 2 ++ .../Security/Cryptography/AsymmetricSignatureFormatter.cs | 2 ++ .../ref/System.Security.Cryptography.Xml.cs | 2 ++ .../src/System/Security/Cryptography/Xml/DSAKeyValue.cs | 3 +++ 4 files changed, 9 insertions(+) diff --git a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs index f55f635e6b762..8eb8e3c7c835a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/ref/System.Security.Cryptography.Algorithms.cs @@ -96,6 +96,8 @@ public abstract partial class AsymmetricSignatureFormatter { protected AsymmetricSignatureFormatter() { } public abstract byte[] CreateSignature(byte[] rgbHash); + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public virtual byte[] CreateSignature(System.Security.Cryptography.HashAlgorithm hash) { throw null; } public abstract void SetHashAlgorithm(string strName); public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs index 95d0a92c763e3..a94c681811ef7 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureFormatter.cs @@ -15,6 +15,8 @@ protected AsymmetricSignatureFormatter() { } public abstract void SetKey(AsymmetricAlgorithm key); public abstract void SetHashAlgorithm(string strName); + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public virtual byte[] CreateSignature(HashAlgorithm hash) { if (hash == null) diff --git a/src/libraries/System.Security.Cryptography.Xml/ref/System.Security.Cryptography.Xml.cs b/src/libraries/System.Security.Cryptography.Xml/ref/System.Security.Cryptography.Xml.cs index b8b7593f96b8c..1ff8d1978041b 100644 --- a/src/libraries/System.Security.Cryptography.Xml/ref/System.Security.Cryptography.Xml.cs +++ b/src/libraries/System.Security.Cryptography.Xml/ref/System.Security.Cryptography.Xml.cs @@ -46,6 +46,8 @@ public partial class DSAKeyValue : System.Security.Cryptography.Xml.KeyInfoClaus public DSAKeyValue() { } public DSAKeyValue(System.Security.Cryptography.DSA key) { } public System.Security.Cryptography.DSA Key { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public override System.Xml.XmlElement GetXml() { throw null; } public override void LoadXml(System.Xml.XmlElement value) { } } diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSAKeyValue.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSAKeyValue.cs index e1c4d4a7c3cbe..6940172ae67ca 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSAKeyValue.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSAKeyValue.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; using System.Xml; #pragma warning disable CA5384 // Do Not Use Digital Signature Algorithm (DSA) @@ -48,6 +49,8 @@ public DSA Key /// /// An containing the XML representation. /// + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("tvos")] public override XmlElement GetXml() { XmlDocument xmlDocument = new XmlDocument();