Skip to content

Commit

Permalink
Mark System.Security.Cryptography.Algorithms as unsupported on Browse…
Browse files Browse the repository at this point in the history
…r WASM
  • Loading branch information
MaximLipnin committed Sep 9, 2020
1 parent d949f22 commit c38a6e2
Show file tree
Hide file tree
Showing 44 changed files with 127 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public abstract class Aes : SymmetricAlgorithm
{
protected Aes()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public sealed partial class AesCcm : IDisposable
{
public static KeySizes NonceByteSizes { get; } = new KeySizes(7, 13, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public sealed partial class AesGcm : IDisposable
{
private const int NonceSize = 12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// 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() { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// 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() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

using System.Diagnostics;
using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public abstract class AsymmetricSignatureDeformatter
{
protected AsymmetricSignatureDeformatter() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

using System.Diagnostics;
using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public abstract class AsymmetricSignatureFormatter
{
protected AsymmetricSignatureFormatter() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using Internal.Cryptography;
using System.ComponentModel;
using System.Buffers.Binary;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
[EditorBrowsable(EditorBrowsableState.Never)]
public abstract class DES : SymmetricAlgorithm
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
using System.IO;
using System.Security.Cryptography.Asn1;
using Internal.Cryptography;
using System.Runtime.Versioning;

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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public class DSASignatureDeformatter : AsymmetricSignatureDeformatter
{
private DSA? _dsaKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public class DSASignatureFormatter : AsymmetricSignatureFormatter
{
private DSA? _dsaKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -13,6 +14,7 @@ namespace System.Security.Cryptography
/// which is either a prime curve or a characteristic-2 curve.
/// </remarks>
[DebuggerDisplay("ECCurve: {Oid}")]
[UnsupportedOSPlatform("browser")]
public partial struct ECCurve
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
using System.Formats.Asn1;
using Internal.Cryptography;
using System.Security.Cryptography.Asn1;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
/// <summary>
/// Abstract base class for implementations of elliptic curve Diffie-Hellman to derive from
/// </summary>
[UnsupportedOSPlatform("browser")]
public abstract partial class ECDiffieHellman : AsymmetricAlgorithm
{
private static readonly string[] s_validOids =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
using System.Formats.Asn1;
using System.IO;
using System.Security.Cryptography.Asn1;
using System.Runtime.Versioning;

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
using System.Buffers;
using System.Runtime.InteropServices;
using System.Security.Cryptography.Asn1;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
/// <summary>
/// Represents the public and private key of the specified elliptic curve.
/// </summary>
[UnsupportedOSPlatform("browser")]
public struct ECParameters
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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 <a href="https://tools.ietf.org/html/rfc5869">RFC5869</a> for more information.
/// </remarks>
[UnsupportedOSPlatform("browser")]
public static class HKDF
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
//
// If you change anything in this class, you must make the same change in the other HMAC* classes. This is a pain but given that the
// 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

using Internal.Cryptography;
using System.ComponentModel;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
//
// If you change anything in this class, you must make the same change in the other HMAC* classes. This is a pain but given that the
// 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
using System;
using System.Diagnostics;
using System.Security.Cryptography;

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
//
// If you change anything in this class, you must make the same change in the other HMAC* classes. This is a pain but given that the
// 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
using System;
using System.Diagnostics;
using System.Security.Cryptography;

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
//
// If you change anything in this class, you must make the same change in the other HMAC* classes. This is a pain but given that the
// 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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
using System;
using System.Diagnostics;
using System.Security.Cryptography;

using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
//
// If you change anything in this class, you must make the same change in the other HMAC* classes. This is a pain but given that the
// 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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using System.Buffers.Binary;
using System.Diagnostics;
using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public class PKCS1MaskGenerationMethod : MaskGenerationMethod
{
private string _hashNameValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

using Internal.Cryptography;
using System.ComponentModel;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[EditorBrowsable(EditorBrowsableState.Never)]
[UnsupportedOSPlatform("browser")]
public abstract class RC2 : SymmetricAlgorithm
{
protected int EffectiveKeySizeValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
using System.Runtime.InteropServices;
using System.Security.Cryptography.Asn1;
using Internal.Cryptography;
using System.Runtime.Versioning;

namespace System.Security.Cryptography
{
[UnsupportedOSPlatform("browser")]
public abstract partial class RSA : AsymmetricAlgorithm
{
public static new RSA? Create(string algName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
// 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
{
/// <summary>
/// Specifies the padding mode and parameters to use with RSA encryption or decryption operations.
/// </summary>
[UnsupportedOSPlatform("browser")]
public sealed class RSAEncryptionPadding : IEquatable<RSAEncryptionPadding>
{
private static readonly RSAEncryptionPadding s_pkcs1 = new RSAEncryptionPadding(RSAEncryptionPaddingMode.Pkcs1, default(HashAlgorithmName));
Expand Down
Loading

0 comments on commit c38a6e2

Please sign in to comment.