diff --git a/src/libraries/System.IO.Pipes/Directory.Build.props b/src/libraries/System.IO.Pipes/Directory.Build.props index d68d22c1b917f..ce244cbea5619 100644 --- a/src/libraries/System.IO.Pipes/Directory.Build.props +++ b/src/libraries/System.IO.Pipes/Directory.Build.props @@ -3,5 +3,6 @@ Microsoft true + browser \ No newline at end of file diff --git a/src/libraries/System.Net.Http/Directory.Build.props b/src/libraries/System.Net.Http/Directory.Build.props index 63f02a0f817ef..d68d22c1b917f 100644 --- a/src/libraries/System.Net.Http/Directory.Build.props +++ b/src/libraries/System.Net.Http/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file diff --git a/src/libraries/System.Net.Http/ref/System.Net.Http.cs b/src/libraries/System.Net.Http/ref/System.Net.Http.cs index 7469866690c8c..72bffc4dbf9b6 100644 --- a/src/libraries/System.Net.Http/ref/System.Net.Http.cs +++ b/src/libraries/System.Net.Http/ref/System.Net.Http.cs @@ -103,28 +103,44 @@ public partial class HttpClientHandler : System.Net.Http.HttpMessageHandler { public HttpClientHandler() { } public bool AllowAutoRedirect { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.DecompressionMethods AutomaticDecompression { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool CheckCertificateRevocationList { get { throw null; } set { } } public System.Net.Http.ClientCertificateOption ClientCertificateOptions { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.CookieContainer CookieContainer { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.ICredentials? Credentials { get { throw null; } set { } } public static System.Func DangerousAcceptAnyServerCertificateValidator { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.ICredentials? DefaultProxyCredentials { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public int MaxAutomaticRedirections { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public int MaxConnectionsPerServer { get { throw null; } set { } } public long MaxRequestContentBufferSize { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public int MaxResponseHeadersLength { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool PreAuthenticate { get { throw null; } set { } } public System.Collections.Generic.IDictionary Properties { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.IWebProxy? Proxy { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Func? ServerCertificateCustomValidationCallback { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Security.Authentication.SslProtocols SslProtocols { get { throw null; } set { } } public virtual bool SupportsAutomaticDecompression { get { throw null; } } public virtual bool SupportsProxy { get { throw null; } } public virtual bool SupportsRedirectConfiguration { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool UseCookies { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool UseDefaultCredentials { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool UseProxy { get { throw null; } set { } } protected override void Dispose(bool disposing) { } protected internal override System.Net.Http.HttpResponseMessage Send(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) { throw null; } @@ -325,6 +341,7 @@ protected override void SerializeToStream(System.IO.Stream stream, System.Net.Tr protected override System.Threading.Tasks.Task SerializeToStreamAsync(System.IO.Stream stream, System.Net.TransportContext? context, System.Threading.CancellationToken cancellationToken) { throw null; } protected internal override bool TryComputeLength(out long length) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class SocketsHttpHandler : System.Net.Http.HttpMessageHandler { public SocketsHttpHandler() { } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs index 53224861b4764..4ad775603c682 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/BrowserHttpHandler/SocketsHttpHandler.cs @@ -4,12 +4,14 @@ using System.Collections.Generic; using System.IO; using System.Net.Security; +using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; using System.Diagnostics.CodeAnalysis; namespace System.Net.Http { + [UnsupportedOSPlatform("browser")] public sealed class SocketsHttpHandler : HttpMessageHandler { public static bool IsSupported => false; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs index 5540ba7f642cd..79102d0d0ae68 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs @@ -4,6 +4,7 @@ using System.Globalization; using System.Net.Security; using System.Collections.Generic; +using System.Runtime.Versioning; using System.Security.Authentication; using System.Security.Cryptography.X509Certificates; using System.Threading; @@ -52,12 +53,14 @@ protected override void Dispose(bool disposing) public virtual bool SupportsProxy => _underlyingHandler.SupportsProxy; public virtual bool SupportsRedirectConfiguration => _underlyingHandler.SupportsRedirectConfiguration; + [UnsupportedOSPlatform("browser")] public bool UseCookies { get => _underlyingHandler.UseCookies; set => _underlyingHandler.UseCookies = value; } + [UnsupportedOSPlatform("browser")] public CookieContainer CookieContainer { get => _underlyingHandler.CookieContainer; @@ -72,36 +75,42 @@ public CookieContainer CookieContainer } } + [UnsupportedOSPlatform("browser")] public DecompressionMethods AutomaticDecompression { get => _underlyingHandler.AutomaticDecompression; set => _underlyingHandler.AutomaticDecompression = value; } + [UnsupportedOSPlatform("browser")] public bool UseProxy { get => _underlyingHandler.UseProxy; set => _underlyingHandler.UseProxy = value; } + [UnsupportedOSPlatform("browser")] public IWebProxy? Proxy { get => _underlyingHandler.Proxy; set => _underlyingHandler.Proxy = value; } + [UnsupportedOSPlatform("browser")] public ICredentials? DefaultProxyCredentials { get => _underlyingHandler.DefaultProxyCredentials; set => _underlyingHandler.DefaultProxyCredentials = value; } + [UnsupportedOSPlatform("browser")] public bool PreAuthenticate { get => _underlyingHandler.PreAuthenticate; set => _underlyingHandler.PreAuthenticate = value; } + [UnsupportedOSPlatform("browser")] public bool UseDefaultCredentials { // SocketsHttpHandler doesn't have a separate UseDefaultCredentials property. There @@ -124,6 +133,7 @@ public bool UseDefaultCredentials } } + [UnsupportedOSPlatform("browser")] public ICredentials? Credentials { get => _underlyingHandler.Credentials; @@ -136,12 +146,14 @@ public bool AllowAutoRedirect set => _underlyingHandler.AllowAutoRedirect = value; } + [UnsupportedOSPlatform("browser")] public int MaxAutomaticRedirections { get => _underlyingHandler.MaxAutomaticRedirections; set => _underlyingHandler.MaxAutomaticRedirections = value; } + [UnsupportedOSPlatform("browser")] public int MaxConnectionsPerServer { get => _underlyingHandler.MaxConnectionsPerServer; @@ -181,6 +193,7 @@ public long MaxRequestContentBufferSize } } + [UnsupportedOSPlatform("browser")] public int MaxResponseHeadersLength { get => _underlyingHandler.MaxResponseHeadersLength; @@ -220,6 +233,7 @@ public ClientCertificateOption ClientCertificateOptions } } + [UnsupportedOSPlatform("browser")] public X509CertificateCollection ClientCertificates { get @@ -234,6 +248,7 @@ public X509CertificateCollection ClientCertificates } } + [UnsupportedOSPlatform("browser")] public Func? ServerCertificateCustomValidationCallback { #if TARGETS_BROWSER @@ -251,6 +266,7 @@ public X509CertificateCollection ClientCertificates #endif } + [UnsupportedOSPlatform("browser")] public bool CheckCertificateRevocationList { get => _underlyingHandler.SslOptions.CertificateRevocationCheckMode == X509RevocationMode.Online; @@ -261,6 +277,7 @@ public bool CheckCertificateRevocationList } } + [UnsupportedOSPlatform("browser")] public SslProtocols SslProtocols { get => _underlyingHandler.SslOptions.EnabledSslProtocols; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs index 12b8727872965..4acc47fdb6728 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.IO; using System.Net.Security; +using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; using System.Diagnostics.CodeAnalysis; @@ -12,6 +13,7 @@ namespace System.Net.Http { + [UnsupportedOSPlatform("browser")] public sealed class SocketsHttpHandler : HttpMessageHandler { private readonly HttpConnectionSettings _settings = new HttpConnectionSettings(); diff --git a/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs b/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs index 10e2e36f3cce0..23d851ad6323c 100644 --- a/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs +++ b/src/libraries/System.Net.HttpListener/ref/System.Net.HttpListener.cs @@ -13,7 +13,7 @@ public HttpListener() { } public System.Net.AuthenticationSchemes AuthenticationSchemes { get { throw null; } set { } } public System.Net.AuthenticationSchemeSelector? AuthenticationSchemeSelectorDelegate { get { throw null; } set { } } public System.Security.Authentication.ExtendedProtection.ServiceNameCollection DefaultServiceNames { get { throw null; } } - public System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy ExtendedProtectionPolicy { get { throw null; } set { } } + public System.Security.Authentication.ExtendedProtection.ExtendedProtectionPolicy ExtendedProtectionPolicy { get { throw null; } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] set { } } [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] public System.Net.HttpListener.ExtendedProtectionSelector? ExtendedProtectionSelectorDelegate { get { throw null; } set { } } public bool IgnoreWriteExceptions { get { throw null; } set { } } @@ -87,14 +87,17 @@ internal HttpListenerRequest() { } public string HttpMethod { get { throw null; } } public System.IO.Stream InputStream { get { throw null; } } public bool IsAuthenticated { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public bool IsLocal { get { throw null; } } public bool IsSecureConnection { get { throw null; } } public bool IsWebSocketRequest { get { throw null; } } public bool KeepAlive { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.IPEndPoint LocalEndPoint { get { throw null; } } public System.Version ProtocolVersion { get { throw null; } } public System.Collections.Specialized.NameValueCollection QueryString { get { throw null; } } public string? RawUrl { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public System.Net.IPEndPoint RemoteEndPoint { get { throw null; } } public System.Guid RequestTraceIdentifier { get { throw null; } } public string? ServiceName { get { throw null; } } @@ -102,6 +105,7 @@ internal HttpListenerRequest() { } public System.Uri? Url { get { throw null; } } public System.Uri? UrlReferrer { get { throw null; } } public string UserAgent { get { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public string UserHostAddress { get { throw null; } } public string UserHostName { get { throw null; } } public string[]? UserLanguages { get { throw null; } } @@ -125,11 +129,14 @@ internal HttpListenerResponse() { } public bool SendChunked { get { throw null; } set { } } public int StatusCode { get { throw null; } set { } } public string StatusDescription { get { throw null; } set { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public void Abort() { } public void AddHeader(string name, string value) { } public void AppendCookie(System.Net.Cookie cookie) { } public void AppendHeader(string name, string value) { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public void Close() { } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public void Close(byte[] responseEntity, bool willBlock) { } public void CopyFrom(System.Net.HttpListenerResponse templateResponse) { } public void Redirect(string url) { } diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/HttpListener.cs b/src/libraries/System.Net.HttpListener/src/System/Net/HttpListener.cs index b391474791591..d40826ba07710 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/HttpListener.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/HttpListener.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; +using System.Runtime.Versioning; using System.Security.Authentication.ExtendedProtection; using System.Text; using System.Threading.Tasks; @@ -81,6 +82,7 @@ public AuthenticationSchemes AuthenticationSchemes public ExtendedProtectionPolicy ExtendedProtectionPolicy { get => _extendedProtectionPolicy; + [UnsupportedOSPlatform("browser")] set { CheckDisposed(); diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs b/src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs index 2cd1587bd8adb..782192c7ee7e8 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/HttpListenerRequest.cs @@ -7,6 +7,7 @@ using System.Globalization; using System.Net.WebSockets; using System.Reflection; +using System.Runtime.Versioning; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; @@ -110,6 +111,7 @@ public Encoding ContentEncoding public string? ContentType => Headers[HttpKnownHeaderNames.ContentType]; + [UnsupportedOSPlatform("browser")] public bool IsLocal => LocalEndPoint!.Address.Equals(RemoteEndPoint!.Address); public bool IsWebSocketRequest @@ -206,6 +208,7 @@ public NameValueCollection QueryString public string UserAgent => Headers[HttpKnownHeaderNames.UserAgent]!; + [UnsupportedOSPlatform("browser")] public string UserHostAddress => LocalEndPoint!.ToString(); public string UserHostName => Headers[HttpKnownHeaderNames.Host]!; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs index d18b621d0f505..00569f57136be 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs @@ -34,6 +34,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; +using System.Runtime.Versioning; using System.Security.Authentication.ExtendedProtection; using System.Security.Cryptography.X509Certificates; using System.Text; @@ -373,8 +374,10 @@ public Stream InputStream public bool IsSecureConnection => _context.Connection.IsSecure; + [UnsupportedOSPlatform("browser")] public IPEndPoint? LocalEndPoint => _context.Connection.LocalEndPoint; + [UnsupportedOSPlatform("browser")] public IPEndPoint? RemoteEndPoint => _context.Connection.RemoteEndPoint; public Guid RequestTraceIdentifier { get; } = Guid.NewGuid(); diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerResponse.Managed.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerResponse.Managed.cs index 504c2ca9c9b7e..5f328cc53435d 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerResponse.Managed.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpListenerResponse.Managed.cs @@ -30,6 +30,7 @@ using System.Globalization; using System.IO; +using System.Runtime.Versioning; using System.Text; namespace System.Net @@ -92,6 +93,7 @@ public int StatusCode private void Dispose() => Close(true); + [UnsupportedOSPlatform("browser")] public void Close() { if (Disposed) @@ -100,6 +102,7 @@ public void Close() Close(false); } + [UnsupportedOSPlatform("browser")] public void Abort() { if (Disposed) @@ -114,6 +117,7 @@ private void Close(bool force) _httpContext!.Connection.Close(force); } + [UnsupportedOSPlatform("browser")] public void Close(byte[] responseEntity, bool willBlock) { CheckDisposed(); diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs index 5000795ba543c..2ed2812c00709 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequest.Windows.cs @@ -7,6 +7,7 @@ using System.IO; using System.Net.WebSockets; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security; using System.Security.Authentication.ExtendedProtection; using System.Security.Cryptography; @@ -288,6 +289,7 @@ public bool HasEntityBody } } + [UnsupportedOSPlatform("browser")] public IPEndPoint RemoteEndPoint { get @@ -301,6 +303,7 @@ public IPEndPoint RemoteEndPoint } } + [UnsupportedOSPlatform("browser")] public IPEndPoint LocalEndPoint { get diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerResponse.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerResponse.Windows.cs index 0c4b36af8efc7..40d72e8af468b 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerResponse.Windows.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerResponse.Windows.cs @@ -8,6 +8,7 @@ using System.Text; using System.ComponentModel; using System.Diagnostics; +using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; namespace System.Net @@ -95,6 +96,7 @@ public Version ProtocolVersion } } + [UnsupportedOSPlatform("browser")] public void Abort() { if (Disposed) @@ -106,6 +108,7 @@ public void Abort() HttpListenerContext.Abort(); } + [UnsupportedOSPlatform("browser")] public void Close() { try @@ -118,6 +121,7 @@ public void Close() } } + [UnsupportedOSPlatform("browser")] public void Close(byte[] responseEntity, bool willBlock) { CheckDisposed(); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/Directory.Build.props b/src/libraries/System.Security.Cryptography.Algorithms/Directory.Build.props index 63f02a0f817ef..d68d22c1b917f 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/Directory.Build.props +++ b/src/libraries/System.Security.Cryptography.Algorithms/Directory.Build.props @@ -2,5 +2,6 @@ Microsoft + true \ No newline at end of file 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 caa58cf6bc0b0..e5b2651a5d6be 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 @@ -6,12 +6,14 @@ namespace System.Security.Cryptography { + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class Aes : System.Security.Cryptography.SymmetricAlgorithm { protected Aes() { } public static new System.Security.Cryptography.Aes Create() { throw null; } public static new System.Security.Cryptography.Aes? Create(string algorithmName) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class AesCcm : System.IDisposable { public AesCcm(byte[] key) { } @@ -24,6 +26,7 @@ public void Dispose() { } public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[]? associatedData = null) { } public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class AesGcm : System.IDisposable { public AesGcm(byte[] key) { } @@ -37,6 +40,7 @@ public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] ta public void Encrypt(System.ReadOnlySpan nonce, System.ReadOnlySpan plaintext, System.Span ciphertext, System.Span tag, System.ReadOnlySpan associatedData = default(System.ReadOnlySpan)) { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class AesManaged : System.Security.Cryptography.Aes { public AesManaged() { } @@ -57,6 +61,7 @@ protected override void Dispose(bool disposing) { } public override void GenerateIV() { } public override void GenerateKey() { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class AsymmetricKeyExchangeDeformatter { protected AsymmetricKeyExchangeDeformatter() { } @@ -64,6 +69,7 @@ protected AsymmetricKeyExchangeDeformatter() { } public abstract byte[] DecryptKeyExchange(byte[] rgb); public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class AsymmetricKeyExchangeFormatter { protected AsymmetricKeyExchangeFormatter() { } @@ -72,6 +78,7 @@ protected AsymmetricKeyExchangeFormatter() { } public abstract byte[] CreateKeyExchange(byte[] data, System.Type? symAlgType); public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class AsymmetricSignatureDeformatter { protected AsymmetricSignatureDeformatter() { } @@ -80,6 +87,7 @@ protected AsymmetricSignatureDeformatter() { } public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature); public virtual bool VerifySignature(System.Security.Cryptography.HashAlgorithm hash, byte[] rgbSignature) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class AsymmetricSignatureFormatter { protected AsymmetricSignatureFormatter() { } @@ -88,6 +96,7 @@ protected AsymmetricSignatureFormatter() { } public abstract void SetHashAlgorithm(string strName); public abstract void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key); } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class CryptoConfig { public CryptoConfig() { } @@ -101,6 +110,7 @@ public static void AddOID(string oid, params string[] names) { } public static byte[] EncodeOID(string str) { throw null; } public static string? MapNameToOID(string name) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class DeriveBytes : System.IDisposable { protected DeriveBytes() { } @@ -110,6 +120,7 @@ protected virtual void Dispose(bool disposing) { } public abstract void Reset(); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class DES : System.Security.Cryptography.SymmetricAlgorithm { protected DES() { } @@ -119,6 +130,7 @@ protected DES() { } public static bool IsSemiWeakKey(byte[] rgbKey) { throw null; } public static bool IsWeakKey(byte[] rgbKey) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class DSA : System.Security.Cryptography.AsymmetricAlgorithm { protected DSA() { } @@ -189,6 +201,7 @@ public partial struct DSAParameters public byte[]? X; public byte[]? Y; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class DSASignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter { public DSASignatureDeformatter() { } @@ -202,6 +215,7 @@ public enum DSASignatureFormat IeeeP1363FixedFieldConcatenation = 0, Rfc3279DerSequence = 1, } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class DSASignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter { public DSASignatureFormatter() { } @@ -210,6 +224,7 @@ public DSASignatureFormatter(System.Security.Cryptography.AsymmetricAlgorithm ke public override void SetHashAlgorithm(string strName) { } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial struct ECCurve { private object _dummy; @@ -263,6 +278,7 @@ public static partial class NamedCurves public static System.Security.Cryptography.ECCurve nistP521 { get { throw null; } } } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class ECDiffieHellman : System.Security.Cryptography.AsymmetricAlgorithm { protected ECDiffieHellman() { } @@ -311,6 +327,7 @@ protected virtual void Dispose(bool disposing) { } public virtual byte[] ToByteArray() { throw null; } public virtual string ToXmlString() { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class ECDsa : System.Security.Cryptography.AsymmetricAlgorithm { protected ECDsa() { } @@ -377,6 +394,7 @@ public virtual void ImportParameters(System.Security.Cryptography.ECParameters p public bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } protected virtual bool VerifyHashCore(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.DSASignatureFormat signatureFormat) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial struct ECParameters { public System.Security.Cryptography.ECCurve Curve; @@ -389,6 +407,7 @@ public partial struct ECPoint public byte[]? X; public byte[]? Y; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public static partial class HKDF { public static byte[] DeriveKey(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, int outputLength, byte[]? salt = null, byte[]? info = null) { throw null; } @@ -398,6 +417,7 @@ public static void Expand(System.Security.Cryptography.HashAlgorithmName hashAlg public static byte[] Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, byte[] ikm, byte[]? salt = null) { throw null; } public static int Extract(System.Security.Cryptography.HashAlgorithmName hashAlgorithmName, System.ReadOnlySpan ikm, System.ReadOnlySpan salt, System.Span prk) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class HMACMD5 : System.Security.Cryptography.HMAC { public HMACMD5() { } @@ -410,6 +430,7 @@ protected override void HashCore(System.ReadOnlySpan source) { } public override void Initialize() { } protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class HMACSHA1 : System.Security.Cryptography.HMAC { public HMACSHA1() { } @@ -424,6 +445,7 @@ protected override void HashCore(System.ReadOnlySpan source) { } public override void Initialize() { } protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class HMACSHA256 : System.Security.Cryptography.HMAC { public HMACSHA256() { } @@ -436,6 +458,7 @@ protected override void HashCore(System.ReadOnlySpan source) { } public override void Initialize() { } protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class HMACSHA384 : System.Security.Cryptography.HMAC { public HMACSHA384() { } @@ -449,6 +472,7 @@ protected override void HashCore(System.ReadOnlySpan source) { } public override void Initialize() { } protected override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class HMACSHA512 : System.Security.Cryptography.HMAC { public HMACSHA512() { } @@ -471,7 +495,9 @@ public void AppendData(byte[] data) { } public void AppendData(byte[] data, int offset, int count) { } public void AppendData(System.ReadOnlySpan data) { } public static System.Security.Cryptography.IncrementalHash CreateHash(System.Security.Cryptography.HashAlgorithmName hashAlgorithm) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, byte[] key) { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public static System.Security.Cryptography.IncrementalHash CreateHMAC(System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.ReadOnlySpan key) { throw null; } public void Dispose() { } public byte[] GetCurrentHash() { throw null; } @@ -481,11 +507,13 @@ public void Dispose() { } public bool TryGetCurrentHash(System.Span destination, out int bytesWritten) { throw null; } public bool TryGetHashAndReset(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class MaskGenerationMethod { protected MaskGenerationMethod() { } public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn); } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class MD5 : System.Security.Cryptography.HashAlgorithm { protected MD5() { } @@ -496,6 +524,7 @@ protected MD5() { } public static int HashData(System.ReadOnlySpan source, System.Span destination) { throw null; } public static bool TryHashData(System.ReadOnlySpan source, System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class PKCS1MaskGenerationMethod : System.Security.Cryptography.MaskGenerationMethod { public PKCS1MaskGenerationMethod() { } @@ -506,6 +535,7 @@ public abstract partial class RandomNumberGenerator : System.IDisposable { protected RandomNumberGenerator() { } public static System.Security.Cryptography.RandomNumberGenerator Create() { throw null; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public static System.Security.Cryptography.RandomNumberGenerator? Create(string rngName) { throw null; } public void Dispose() { } protected virtual void Dispose(bool disposing) { } @@ -519,6 +549,7 @@ public virtual void GetNonZeroBytes(byte[] data) { } public virtual void GetNonZeroBytes(System.Span data) { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class RC2 : System.Security.Cryptography.SymmetricAlgorithm { protected int EffectiveKeySizeValue; @@ -528,6 +559,7 @@ protected RC2() { } public static new System.Security.Cryptography.RC2 Create() { throw null; } public static new System.Security.Cryptography.RC2? Create(string AlgName) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class Rfc2898DeriveBytes : System.Security.Cryptography.DeriveBytes { public Rfc2898DeriveBytes(byte[] password, byte[] salt, int iterations) { } @@ -547,6 +579,7 @@ protected override void Dispose(bool disposing) { } public override void Reset() { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class Rijndael : System.Security.Cryptography.SymmetricAlgorithm { protected Rijndael() { } @@ -554,6 +587,7 @@ protected Rijndael() { } public static new System.Security.Cryptography.Rijndael? Create(string algName) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class RijndaelManaged : System.Security.Cryptography.Rijndael { public RijndaelManaged() { } @@ -572,6 +606,7 @@ protected override void Dispose(bool disposing) { } public override void GenerateIV() { } public override void GenerateKey() { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class RSA : System.Security.Cryptography.AsymmetricAlgorithm { protected RSA() { } @@ -624,6 +659,7 @@ public override void ImportFromPem(System.ReadOnlySpan input) { } public virtual bool VerifyHash(byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } public virtual bool VerifyHash(System.ReadOnlySpan hash, System.ReadOnlySpan signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class RSAEncryptionPadding : System.IEquatable { internal RSAEncryptionPadding() { } @@ -647,6 +683,7 @@ public enum RSAEncryptionPaddingMode Pkcs1 = 0, Oaep = 1, } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAOAEPKeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter { public RSAOAEPKeyExchangeDeformatter() { } @@ -655,6 +692,7 @@ public RSAOAEPKeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlgo public override byte[] DecryptKeyExchange(byte[] rgbData) { throw null; } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAOAEPKeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter { public RSAOAEPKeyExchangeFormatter() { } @@ -677,6 +715,7 @@ public partial struct RSAParameters public byte[]? P; public byte[]? Q; } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAPKCS1KeyExchangeDeformatter : System.Security.Cryptography.AsymmetricKeyExchangeDeformatter { public RSAPKCS1KeyExchangeDeformatter() { } @@ -686,6 +725,7 @@ public RSAPKCS1KeyExchangeDeformatter(System.Security.Cryptography.AsymmetricAlg public override byte[] DecryptKeyExchange(byte[] rgbIn) { throw null; } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAPKCS1KeyExchangeFormatter : System.Security.Cryptography.AsymmetricKeyExchangeFormatter { public RSAPKCS1KeyExchangeFormatter() { } @@ -696,6 +736,7 @@ public RSAPKCS1KeyExchangeFormatter(System.Security.Cryptography.AsymmetricAlgor public override byte[] CreateKeyExchange(byte[] rgbData, System.Type? symAlgType) { throw null; } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAPKCS1SignatureDeformatter : System.Security.Cryptography.AsymmetricSignatureDeformatter { public RSAPKCS1SignatureDeformatter() { } @@ -704,6 +745,7 @@ public override void SetHashAlgorithm(string strName) { } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } public override bool VerifySignature(byte[] rgbHash, byte[] rgbSignature) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class RSAPKCS1SignatureFormatter : System.Security.Cryptography.AsymmetricSignatureFormatter { public RSAPKCS1SignatureFormatter() { } @@ -712,6 +754,7 @@ public RSAPKCS1SignatureFormatter(System.Security.Cryptography.AsymmetricAlgorit public override void SetHashAlgorithm(string strName) { } public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key) { } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public sealed partial class RSASignaturePadding : System.IEquatable { internal RSASignaturePadding() { } @@ -814,6 +857,7 @@ protected sealed override void HashCore(System.ReadOnlySpan source) { } public sealed override void Initialize() { } protected sealed override bool TryHashFinal(System.Span destination, out int bytesWritten) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public partial class SignatureDescription { public SignatureDescription() { } @@ -826,6 +870,7 @@ public SignatureDescription(System.Security.SecurityElement el) { } public virtual System.Security.Cryptography.HashAlgorithm? CreateDigest() { throw null; } public virtual System.Security.Cryptography.AsymmetricSignatureFormatter CreateFormatter(System.Security.Cryptography.AsymmetricAlgorithm key) { throw null; } } + [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] public abstract partial class TripleDES : System.Security.Cryptography.SymmetricAlgorithm { protected TripleDES() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt b/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt index 4e34ea903904b..48bb26d7cd2c6 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/ExcludeApiList.PNSE.Browser.txt @@ -1,6 +1,5 @@ T:System.Security.Cryptography.RandomNumberGenerator T:System.Security.Cryptography.IncrementalHash -T:System.Security.Cryptography.MD5 T:System.Security.Cryptography.SHA1 T:System.Security.Cryptography.SHA256 T:System.Security.Cryptography.SHA384 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index 5fa08189319c7..d70d7393479bc 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -595,7 +595,6 @@ - diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs index d384b55b5dc0e..09a84f3b568fd 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Aes.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class Aes : SymmetricAlgorithm { protected Aes() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs index 385a7a2eaa1c4..1e1f32adc8746 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesCcm.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public sealed partial class AesCcm : IDisposable { public static KeySizes NonceByteSizes { get; } = new KeySizes(7, 13, 1); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs index e870cd58841c0..07bbb6daa0eb3 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesGcm.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public sealed partial class AesGcm : IDisposable { private const int NonceSize = 12; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs index 21295fd4e3513..8501efa52a253 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesManaged.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; +using System.Runtime.Versioning; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] [EditorBrowsable(EditorBrowsableState.Never)] public sealed class AesManaged : Aes { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs index 21836c6d9ce24..5065ae0a7c5df 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class AsymmetricKeyExchangeDeformatter { protected AsymmetricKeyExchangeDeformatter() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs index 73750b20bfbce..8d883bc5aee80 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class AsymmetricKeyExchangeFormatter { protected AsymmetricKeyExchangeFormatter() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs index a5985c4a57eca..1783303ea8d52 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricSignatureDeformatter.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class AsymmetricSignatureDeformatter { protected AsymmetricSignatureDeformatter() { } 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 c2cec2146800d..95d0a92c763e3 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 @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class AsymmetricSignatureFormatter { protected AsymmetricSignatureFormatter() { } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs index a1aea6e932dd9..10ada27158268 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CryptoConfig.cs @@ -8,9 +8,11 @@ using System.Globalization; using System.Reflection; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class CryptoConfig { private const string AssemblyName_Cng = "System.Security.Cryptography.Cng"; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs index fef95f07764de..e9383f6ba4f5d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DES.cs @@ -1,12 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography; -using System.ComponentModel; using System.Buffers.Binary; +using System.ComponentModel; +using System.Runtime.Versioning; +using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] [EditorBrowsable(EditorBrowsableState.Never)] public abstract class DES : SymmetricAlgorithm { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs index a087087afd0f5..e4fccad9ec08d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSA.cs @@ -5,11 +5,13 @@ using System.Diagnostics; using System.Formats.Asn1; using System.IO; +using System.Runtime.Versioning; using System.Security.Cryptography.Asn1; using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract partial class DSA : AsymmetricAlgorithm { // As of FIPS 186-4 the maximum Q size is 256 bits (32 bytes). diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs index b42a93e04cf8d..b2fb1ee1da41b 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureDeformatter.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class DSASignatureDeformatter : AsymmetricSignatureDeformatter { private DSA? _dsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs index 7c5754834605d..f6f5bf3f4283a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DSASignatureFormatter.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class DSASignatureFormatter : AsymmetricSignatureFormatter { private DSA? _dsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs index a75a250f32ecf..f1036945dc5e8 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/DeriveBytes.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class DeriveBytes : IDisposable { public abstract byte[] GetBytes(int cb); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs index 201afacc0085a..11de2e1cfd62a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -13,6 +14,7 @@ namespace System.Security.Cryptography /// which is either a prime curve or a characteristic-2 curve. /// [DebuggerDisplay("ECCurve: {Oid}")] + [UnsupportedOSPlatform("browser")] public partial struct ECCurve { /// diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs index c3fc14eab67ae..de14abd8089bf 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDiffieHellman.cs @@ -2,14 +2,16 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Formats.Asn1; -using Internal.Cryptography; +using System.Runtime.Versioning; using System.Security.Cryptography.Asn1; +using Internal.Cryptography; namespace System.Security.Cryptography { /// /// Abstract base class for implementations of elliptic curve Diffie-Hellman to derive from /// + [UnsupportedOSPlatform("browser")] public abstract partial class ECDiffieHellman : AsymmetricAlgorithm { private static readonly string[] s_validOids = diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs index df537c5f34515..2ca1f5c288e2f 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECDsa.cs @@ -6,10 +6,12 @@ using System.Diagnostics; using System.Formats.Asn1; using System.IO; +using System.Runtime.Versioning; using System.Security.Cryptography.Asn1; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract partial class ECDsa : AsymmetricAlgorithm { // secp521r1 maxes out at 139 bytes in the DER format, so 256 should always be enough diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs index 9534a1e3f281a..5aec01dd373ec 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security.Cryptography.Asn1; namespace System.Security.Cryptography @@ -10,6 +11,7 @@ namespace System.Security.Cryptography /// /// Represents the public and private key of the specified elliptic curve. /// + [UnsupportedOSPlatform("browser")] public struct ECParameters { /// diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs index ecc10c635d810..0a6335c2ce623 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HKDF.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -13,6 +14,7 @@ namespace System.Security.Cryptography /// phase to be skipped, and the master key to be used directly as the pseudorandom key. /// See RFC5869 for more information. /// + [UnsupportedOSPlatform("browser")] public static class HKDF { /// diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.cs index 88ed7177d41df..e99f90d401970 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACMD5.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 Internal.Cryptography; namespace System.Security.Cryptography @@ -10,6 +11,7 @@ namespace System.Security.Cryptography // preexisting contract from the .NET Framework locks all of these into deriving directly from HMAC, it can't be helped. // + [UnsupportedOSPlatform("browser")] public class HMACMD5 : HMAC { public HMACMD5() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs index 21f62f2b213b5..756b49094c631 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA1.cs @@ -3,6 +3,7 @@ using Internal.Cryptography; using System.ComponentModel; +using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -11,6 +12,7 @@ namespace System.Security.Cryptography // preexisting contract from the .NET Framework locks all of these into deriving directly from HMAC, it can't be helped. // + [UnsupportedOSPlatform("browser")] public class HMACSHA1 : HMAC { public HMACSHA1() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs index b90d9d1937980..d65a3759038ab 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA256.cs @@ -3,8 +3,8 @@ using System; using System.Diagnostics; +using System.Runtime.Versioning; using System.Security.Cryptography; - using Internal.Cryptography; namespace System.Security.Cryptography @@ -14,6 +14,7 @@ namespace System.Security.Cryptography // preexisting contract from the .NET Framework locks all of these into deriving directly from HMAC, it can't be helped. // + [UnsupportedOSPlatform("browser")] public class HMACSHA256 : HMAC { public HMACSHA256() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs index 7ca4d75601efe..56bf4b81ad727 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA384.cs @@ -3,8 +3,8 @@ using System; using System.Diagnostics; +using System.Runtime.Versioning; using System.Security.Cryptography; - using Internal.Cryptography; namespace System.Security.Cryptography @@ -14,6 +14,7 @@ namespace System.Security.Cryptography // preexisting contract from the .NET Framework locks all of these into deriving directly from HMAC, it can't be helped. // + [UnsupportedOSPlatform("browser")] public class HMACSHA384 : HMAC { public HMACSHA384() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs index 0ad28bb0053a2..f03d31d21a75d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/HMACSHA512.cs @@ -3,8 +3,8 @@ using System; using System.Diagnostics; +using System.Runtime.Versioning; using System.Security.Cryptography; - using Internal.Cryptography; namespace System.Security.Cryptography @@ -14,6 +14,7 @@ namespace System.Security.Cryptography // preexisting contract from the .NET Framework locks all of these into deriving directly from HMAC, it can't be helped. // + [UnsupportedOSPlatform("browser")] public class HMACSHA512 : HMAC { public HMACSHA512() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs index acf433ef75b15..55d4ee2f8294d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.cs @@ -1,8 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System.Diagnostics; using Internal.Cryptography; +using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -346,6 +347,7 @@ public static IncrementalHash CreateHash(HashAlgorithmName hashAlgorithm) /// the empty string. /// /// is not a known hash algorithm. + [UnsupportedOSPlatform("browser")] public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, byte[] key) { if (key == null) @@ -376,6 +378,7 @@ public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, byte[] /// the empty string. /// /// is not a known hash algorithm. + [UnsupportedOSPlatform("browser")] public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, ReadOnlySpan key) { if (string.IsNullOrEmpty(hashAlgorithm.Name)) diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs index 09254f92e30f8..c9623eb1b4ec4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MD5.cs @@ -1,8 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography; using System.Diagnostics; +using System.Runtime.Versioning; +using Internal.Cryptography; namespace System.Security.Cryptography { @@ -12,6 +13,7 @@ namespace System.Security.Cryptography // it can't be helped. // + [UnsupportedOSPlatform("browser")] public abstract class MD5 : HashAlgorithm { private const int HashSizeBits = 128; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs index 701fb6c06a79d..d737a491fc692 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/MaskGenerationMethod.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract class MaskGenerationMethod { public abstract byte[] GenerateMask(byte[] rgbSeed, int cbReturn); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs index 4e24f7eae2cfc..376a039d7901e 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/PKCS1MaskGenerationMethod.cs @@ -3,10 +3,12 @@ using System.Buffers.Binary; using System.Diagnostics; +using System.Runtime.Versioning; using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private string _hashNameValue; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs index 0cf5acfcb897a..826836e7be695 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RC2.cs @@ -1,12 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography; using System.ComponentModel; +using System.Runtime.Versioning; +using Internal.Cryptography; namespace System.Security.Cryptography { [EditorBrowsable(EditorBrowsableState.Never)] + [UnsupportedOSPlatform("browser")] public abstract class RC2 : SymmetricAlgorithm { protected int EffectiveKeySizeValue; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs index 52b12eca81011..d488b01600321 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSA.cs @@ -5,11 +5,13 @@ using System.Formats.Asn1; using System.IO; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security.Cryptography.Asn1; using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public abstract partial class RSA : AsymmetricAlgorithm { public static new RSA? Create(string algName) diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs index a2b653383503b..3b796281f5090 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAEncryptionPadding.cs @@ -1,11 +1,14 @@ // 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; + namespace System.Security.Cryptography { /// /// Specifies the padding mode and parameters to use with RSA encryption or decryption operations. /// + [UnsupportedOSPlatform("browser")] public sealed class RSAEncryptionPadding : IEquatable { private static readonly RSAEncryptionPadding s_pkcs1 = new RSAEncryptionPadding(RSAEncryptionPaddingMode.Pkcs1, default(HashAlgorithmName)); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs index 152f85999b142..0c2b3ba17ddae 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAOAEPKeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA? _rsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs index e44ac9ef3129a..e6eceeaca7086 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAOAEPKeyExchangeFormatter : AsymmetricKeyExchangeFormatter { private byte[]? ParameterValue; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs index 0e65d54b28e7e..8270bcb7427dd 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAPKCS1KeyExchangeDeformatter : AsymmetricKeyExchangeDeformatter { private RSA? _rsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs index 4b40e7ffe855b..9251511ae1535 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeFormatter.cs @@ -1,8 +1,11 @@ // 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; + namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAPKCS1KeyExchangeFormatter : AsymmetricKeyExchangeFormatter { private RSA? _rsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs index da602de0da666..81feeca7e8977 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureDeformatter.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAPKCS1SignatureDeformatter : AsymmetricSignatureDeformatter { private RSA? _rsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs index 6f92c746b7873..dcd7139c2a5a8 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1SignatureFormatter.cs @@ -1,10 +1,12 @@ // 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 Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class RSAPKCS1SignatureFormatter : AsymmetricSignatureFormatter { private RSA? _rsaKey; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs index 53e70d92eac52..b69062b8f54cd 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSASignaturePadding.cs @@ -1,6 +1,8 @@ // 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; + namespace System.Security.Cryptography { // NOTE: This is *currently* 1:1 with the enum, but it exists to reserve room for more options @@ -10,6 +12,7 @@ namespace System.Security.Cryptography /// /// Specifies the padding mode and parameters to use with RSA signature creation or verification operations. /// + [UnsupportedOSPlatform("browser")] public sealed class RSASignaturePadding : IEquatable { private static readonly RSASignaturePadding s_pkcs1 = new RSASignaturePadding(RSASignaturePaddingMode.Pkcs1); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs index 758bf15b31a62..9aa0bc4e06873 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RandomNumberGenerator.cs @@ -3,6 +3,7 @@ using System.Buffers; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace System.Security.Cryptography { @@ -15,6 +16,7 @@ public static RandomNumberGenerator Create() return new RandomNumberGeneratorImplementation(); } + [UnsupportedOSPlatform("browser")] public static RandomNumberGenerator? Create(string rngName) { return (RandomNumberGenerator?)CryptoConfig.CreateFromName(rngName); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs index 8c833183f4cc6..395a42352f88c 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rfc2898DeriveBytes.cs @@ -5,12 +5,13 @@ using System.Buffers.Binary; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.Versioning; using System.Text; - using Internal.Cryptography; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class Rfc2898DeriveBytes : DeriveBytes { private const int MinimumSaltSize = 8; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs index 2c3d04658649b..74bf5f1d7d048 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/Rijndael.cs @@ -1,12 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using Internal.Cryptography; using System.ComponentModel; +using System.Runtime.Versioning; +using Internal.Cryptography; namespace System.Security.Cryptography { [EditorBrowsable(EditorBrowsableState.Never)] + [UnsupportedOSPlatform("browser")] public abstract class Rijndael : SymmetricAlgorithm { public static new Rijndael Create() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs index ed078f4823234..876d17503b9ef 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RijndaelManaged.cs @@ -3,10 +3,12 @@ using System.ComponentModel; using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography { [EditorBrowsable(EditorBrowsableState.Never)] + [UnsupportedOSPlatform("browser")] public sealed class RijndaelManaged : Rijndael { private readonly Aes _impl; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs index 3ac8e8cf67bcf..80ce519390924 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/SignatureDescription.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.Versioning; namespace System.Security.Cryptography { + [UnsupportedOSPlatform("browser")] public class SignatureDescription { public string? KeyAlgorithm { get; set; } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs index d5248c45f46c9..82589b6636fe5 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/TripleDES.cs @@ -2,12 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; - +using System.Runtime.Versioning; using Internal.Cryptography; namespace System.Security.Cryptography { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "We are providing the implementation for TripleDES, not consuming it.")] + [UnsupportedOSPlatform("browser")] public abstract class TripleDES : SymmetricAlgorithm { protected TripleDES() diff --git a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs b/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs index 398568f283889..bbd011a7612f1 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/tests/HashDerivedTests.cs @@ -36,6 +36,7 @@ public static void HashSize_SetForDerived_SHA512() } [Fact] + [SkipOnMono("Not supported on Browser")] public static void HashSize_SetForDerived_MD5() { using DerivedMD5 sha = new DerivedMD5();