Browse Source

Target .NET Standard 2.0

This retargets all data protection libraries to ns2.0. This means .NET
Framework applications will need to upgrade to .NET Framework 4.6.1.
This upgrade makes available API to .NET Core that was previously only
available on .NET Framework, such as encrypting keys at rest with
certificates.

New API for .NET Core users:
- IDataProtectionBuilder.ProtectKeysWithCertificate(string thumbprint)
- CertificateXmlEncryptor
- ICertificateResolver
- DataProtectionProvider
  - .Create(string applicationName, X509Certificate2 certificate)
  - .Create(DirectoryInfo keyDirectory, X509Certificate2 certificate)
  - .Create(DirectoryInfo keyDirectory, Action<IDataProtectionBuilder>
  setupAction, X509Certificate2 certificate

Other minor changes in this commit:
- Fixed samples that were using obsolete logging API
- Remove calls to api-sets, instead using kernel32. .NET Core 2.0 no
longer requires using api-sets as Nano Server now forwards kernel32
calls
- Made minor improvements to the TypeForwardingActivator
- Remove dead code an unused api baselines
- Enable more tests on macOS/Linux that previously only ran on Windows
Nate McMaster 8 years ago
parent
commit
b706a75e03
65 changed files with 481 additions and 4869 deletions
  1. 3 2
      DataProtection.sln
  2. 2 2
      build/common.props
  3. 2 2
      build/dependencies.props
  4. 0 2
      samples/AzureBlob/AzureBlob.csproj
  5. 2 2
      samples/AzureBlob/Program.cs
  6. 5 1
      samples/CustomEncryptorSample/CustomEncryptorSample.csproj
  7. 2 2
      samples/CustomEncryptorSample/Program.cs
  8. 5 1
      samples/KeyManagementSample/KeyManagementSample.csproj
  9. 5 1
      samples/NonDISample/NonDISample.csproj
  10. 3 3
      samples/Redis/Program.cs
  11. 5 1
      samples/Redis/Redis.csproj
  12. 1 9
      src/Microsoft.AspNetCore.Cryptography.Internal/CryptoUtil.cs
  13. 1 1
      src/Microsoft.AspNetCore.Cryptography.Internal/Microsoft.AspNetCore.Cryptography.Internal.csproj
  14. 0 30
      src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs
  15. 6 53
      src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SafeLibraryHandle.cs
  16. 0 8
      src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SecureLocalAllocHandle.cs
  17. 1 36
      src/Microsoft.AspNetCore.Cryptography.Internal/UnsafeBufferUtil.cs
  18. 2 25
      src/Microsoft.AspNetCore.Cryptography.Internal/UnsafeNativeMethods.cs
  19. 0 4
      src/Microsoft.AspNetCore.Cryptography.Internal/baseline.netframework.json
  20. 1 2
      src/Microsoft.AspNetCore.Cryptography.KeyDerivation/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj
  21. 0 78
      src/Microsoft.AspNetCore.Cryptography.KeyDerivation/baseline.net45.json
  22. 1 6
      src/Microsoft.AspNetCore.DataProtection.Abstractions/Microsoft.AspNetCore.DataProtection.Abstractions.csproj
  23. 0 231
      src/Microsoft.AspNetCore.DataProtection.Abstractions/baseline.net45.json
  24. 2 0
      src/Microsoft.AspNetCore.DataProtection.AzureStorage/AzureBlobXmlRepository.cs
  25. 4 3
      src/Microsoft.AspNetCore.DataProtection.AzureStorage/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj
  26. 3 0
      src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionAdvancedExtensions.cs
  27. 1 11
      src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionProvider.cs
  28. 4 2
      src/Microsoft.AspNetCore.DataProtection.Extensions/Microsoft.AspNetCore.DataProtection.Extensions.csproj
  29. 58 0
      src/Microsoft.AspNetCore.DataProtection.Extensions/baseline.netcore.json
  30. 0 298
      src/Microsoft.AspNetCore.DataProtection.Extensions/baseline.netframework.json
  31. 4 2
      src/Microsoft.AspNetCore.DataProtection.Redis/Microsoft.AspNetCore.DataProtection.Redis.csproj
  32. 4 2
      src/Microsoft.AspNetCore.DataProtection.SystemWeb/Microsoft.AspNetCore.DataProtection.SystemWeb.csproj
  33. 6 20
      src/Microsoft.AspNetCore.DataProtection/Cng/DpapiSecretSerializerHelper.cs
  34. 2 11
      src/Microsoft.AspNetCore.DataProtection/DataProtectionBuilderExtensions.cs
  35. 0 5
      src/Microsoft.AspNetCore.DataProtection/DataProtectionServiceCollectionExtensions.cs
  36. 0 28
      src/Microsoft.AspNetCore.DataProtection/IDataProtectionBuilder.cs
  37. 1 7
      src/Microsoft.AspNetCore.DataProtection/Managed/ManagedAuthenticatedEncryptor.cs
  38. 5 13
      src/Microsoft.AspNetCore.DataProtection/Microsoft.AspNetCore.DataProtection.csproj
  39. 21 21
      src/Microsoft.AspNetCore.DataProtection/Repositories/FileSystemXmlRepository.cs
  40. 3 8
      src/Microsoft.AspNetCore.DataProtection/TypeForwardingActivator.cs
  41. 14 8
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/CertificateResolver.cs
  42. 0 6
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/CertificateXmlEncryptor.cs
  43. 0 44
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.core50.cs
  44. 0 6
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.cs
  45. 0 6
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/ICertificateResolver.cs
  46. 0 6
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/IInternalCertificateXmlEncryptor.cs
  47. 0 6
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/IInternalEncryptedXmlDecryptor.cs
  48. 0 18
      src/Microsoft.AspNetCore.DataProtection/XmlEncryption/XmlEncryptionExtensions.cs
  49. 0 3749
      src/Microsoft.AspNetCore.DataProtection/baseline.net45.json
  50. 234 0
      src/Microsoft.AspNetCore.DataProtection/baseline.netcore.json
  51. 4 1
      test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj
  52. 4 1
      test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj
  53. 4 1
      test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj
  54. 4 1
      test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj
  55. 21 27
      test/Microsoft.AspNetCore.DataProtection.Extensions.Test/DataProtectionProviderTests.cs
  56. 4 1
      test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj
  57. 4 1
      test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj
  58. 2 2
      test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs
  59. 3 6
      test/Microsoft.AspNetCore.DataProtection.Test/Cng/CngAuthenticatedEncryptorBaseTests.cs
  60. 1 2
      test/Microsoft.AspNetCore.DataProtection.Test/Managed/ManagedAuthenticatedEncryptorTests.cs
  61. 4 5
      test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj
  62. 8 23
      test/Microsoft.AspNetCore.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs
  63. 4 9
      test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs
  64. 0 6
      test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/CertificateXmlEncryptionTests.cs
  65. 1 1
      test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs

+ 3 - 2
DataProtection.sln

@@ -1,7 +1,6 @@
-
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.26228.4
+VisualStudioVersion = 15.0.26504.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5FCB2DA3-5395-47F5-BCEE-E0EA319448EA}"
 EndProject
@@ -11,6 +10,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{5A3A
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E1D86B1B-41D8-43C9-97FD-C2BF65C414E2}"
 	ProjectSection(SolutionItems) = preProject
+		build\common.props = build\common.props
+		build\dependencies.props = build\dependencies.props
 		NuGet.config = NuGet.config
 	EndProjectSection
 EndProject

+ 2 - 2
build/common.props

@@ -16,8 +16,8 @@
     <PackageReference Include="Internal.AspNetCore.Sdk" Version="$(InternalAspNetCoreSdkVersion)" PrivateAssets="All" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework' AND '$(OutputType)'=='library'">
-    <PackageReference Include="NETStandard.Library" Version="$(BundledNETStandardPackageVersion)" />
+  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
+    <PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" PrivateAssets="All" />
   </ItemGroup>
 
 </Project>

+ 2 - 2
build/dependencies.props

@@ -1,10 +1,10 @@
 <Project>
   <PropertyGroup>
     <AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>
-    <CoreFxVersion>4.3.0</CoreFxVersion>
+    <CoreFxVersion>4.4.0-*</CoreFxVersion>
     <InternalAspNetCoreSdkVersion>2.1.0-*</InternalAspNetCoreSdkVersion>
     <MoqVersion>4.7.1</MoqVersion>
-    <NETStandardImplicitPackageVersion>$(BundledNETStandardPackageVersion)</NETStandardImplicitPackageVersion>
+    <NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
     <RedisVersion>1.2.3</RedisVersion>
     <TestSdkVersion>15.3.0-*</TestSdkVersion>
     <XunitVersion>2.3.0-beta2-*</XunitVersion>

+ 0 - 2
samples/AzureBlob/AzureBlob.csproj

@@ -4,8 +4,6 @@
 
   <PropertyGroup>
     <TargetFramework>netcoreapp2.0</TargetFramework>
-    <OutputType>Exe</OutputType>
-    <PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81</PackageTargetFallback>
   </PropertyGroup>
 
   <ItemGroup>

+ 2 - 2
samples/AzureBlob/Program.cs

@@ -31,8 +31,8 @@ namespace AzureBlob
                 .PersistKeysToAzureBlobStorage(container, "keys.xml");
 
             var services = serviceCollection.BuildServiceProvider();
-            var loggerFactory = services.GetService<ILoggerFactory>();
-            loggerFactory.AddConsole(Microsoft.Extensions.Logging.LogLevel.Trace);
+            var loggerFactory = services.GetService<LoggerFactory>();
+            loggerFactory.AddConsole();
 
             // Run a sample payload
 

+ 5 - 1
samples/CustomEncryptorSample/CustomEncryptorSample.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\dependencies.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
+    <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>
@@ -16,4 +16,8 @@
     <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(AspNetCoreVersion)" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
+    <PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
+  </ItemGroup>
+
 </Project>

+ 2 - 2
samples/CustomEncryptorSample/Program.cs

@@ -21,11 +21,11 @@ namespace CustomEncryptorSample
                 .UseXmlEncryptor(s => new CustomXmlEncryptor(s));
 
             var services = serviceCollection.BuildServiceProvider();
-            var loggerFactory = services.GetRequiredService<ILoggerFactory>();
+            var loggerFactory = services.GetRequiredService<LoggerFactory>();
             loggerFactory.AddConsole();
 
             var protector = services.GetDataProtector("SamplePurpose");
-            
+
             // protect the payload
             var protectedPayload = protector.Protect("Hello World!");
             Console.WriteLine($"Protect returned: {protectedPayload}");

+ 5 - 1
samples/KeyManagementSample/KeyManagementSample.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\dependencies.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
+    <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>
@@ -11,4 +11,8 @@
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Extensions\Microsoft.AspNetCore.DataProtection.Extensions.csproj" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
+    <PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
+  </ItemGroup>
+
 </Project>

+ 5 - 1
samples/NonDISample/NonDISample.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\dependencies.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
+    <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>
@@ -11,4 +11,8 @@
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Extensions\Microsoft.AspNetCore.DataProtection.Extensions.csproj" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
+    <PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
+  </ItemGroup>
+
 </Project>

+ 3 - 3
samples/Redis/Program.cs

@@ -23,8 +23,8 @@ namespace Redis
                 .PersistKeysToRedis(redis, "DataProtection-Keys");
 
             var services = serviceCollection.BuildServiceProvider();
-            var loggerFactory = services.GetService<ILoggerFactory>();
-            loggerFactory.AddConsole(LogLevel.Trace);
+            var loggerFactory = services.GetService<LoggerFactory>();
+            loggerFactory.AddConsole();
 
             // Run a sample payload
             var protector = services.GetDataProtector("sample-purpose");
@@ -32,4 +32,4 @@ namespace Redis
             Console.WriteLine(protectedData);
         }
     }
-}
+}

+ 5 - 1
samples/Redis/Redis.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\dependencies.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>
@@ -16,4 +16,8 @@
     <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(AspNetCoreVersion)" />
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
+    <PackageReference Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
+  </ItemGroup>
+
 </Project>

+ 1 - 9
src/Microsoft.AspNetCore.Cryptography.Internal/CryptoUtil.cs

@@ -4,15 +4,12 @@
 using System;
 using System.Diagnostics;
 using System.Runtime.CompilerServices;
+using System.Runtime.ConstrainedExecution;
 using System.Runtime.InteropServices;
 using System.Security.Cryptography;
 using Microsoft.AspNetCore.Cryptography.Cng;
 using Microsoft.AspNetCore.Cryptography.Internal;
 
-#if !NETSTANDARD1_3
-using System.Runtime.ConstrainedExecution;
-#endif
-
 namespace Microsoft.AspNetCore.Cryptography
 {
     internal unsafe static class CryptoUtil
@@ -73,12 +70,7 @@ namespace Microsoft.AspNetCore.Cryptography
         }
 
         [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
-#if NET46
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         public static bool TimeConstantBuffersAreEqual(byte* bufA, byte* bufB, uint count)
         {
             bool areEqual = true;

+ 1 - 1
src/Microsoft.AspNetCore.Cryptography.Internal/Microsoft.AspNetCore.Cryptography.Internal.csproj

@@ -4,7 +4,7 @@
 
   <PropertyGroup>
     <Description>Infrastructure for ASP.NET Core cryptographic packages. Applications and libraries should not reference this package directly.</Description>
-    <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>

+ 0 - 30
src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs

@@ -1,30 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-using System;
-using System.Runtime.InteropServices;
-
-#if NETSTANDARD1_3
-namespace Microsoft.Win32.SafeHandles
-{
-    internal abstract class SafeHandleZeroOrMinusOneIsInvalid : SafeHandle
-    {
-        // Called by P/Invoke when returning SafeHandles
-        protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle)
-            : base(IntPtr.Zero, ownsHandle)
-        {
-        }
-
-        public override bool IsInvalid
-        {
-            get
-            {
-                return (handle == IntPtr.Zero || handle == (IntPtr)(-1));
-            }
-        }
-    }
-}
-#elif NET46
-#else
-#error target frameworks need to be updated.
-#endif

+ 6 - 53
src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SafeLibraryHandle.cs

@@ -2,14 +2,11 @@
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
 using System;
+using System.Runtime.ConstrainedExecution;
 using System.Runtime.InteropServices;
 using System.Security;
 using Microsoft.Win32.SafeHandles;
 
-#if !NETSTANDARD1_3
-using System.Runtime.ConstrainedExecution;
-#endif
-
 namespace Microsoft.AspNetCore.Cryptography.SafeHandles
 {
     /// <summary>
@@ -127,31 +124,11 @@ namespace Microsoft.AspNetCore.Cryptography.SafeHandles
             return UnsafeNativeMethods.FreeLibrary(handle);
         }
 
-#if NET46
         [SuppressUnmanagedCodeSecurity]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         private static class UnsafeNativeMethods
         {
-#if NETSTANDARD1_3
-            private const string CORE_LIBRARY_LOADER_LIB = "api-ms-win-core-libraryloader-l1-1-0.dll";
-            private const string CORE_LOCALIZATION_LIB = "api-ms-win-core-localization-l1-2-0.dll";
-#elif NET46
-            private const string KERNEL32_LIB = "kernel32.dll";
-#else
-#error target frameworks need to be updated.
-#endif
-
             // http://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx
-#if NETSTANDARD1_3
-            [DllImport(CORE_LOCALIZATION_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
-#elif NET46
-            [DllImport(KERNEL32_LIB, EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
-#else
-#error target frameworks need to be updated.
-#endif
+            [DllImport("kernel32.dll", EntryPoint = "FormatMessageW", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, SetLastError = true)]
             public static extern int FormatMessage(
                 [In] uint dwFlags,
                 [In] SafeLibraryHandle lpSource,
@@ -164,50 +141,26 @@ namespace Microsoft.AspNetCore.Cryptography.SafeHandles
 
             // http://msdn.microsoft.com/en-us/library/ms683152(v=vs.85).aspx
             [return: MarshalAs(UnmanagedType.Bool)]
-#if NETSTANDARD1_3
-            [DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
-#elif NET46
             [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-            [DllImport(KERNEL32_LIB, CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
-#else
-#error target frameworks need to be updated.
-#endif
+            [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode)]
             internal static extern bool FreeLibrary(IntPtr hModule);
 
             // http://msdn.microsoft.com/en-us/library/ms683200(v=vs.85).aspx
             [return: MarshalAs(UnmanagedType.Bool)]
-#if NETSTANDARD1_3
-            [DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#elif NET46
-            [DllImport(KERNEL32_LIB, EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#else
-#error target frameworks need to be updated.
-#endif
+            [DllImport("kernel32.dll", EntryPoint = "GetModuleHandleExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
             internal static extern bool GetModuleHandleEx(
                 [In] uint dwFlags,
                 [In] SafeLibraryHandle lpModuleName, // can point to a location within the module if GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS is set
                 [Out] out IntPtr phModule);
 
             // http://msdn.microsoft.com/en-us/library/ms683212(v=vs.85).aspx
-#if NETSTANDARD1_3
-            [DllImport(CORE_LIBRARY_LOADER_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#elif NET46
-            [DllImport(KERNEL32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#else
-#error target frameworks need to be updated.
-#endif
+            [DllImport("kernel32.dll", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
             internal static extern IntPtr GetProcAddress(
                 [In] SafeLibraryHandle hModule,
                 [In, MarshalAs(UnmanagedType.LPStr)] string lpProcName);
 
             // http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx
-#if NETSTANDARD1_3
-            [DllImport(CORE_LIBRARY_LOADER_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#elif NET46
-            [DllImport(KERNEL32_LIB, EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
-#else
-#error target frameworks need to be updated.
-#endif
+            [DllImport("kernel32.dll", EntryPoint = "LoadLibraryExW", CallingConvention = CallingConvention.Winapi, SetLastError = true)]
             internal static extern SafeLibraryHandle LoadLibraryEx(
                 [In, MarshalAs(UnmanagedType.LPWStr)] string lpFileName,
                 [In] IntPtr hFile,

+ 0 - 8
src/Microsoft.AspNetCore.Cryptography.Internal/SafeHandles/SecureLocalAllocHandle.cs

@@ -3,10 +3,7 @@
 
 using System;
 using System.Runtime.InteropServices;
-
-#if !NETSTANDARD1_3
 using System.Runtime.ConstrainedExecution;
-#endif
 
 namespace Microsoft.AspNetCore.Cryptography.SafeHandles
 {
@@ -41,12 +38,7 @@ namespace Microsoft.AspNetCore.Cryptography.SafeHandles
             return newHandle;
         }
 
-#if NET46
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         private void AllocateImpl(IntPtr cb)
         {
             handle = Marshal.AllocHGlobal(cb); // actually calls LocalAlloc

+ 1 - 36
src/Microsoft.AspNetCore.Cryptography.Internal/UnsafeBufferUtil.cs

@@ -3,30 +3,23 @@
 
 using System;
 using System.Runtime.CompilerServices;
+using System.Runtime.ConstrainedExecution;
 using System.Threading;
 using Microsoft.AspNetCore.Cryptography.SafeHandles;
 
-#if !NETSTANDARD1_3
-using System.Runtime.ConstrainedExecution;
-#endif
-
 namespace Microsoft.AspNetCore.Cryptography
 {
     internal unsafe static class UnsafeBufferUtil
     {
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void BlockCopy(void* from, void* to, int byteCount)
         {
             BlockCopy(from, to, checked((uint)byteCount)); // will be checked before invoking the delegate
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void BlockCopy(void* from, void* to, uint byteCount)
         {
             if (byteCount != 0)
@@ -35,9 +28,7 @@ namespace Microsoft.AspNetCore.Cryptography
             }
         }
 
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-#endif
         public static void BlockCopy(LocalAllocHandle from, void* to, uint byteCount)
         {
             bool refAdded = false;
@@ -55,9 +46,7 @@ namespace Microsoft.AspNetCore.Cryptography
             }
         }
 
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-#endif
         public static void BlockCopy(void* from, LocalAllocHandle to, uint byteCount)
         {
             bool refAdded = false;
@@ -75,9 +64,7 @@ namespace Microsoft.AspNetCore.Cryptography
             }
         }
 
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-#endif
         public static void BlockCopy(LocalAllocHandle from, LocalAllocHandle to, IntPtr length)
         {
             if (length == IntPtr.Zero)
@@ -116,36 +103,20 @@ namespace Microsoft.AspNetCore.Cryptography
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static void BlockCopyCore(byte* from, byte* to, uint byteCount)
         {
-#if NETSTANDARD1_3
             Buffer.MemoryCopy(from, to, (ulong)byteCount, (ulong)byteCount);
-#else
-            while (byteCount-- != 0)
-            {
-                to[byteCount] = from[byteCount];
-            }
-#endif
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private static void BlockCopyCore(byte* from, byte* to, ulong byteCount)
         {
-#if NETSTANDARD1_3
             Buffer.MemoryCopy(from, to, byteCount, byteCount);
-#else
-            while (byteCount-- != 0)
-            {
-                to[byteCount] = from[byteCount];
-            }
-#endif
         }
 
         /// <summary>
         /// Securely clears a memory buffer.
         /// </summary>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void SecureZeroMemory(byte* buffer, int byteCount)
         {
             SecureZeroMemory(buffer, checked((uint)byteCount));
@@ -155,9 +126,7 @@ namespace Microsoft.AspNetCore.Cryptography
         /// Securely clears a memory buffer.
         /// </summary>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void SecureZeroMemory(byte* buffer, uint byteCount)
         {
             if (byteCount != 0)
@@ -176,9 +145,7 @@ namespace Microsoft.AspNetCore.Cryptography
         /// Securely clears a memory buffer.
         /// </summary>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void SecureZeroMemory(byte* buffer, ulong byteCount)
         {
             if (byteCount != 0)
@@ -196,9 +163,7 @@ namespace Microsoft.AspNetCore.Cryptography
         /// <summary>
         /// Securely clears a memory buffer.
         /// </summary>
-#if !NETSTANDARD1_3
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#endif
         public static void SecureZeroMemory(byte* buffer, IntPtr length)
         {
             if (sizeof(IntPtr) == 4)

+ 2 - 25
src/Microsoft.AspNetCore.Cryptography.Internal/UnsafeNativeMethods.cs

@@ -4,6 +4,7 @@
 using System;
 using System.Diagnostics;
 using System.Runtime.CompilerServices;
+using System.Runtime.ConstrainedExecution;
 using System.Runtime.InteropServices;
 using System.Security;
 using System.Security.Cryptography;
@@ -12,18 +13,9 @@ using Microsoft.AspNetCore.Cryptography.Cng;
 using Microsoft.AspNetCore.Cryptography.SafeHandles;
 using Microsoft.Win32.SafeHandles;
 
-#if NET46
-using System.Runtime.ConstrainedExecution;
-#endif
-
 namespace Microsoft.AspNetCore.Cryptography
 {
-#if NET46
     [SuppressUnmanagedCodeSecurity]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
     internal unsafe static class UnsafeNativeMethods
     {
         private const string BCRYPT_LIB = "bcrypt.dll";
@@ -90,23 +82,13 @@ namespace Microsoft.AspNetCore.Cryptography
             [In] uint dwFlags);
 
         [DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
-#if NET46
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         // http://msdn.microsoft.com/en-us/library/windows/desktop/aa375399(v=vs.85).aspx
         internal static extern int BCryptDestroyHash(
             [In] IntPtr hHash);
 
         [DllImport(BCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
-#if NET46
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         // http://msdn.microsoft.com/en-us/library/windows/desktop/aa375404(v=vs.85).aspx
         internal static extern int BCryptDestroyKey(
             [In] IntPtr hKey);
@@ -209,7 +191,7 @@ namespace Microsoft.AspNetCore.Cryptography
         /*
          * CRYPT32.DLL
          */
-         
+
         [DllImport(CRYPT32_LIB, CallingConvention = CallingConvention.Winapi, SetLastError = true)]
         // http://msdn.microsoft.com/en-us/library/windows/desktop/aa380261(v=vs.85).aspx
         internal static extern bool CryptProtectData(
@@ -258,12 +240,7 @@ namespace Microsoft.AspNetCore.Cryptography
          */
 
         [DllImport(NCRYPT_LIB, CallingConvention = CallingConvention.Winapi)]
-#if NET46
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         // http://msdn.microsoft.com/en-us/library/windows/desktop/hh706799(v=vs.85).aspx
         internal static extern int NCryptCloseProtectionDescriptor(
             [In] IntPtr hDescriptor);

+ 0 - 4
src/Microsoft.AspNetCore.Cryptography.Internal/baseline.netframework.json

@@ -1,4 +0,0 @@
-{
-  "AssemblyIdentity": "Microsoft.AspNetCore.Cryptography.Internal, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
-  "Types": []
-}

+ 1 - 2
src/Microsoft.AspNetCore.Cryptography.KeyDerivation/Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj

@@ -4,8 +4,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core utilities for key derivation.</Description>
-    <TargetFramework>netstandard1.3</TargetFramework>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection</PackageTags>

+ 0 - 78
src/Microsoft.AspNetCore.Cryptography.KeyDerivation/baseline.net45.json

@@ -1,78 +0,0 @@
-{
-  "AssemblyIdentity": "Microsoft.AspNetCore.Cryptography.KeyDerivation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
-  "Types": [
-    {
-      "Name": "Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivation",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Pbkdf2",
-          "Parameters": [
-            {
-              "Name": "password",
-              "Type": "System.String"
-            },
-            {
-              "Name": "salt",
-              "Type": "System.Byte[]"
-            },
-            {
-              "Name": "prf",
-              "Type": "Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf"
-            },
-            {
-              "Name": "iterationCount",
-              "Type": "System.Int32"
-            },
-            {
-              "Name": "numBytesRequested",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.Cryptography.KeyDerivation.KeyDerivationPrf",
-      "Visibility": "Public",
-      "Kind": "Enumeration",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Field",
-          "Name": "HMACSHA1",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "0"
-        },
-        {
-          "Kind": "Field",
-          "Name": "HMACSHA256",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "1"
-        },
-        {
-          "Kind": "Field",
-          "Name": "HMACSHA512",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "2"
-        }
-      ],
-      "GenericParameters": []
-    }
-  ]
-}

+ 1 - 6
src/Microsoft.AspNetCore.DataProtection.Abstractions/Microsoft.AspNetCore.DataProtection.Abstractions.csproj

@@ -7,8 +7,7 @@
 Commonly used types:
 Microsoft.AspNetCore.DataProtection.IDataProtectionProvider
 Microsoft.AspNetCore.DataProtection.IDataProtector</Description>
-    <TargetFramework>netstandard1.3</TargetFramework>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection</PackageTags>
   </PropertyGroup>
@@ -21,8 +20,4 @@ Microsoft.AspNetCore.DataProtection.IDataProtector</Description>
     <PackageReference Include="Microsoft.Extensions.WebEncoders.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All"/>
   </ItemGroup>
 
-  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
-    <PackageReference Include="System.ComponentModel" Version="$(CoreFxVersion)" />
-  </ItemGroup>
-
 </Project>

+ 0 - 231
src/Microsoft.AspNetCore.DataProtection.Abstractions/baseline.net45.json

@@ -1,231 +0,0 @@
-{
-  "AssemblyIdentity": "Microsoft.AspNetCore.DataProtection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
-  "Types": [
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionCommonExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateProtector",
-          "Parameters": [
-            {
-              "Name": "provider",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider"
-            },
-            {
-              "Name": "purposes",
-              "Type": "System.Collections.Generic.IEnumerable<System.String>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateProtector",
-          "Parameters": [
-            {
-              "Name": "provider",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider"
-            },
-            {
-              "Name": "purpose",
-              "Type": "System.String"
-            },
-            {
-              "Name": "subPurposes",
-              "Type": "System.String[]",
-              "IsParams": true
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetDataProtectionProvider",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetDataProtector",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            },
-            {
-              "Name": "purposes",
-              "Type": "System.Collections.Generic.IEnumerable<System.String>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetDataProtector",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            },
-            {
-              "Name": "purpose",
-              "Type": "System.String"
-            },
-            {
-              "Name": "subPurposes",
-              "Type": "System.String[]",
-              "IsParams": true
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtector"
-            },
-            {
-              "Name": "plaintext",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Unprotect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtector"
-            },
-            {
-              "Name": "protectedData",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateProtector",
-          "Parameters": [
-            {
-              "Name": "purpose",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "plaintext",
-              "Type": "System.Byte[]"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Unprotect",
-          "Parameters": [
-            {
-              "Name": "protectedData",
-              "Type": "System.Byte[]"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Infrastructure.IApplicationDiscriminator",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Discriminator",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    }
-  ]
-}

+ 2 - 0
src/Microsoft.AspNetCore.DataProtection.AzureStorage/AzureBlobXmlRepository.cs

@@ -51,6 +51,7 @@ namespace Microsoft.AspNetCore.DataProtection.AzureStorage
             _random = new Random();
         }
 
+        /// <inheritdoc />
         public IReadOnlyCollection<XElement> GetAllElements()
         {
             var blobRef = CreateFreshBlobRef();
@@ -62,6 +63,7 @@ namespace Microsoft.AspNetCore.DataProtection.AzureStorage
             return new ReadOnlyCollection<XElement>(elements);
         }
 
+        /// <inheritdoc />
         public void StoreElement(XElement element, string friendlyName)
         {
             if (element == null)

+ 4 - 3
src/Microsoft.AspNetCore.DataProtection.AzureStorage/Microsoft.AspNetCore.DataProtection.AzureStorage.csproj

@@ -4,9 +4,7 @@
 
   <PropertyGroup>
     <Description>Microsoft Azure Blob storrage support as key store.</Description>
-    <VersionPrefix>2.0.0</VersionPrefix>
-    <TargetFrameworks>net46;netstandard1.5</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection;azure;blob</PackageTags>
@@ -14,6 +12,9 @@
 
   <ItemGroup>
     <ProjectReference Include="..\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="WindowsAzure.Storage" Version="$(WindowsAzureStorageVersion)" />
   </ItemGroup>
 

+ 3 - 0
src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionAdvancedExtensions.cs

@@ -5,6 +5,9 @@ using System;
 
 namespace Microsoft.AspNetCore.DataProtection
 {
+    /// <summary>
+    /// Helpful extension methods for data protection APIs.
+    /// </summary>
     public static class DataProtectionAdvancedExtensions
     {
         /// <summary>

+ 1 - 11
src/Microsoft.AspNetCore.DataProtection.Extensions/DataProtectionProvider.cs

@@ -73,7 +73,6 @@ namespace Microsoft.AspNetCore.DataProtection
             return CreateProvider(keyDirectory, setupAction, certificate: null);
         }
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
         /// <summary>
         /// Creates a <see cref="DataProtectionProvider"/> that store keys in a location based on
         /// the platform and operating system and uses the given <see cref="X509Certificate2"/> to encrypt the keys.
@@ -150,10 +149,6 @@ namespace Microsoft.AspNetCore.DataProtection
 
             return CreateProvider(keyDirectory, setupAction, certificate);
         }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
 
         private static IDataProtectionProvider CreateProvider(
             DirectoryInfo keyDirectory,
@@ -169,15 +164,10 @@ namespace Microsoft.AspNetCore.DataProtection
                 builder.PersistKeysToFileSystem(keyDirectory);
             }
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
             if (certificate != null)
             {
                 builder.ProtectKeysWithCertificate(certificate);
             }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
 
             setupAction(builder);
 
@@ -185,4 +175,4 @@ namespace Microsoft.AspNetCore.DataProtection
             return serviceCollection.BuildServiceProvider().GetRequiredService<IDataProtectionProvider>();
         }
     }
-}
+}

+ 4 - 2
src/Microsoft.AspNetCore.DataProtection.Extensions/Microsoft.AspNetCore.DataProtection.Extensions.csproj

@@ -4,8 +4,7 @@
 
   <PropertyGroup>
     <Description>Additional APIs for ASP.NET Core data protection.</Description>
-    <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection</PackageTags>
   </PropertyGroup>
@@ -16,6 +15,9 @@
 
   <ItemGroup>
     <ProjectReference Include="..\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
   </ItemGroup>
 

+ 58 - 0
src/Microsoft.AspNetCore.DataProtection.Extensions/baseline.netcore.json

@@ -175,6 +175,64 @@
           "Static": true,
           "Visibility": "Public",
           "GenericParameter": []
+        },
+        {
+          "Kind": "Method",
+          "Name": "Create",
+          "Parameters": [
+            {
+              "Name": "applicationName",
+              "Type": "System.String"
+            },
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
+          "Static": true,
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Method",
+          "Name": "Create",
+          "Parameters": [
+            {
+              "Name": "keyDirectory",
+              "Type": "System.IO.DirectoryInfo"
+            },
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
+          "Static": true,
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Method",
+          "Name": "Create",
+          "Parameters": [
+            {
+              "Name": "keyDirectory",
+              "Type": "System.IO.DirectoryInfo"
+            },
+            {
+              "Name": "setupAction",
+              "Type": "System.Action<Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder>"
+            },
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
+          "Static": true,
+          "Visibility": "Public",
+          "GenericParameter": []
         }
       ],
       "GenericParameters": []

+ 0 - 298
src/Microsoft.AspNetCore.DataProtection.Extensions/baseline.netframework.json

@@ -1,298 +0,0 @@
-{
-  "AssemblyIdentity": "Microsoft.AspNetCore.DataProtection.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
-  "Types": [
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionAdvancedExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector"
-            },
-            {
-              "Name": "plaintext",
-              "Type": "System.Byte[]"
-            },
-            {
-              "Name": "lifetime",
-              "Type": "System.TimeSpan"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector"
-            },
-            {
-              "Name": "plaintext",
-              "Type": "System.String"
-            },
-            {
-              "Name": "expiration",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector"
-            },
-            {
-              "Name": "plaintext",
-              "Type": "System.String"
-            },
-            {
-              "Name": "lifetime",
-              "Type": "System.TimeSpan"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ToTimeLimitedDataProtector",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtector"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Unprotect",
-          "Parameters": [
-            {
-              "Name": "protector",
-              "Type": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector"
-            },
-            {
-              "Name": "protectedData",
-              "Type": "System.String"
-            },
-            {
-              "Name": "expiration",
-              "Type": "System.DateTimeOffset",
-              "Direction": "Out"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionProvider",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "applicationName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "keyDirectory",
-              "Type": "System.IO.DirectoryInfo"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "keyDirectory",
-              "Type": "System.IO.DirectoryInfo"
-            },
-            {
-              "Name": "setupAction",
-              "Type": "System.Action<Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "applicationName",
-              "Type": "System.String"
-            },
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "keyDirectory",
-              "Type": "System.IO.DirectoryInfo"
-            },
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Create",
-          "Parameters": [
-            {
-              "Name": "keyDirectory",
-              "Type": "System.IO.DirectoryInfo"
-            },
-            {
-              "Name": "setupAction",
-              "Type": "System.Action<Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder>"
-            },
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.IDataProtector"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateProtector",
-          "Parameters": [
-            {
-              "Name": "purpose",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Protect",
-          "Parameters": [
-            {
-              "Name": "plaintext",
-              "Type": "System.Byte[]"
-            },
-            {
-              "Name": "expiration",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Unprotect",
-          "Parameters": [
-            {
-              "Name": "protectedData",
-              "Type": "System.Byte[]"
-            },
-            {
-              "Name": "expiration",
-              "Type": "System.DateTimeOffset",
-              "Direction": "Out"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    }
-  ]
-}

+ 4 - 2
src/Microsoft.AspNetCore.DataProtection.Redis/Microsoft.AspNetCore.DataProtection.Redis.csproj

@@ -5,8 +5,7 @@
   <PropertyGroup>
     <Description>Redis storage support as key store.</Description>
     <VersionPrefix>0.3.0</VersionPrefix>
-    <TargetFrameworks>net46;netstandard1.5</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS1591</NoWarn>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnetcore;dataprotection;redis</PackageTags>
@@ -14,6 +13,9 @@
 
   <ItemGroup>
     <ProjectReference Include="..\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="StackExchange.Redis.StrongName" Version="$(RedisVersion)" />
   </ItemGroup>
 

+ 4 - 2
src/Microsoft.AspNetCore.DataProtection.SystemWeb/Microsoft.AspNetCore.DataProtection.SystemWeb.csproj

@@ -4,7 +4,7 @@
 
   <PropertyGroup>
     <Description>A component to allow the ASP.NET Core data protection stack to work with the ASP.NET 4.x &lt;machineKey&gt; element.</Description>
-    <TargetFramework>net46</TargetFramework>
+    <TargetFramework>net461</TargetFramework>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
     <PackageTags>aspnet;aspnetcore;dataprotection</PackageTags>
@@ -16,9 +16,11 @@
 
   <ItemGroup>
     <ProjectReference Include="..\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
     <Reference Include="System.Configuration" />
-    <Reference Include="System.Security" />
     <Reference Include="System.Web" />
   </ItemGroup>
 

+ 6 - 20
src/Microsoft.AspNetCore.DataProtection/Cng/DpapiSecretSerializerHelper.cs

@@ -78,12 +78,8 @@ namespace Microsoft.AspNetCore.DataProtection.Cng
             };
             var dataOut = default(DATA_BLOB);
 
-#if NET46
             RuntimeHelpers.PrepareConstrainedRegions();
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
+
             try
             {
                 var success = UnsafeNativeMethods.CryptProtectData(
@@ -171,12 +167,9 @@ namespace Microsoft.AspNetCore.DataProtection.Cng
                     fixed (byte* pbRetVal = retVal)
                     {
                         var handleAcquired = false;
-#if NET46
+
                         RuntimeHelpers.PrepareConstrainedRegions();
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
+
                         try
                         {
                             protectedData.DangerousAddRef(ref handleAcquired);
@@ -224,12 +217,8 @@ namespace Microsoft.AspNetCore.DataProtection.Cng
             };
             var dataOut = default(DATA_BLOB);
 
-#if NET46
             RuntimeHelpers.PrepareConstrainedRegions();
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
+
             try
             {
                 var success = UnsafeNativeMethods.CryptUnprotectData(
@@ -300,12 +289,9 @@ namespace Microsoft.AspNetCore.DataProtection.Cng
             using (unencryptedPayloadHandle)
             {
                 var handleAcquired = false;
-#if NET46
+
                 RuntimeHelpers.PrepareConstrainedRegions();
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
+
                 try
                 {
                     unencryptedPayloadHandle.DangerousAddRef(ref handleAcquired);

+ 2 - 11
src/Microsoft.AspNetCore.DataProtection/DataProtectionBuilderExtensions.cs

@@ -4,6 +4,7 @@
 using System;
 using System.ComponentModel;
 using System.IO;
+using System.Security.Cryptography.X509Certificates;
 using Microsoft.AspNetCore.Cryptography;
 using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
 using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel;
@@ -16,10 +17,6 @@ using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using Microsoft.Win32;
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-using System.Security.Cryptography.X509Certificates;
-#endif
-
 namespace Microsoft.AspNetCore.DataProtection
 {
     /// <summary>
@@ -249,8 +246,6 @@ namespace Microsoft.AspNetCore.DataProtection
             return builder;
         }
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
         /// <summary>
         /// Configures keys to be encrypted to a given certificate before being persisted to storage.
         /// </summary>
@@ -321,10 +316,6 @@ namespace Microsoft.AspNetCore.DataProtection
 
             return builder;
         }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
 
         /// <summary>
         /// Configures keys to be encrypted with Windows DPAPI before being persisted to
@@ -604,4 +595,4 @@ namespace Microsoft.AspNetCore.DataProtection
             return builder;
         }
     }
-}
+}

+ 0 - 5
src/Microsoft.AspNetCore.DataProtection/DataProtectionServiceCollectionExtensions.cs

@@ -98,12 +98,7 @@ namespace Microsoft.Extensions.DependencyInjection
                 return dataProtectionProvider;
             });
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
             services.TryAddSingleton<ICertificateResolver, CertificateResolver>();
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
         }
     }
 }

+ 0 - 28
src/Microsoft.AspNetCore.DataProtection/IDataProtectionBuilder.cs

@@ -7,7 +7,6 @@ using Microsoft.Extensions.DependencyInjection;
 
 namespace Microsoft.AspNetCore.DataProtection
 {
-#if NET46
     /// <summary>
     /// Provides access to configuration for the data protection system, which allows the
     /// developer to configure default cryptographic algorithms, key storage locations,
@@ -34,33 +33,6 @@ namespace Microsoft.AspNetCore.DataProtection
     /// contain existing keys that use older algorithms or protection mechanisms.
     /// </para>
     /// </remarks>
-#elif NETSTANDARD1_3
-    /// <summary>
-    /// Provides access to configuration for the data protection system, which allows the
-    /// developer to configure default cryptographic algorithms, key storage locations,
-    /// and the mechanism by which keys are protected at rest.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// If the developer changes the at-rest key protection mechanism, it is intended that
-    /// he also change the key storage location, and vice versa.
-    /// </para>
-    /// <para>
-    /// Similarly, when a developer modifies the default protected payload cryptographic
-    /// algorithms, it is intended that he also select an explitiy key storage location.
-    /// A call to <see cref="DataProtectionBuilderExtensions.UseCryptographicAlgorithms(IDataProtectionBuilder,AuthenticatedEncryptorConfiguration)"/>
-    /// should therefore generally be paired with a call to <see cref="DataProtectionBuilderExtensions.PersistKeysToFileSystem(IDataProtectionBuilder,DirectoryInfo)"/>,
-    /// for example.
-    /// </para>
-    /// <para>
-    /// When the default cryptographic algorithms or at-rest key protection mechanisms are
-    /// changed, they only affect <strong>new</strong> keys in the repository. The repository may
-    /// contain existing keys that use older algorithms or protection mechanisms.
-    /// </para>
-    /// </remarks>
-#else
-#error target frameworks need to be updated.
-#endif
     public interface IDataProtectionBuilder
     {
         /// <summary>

+ 1 - 7
src/Microsoft.AspNetCore.DataProtection/Managed/ManagedAuthenticatedEncryptor.cs

@@ -343,14 +343,8 @@ namespace Microsoft.AspNetCore.DataProtection.Managed
 
                             using (var validationAlgorithm = CreateValidationAlgorithm(validationSubkey))
                             {
-#if NET46
-                                // As an optimization, avoid duplicating the underlying buffer if we're on desktop CLR.
+                                // As an optimization, avoid duplicating the underlying buffer
                                 var underlyingBuffer = outputStream.GetBuffer();
-#elif NETSTANDARD1_3
-                                var underlyingBuffer = outputStream.ToArray();
-#else
-#error target frameworks need to be updated.
-#endif
 
                                 var mac = validationAlgorithm.ComputeHash(underlyingBuffer, KEY_MODIFIER_SIZE_IN_BYTES, checked((int)outputStream.Length - KEY_MODIFIER_SIZE_IN_BYTES));
                                 outputStream.Write(mac, 0, mac.Length);

+ 5 - 13
src/Microsoft.AspNetCore.DataProtection/Microsoft.AspNetCore.DataProtection.csproj

@@ -4,7 +4,7 @@
 
   <PropertyGroup>
     <Description>ASP.NET Core logic to protect and unprotect data, similar to DPAPI.</Description>
-    <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
+    <TargetFramework>netstandard2.0</TargetFramework>
     <NoWarn>$(NoWarn);CS1591</NoWarn>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -19,22 +19,14 @@
   <ItemGroup>
     <ProjectReference Include="..\Microsoft.AspNetCore.Cryptography.Internal\Microsoft.AspNetCore.Cryptography.Internal.csproj" />
     <ProjectReference Include="..\Microsoft.AspNetCore.DataProtection.Abstractions\Microsoft.AspNetCore.DataProtection.Abstractions.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" />
-  </ItemGroup>
-
-  <ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
-    <Reference Include="System.Security" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-
-  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
     <PackageReference Include="Microsoft.Win32.Registry" Version="$(CoreFxVersion)" />
-    <PackageReference Include="System.Reflection.TypeExtensions" Version="$(CoreFxVersion)" />
-    <PackageReference Include="System.Security.Claims" Version="$(CoreFxVersion)" />
-    <PackageReference Include="System.Security.Principal.Windows" Version="$(CoreFxVersion)" />
+    <PackageReference Include="System.Security.Cryptography.Xml" Version="$(CoreFxVersion)" />
   </ItemGroup>
 
 </Project>

+ 21 - 21
src/Microsoft.AspNetCore.DataProtection/Repositories/FileSystemXmlRepository.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Xml.Linq;
 using Microsoft.Extensions.Logging;
 
@@ -37,8 +38,9 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
         }
 
         /// <summary>
-        /// The default key storage directory, which currently corresponds to
-        /// "%LOCALAPPDATA%\ASP.NET\DataProtection-Keys".
+        /// The default key storage directory.
+        /// On Windows, this currently corresponds to "Environment.SpecialFolder.LocalApplication/ASP.NET/DataProtection-Keys".
+        /// On Linux and macOS, this currently corresponds to "$HOME/.aspnet/DataProtection-Keys".
         /// </summary>
         /// <remarks>
         /// This property can return null if no suitable default key storage directory can
@@ -82,28 +84,23 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
 
         private static DirectoryInfo GetDefaultKeyStorageDirectory()
         {
-#if NET46
-            // Environment.GetFolderPath returns null if the user profile isn't loaded.
-            var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-            if (!String.IsNullOrEmpty(folderPath))
-            {
-                return GetKeyStorageDirectoryFromBaseAppDataPath(folderPath);
-            }
-            else
-            {
-                return null;
-            }
-#elif NETSTANDARD1_3
-            // On core CLR, we need to fall back to environment variables.
             DirectoryInfo retVal;
 
-            var localAppDataPath = Environment.GetEnvironmentVariable("LOCALAPPDATA");
+            // Environment.GetFolderPath returns null if the user profile isn't loaded.
+            var localAppDataFromSystemPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+            var localAppDataFromEnvPath = Environment.GetEnvironmentVariable("LOCALAPPDATA");
             var userProfilePath = Environment.GetEnvironmentVariable("USERPROFILE");
             var homePath = Environment.GetEnvironmentVariable("HOME");
 
-            if (localAppDataPath != null)
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !string.IsNullOrEmpty(localAppDataFromSystemPath))
+            {
+                // To preserve backwards-compatibility with 1.x, Environment.SpecialFolder.LocalApplicationData
+                // cannot take precedence over $LOCALAPPDATA and $HOME/.aspnet on non-Windows platforms
+                retVal = GetKeyStorageDirectoryFromBaseAppDataPath(localAppDataFromSystemPath);
+            }
+            else if (localAppDataFromEnvPath != null)
             {
-                retVal = GetKeyStorageDirectoryFromBaseAppDataPath(localAppDataPath);
+                retVal = GetKeyStorageDirectoryFromBaseAppDataPath(localAppDataFromEnvPath);
             }
             else if (userProfilePath != null)
             {
@@ -115,6 +112,12 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
                 // it's a good guess that this is a *NIX machine.  Use *NIX conventions for a folder name.
                 retVal = new DirectoryInfo(Path.Combine(homePath, ".aspnet", DataProtectionKeysFolderName));
             }
+            else if (!string.IsNullOrEmpty(localAppDataFromSystemPath))
+            {
+                // Starting in 2.x, non-Windows platforms may use Environment.SpecialFolder.LocalApplicationData
+                // but only after checking for $LOCALAPPDATA, $USERPROFILE, and $HOME.
+                retVal = GetKeyStorageDirectoryFromBaseAppDataPath(localAppDataFromSystemPath);
+            }
             else
             {
                 return null;
@@ -131,9 +134,6 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
             {
                 return null;
             }
-#else
-#error target frameworks need to be updated.
-#endif
         }
 
         internal static DirectoryInfo GetKeyStorageDirectoryForAzureWebSites()

+ 3 - 8
src/Microsoft.AspNetCore.DataProtection/TypeForwardingActivator.cs

@@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.DataProtection
         private const string OldNamespace = "Microsoft.AspNet.DataProtection";
         private const string CurrentNamespace = "Microsoft.AspNetCore.DataProtection";
         private readonly ILogger _logger;
-        private static readonly Regex _versionPattern = new Regex(@",\s?Version=(\d+\.?)(\d+\.?)?(\d+\.?)?(\d+\.?)?", RegexOptions.Compiled, TimeSpan.FromSeconds(2));
+        private static readonly Regex _versionPattern = new Regex(@",\s?Version=[0-9]+(\.[0-9]+){0,3}", RegexOptions.Compiled, TimeSpan.FromSeconds(2));
 
         public TypeForwardingActivator(IServiceProvider services)
             : this(services, DataProtectionProviderFactory.GetDefaultLoggerFactory())
@@ -39,16 +39,11 @@ namespace Microsoft.AspNetCore.DataProtection
                 forwardedTypeName = originalTypeName.Replace(OldNamespace, CurrentNamespace);
             }
 
-#if NET46
-            if (candidate || forwardedTypeName.Contains(CurrentNamespace))
+            if (candidate || forwardedTypeName.StartsWith(CurrentNamespace + ".", StringComparison.Ordinal))
             {
                 candidate = true;
                 forwardedTypeName = RemoveVersionFromAssemblyName(forwardedTypeName);
             }
-#elif NETSTANDARD1_3
-#else
-#error Target framework needs to be updated
-#endif
 
             if (candidate)
             {
@@ -70,4 +65,4 @@ namespace Microsoft.AspNetCore.DataProtection
         protected string RemoveVersionFromAssemblyName(string forwardedTypeName)
             => _versionPattern.Replace(forwardedTypeName, "");
     }
-}
+}

+ 14 - 8
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/CertificateResolver.cs

@@ -1,9 +1,8 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System;
+using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
 
 namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
@@ -40,9 +39,19 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
             var store = new X509Store(location);
             try
             {
-                store.Open(OpenFlags.ReadOnly);
+                store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
                 var matchingCerts = store.Certificates.Find(X509FindType.FindByThumbprint, thumbprint, validOnly: true);
-                return (matchingCerts != null && matchingCerts.Count > 0) ? matchingCerts[0] : null;
+                return (matchingCerts != null && matchingCerts.Count > 0)
+                    ? matchingCerts[0]
+                    : null;
+            }
+            catch (CryptographicException)
+            {
+                // Suppress first-chance exceptions when opening the store.
+                // For example, LocalMachine\My is not supported on Linux yet and will throw on Open(),
+                // but there isn't a good way to detect this without attempting to open the store.
+                // See https://github.com/dotnet/corefx/issues/3690.
+                return null;
             }
             finally
             {
@@ -51,7 +60,4 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         }
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif
+

+ 0 - 6
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/CertificateXmlEncryptor.cs

@@ -1,8 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System;
 using System.Security.Cryptography.X509Certificates;
 using System.Security.Cryptography.Xml;
@@ -147,7 +145,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         }
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 44
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.core50.cs

@@ -1,44 +0,0 @@
-// Copyright (c) .NET Foundation. All rights reserved.
-// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
-#if NETSTANDARD1_3
-// [[ISSUE60]] Remove this entire file when Core CLR gets support for EncryptedXml.
-// This is just a dummy implementation of the class that always throws.
-// The only reason it's here (albeit internal) is to provide a nice error message if key
-// material that was generated by Desktop CLR needs to be read by Core CLR.
-
-using System;
-using System.Xml.Linq;
-using Microsoft.Extensions.Logging;
-
-namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
-{
-    internal sealed class EncryptedXmlDecryptor : IXmlDecryptor
-    {
-        private readonly ILogger _logger;
-
-        public EncryptedXmlDecryptor()
-            : this(services: null)
-        {
-        }
-
-        public EncryptedXmlDecryptor(IServiceProvider services)
-        {
-            _logger = services.GetLogger<EncryptedXmlDecryptor>();
-        }
-
-        public XElement Decrypt(XElement encryptedElement)
-        {
-            if (_logger.IsErrorLevelEnabled())
-            {
-                _logger.LogError(Resources.EncryptedXmlDecryptor_DoesNotWorkOnCoreClr);
-            }
-
-            throw new PlatformNotSupportedException(Resources.EncryptedXmlDecryptor_DoesNotWorkOnCoreClr);
-        }
-    }
-}
-#elif NET46
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 6
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/EncryptedXmlDecryptor.cs

@@ -1,8 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System;
 using System.Security.Cryptography.Xml;
 using System.Xml;
@@ -73,7 +71,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         }
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 6
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/ICertificateResolver.cs

@@ -1,8 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System.Security.Cryptography.X509Certificates;
 
 namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
@@ -20,7 +18,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         X509Certificate2 ResolveCertificate(string thumbprint);
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 6
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/IInternalCertificateXmlEncryptor.cs

@@ -1,8 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System;
 using System.Xml;
 using System.Security.Cryptography.Xml;
@@ -17,7 +15,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         EncryptedData PerformEncryption(EncryptedXml encryptedXml, XmlElement elementToEncrypt);
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 6
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/IInternalEncryptedXmlDecryptor.cs

@@ -1,8 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-
 using System;
 using System.Security.Cryptography.Xml;
 
@@ -16,7 +14,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         void PerformPreDecryptionSetup(EncryptedXml encryptedXml);
     }
 }
-#elif NETSTANDARD1_3
-#else
-#error target frameworks need to be updated.
-#endif

+ 0 - 18
src/Microsoft.AspNetCore.DataProtection/XmlEncryption/XmlEncryptionExtensions.cs

@@ -133,7 +133,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
             var memoryStream = new MemoryStream(DEFAULT_BUFFER_SIZE);
             element.Save(memoryStream);
 
-#if NET46
             var underlyingBuffer = memoryStream.GetBuffer();
             fixed (byte* __unused__ = underlyingBuffer) // try to limit this moving around in memory while we allocate
             {
@@ -146,23 +145,6 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
                     Array.Clear(underlyingBuffer, 0, underlyingBuffer.Length);
                 }
             }
-#elif NETSTANDARD1_3
-            ArraySegment<byte> underlyingBuffer;
-            CryptoUtil.Assert(memoryStream.TryGetBuffer(out underlyingBuffer), "Underlying buffer isn't exposable.");
-            fixed (byte* __unused__ = underlyingBuffer.Array) // try to limit this moving around in memory while we allocate
-            {
-                try
-                {
-                    return new Secret(underlyingBuffer);
-                }
-                finally
-                {
-                    Array.Clear(underlyingBuffer.Array, underlyingBuffer.Offset, underlyingBuffer.Count);
-                }
-            }
-#else
-#error target frameworks need to be updated.
-#endif
         }
 
         /// <summary>

+ 0 - 3749
src/Microsoft.AspNetCore.DataProtection/baseline.net45.json

@@ -1,3749 +0,0 @@
-{
-  "AssemblyIdentity": "Microsoft.AspNetCore.DataProtection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60",
-  "Types": [
-    {
-      "Name": "Microsoft.Extensions.DependencyInjection.DataProtectionServiceCollectionExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "AddDataProtection",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "AddDataProtection",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection"
-            },
-            {
-              "Name": "setupAction",
-              "Type": "System.Action<Microsoft.AspNetCore.DataProtection.DataProtectionOptions>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.Extensions.DependencyInjection.DataProtectionServices",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetDefaultServices",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IEnumerable<Microsoft.Extensions.DependencyInjection.ServiceDescriptor>",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionBuilderExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "SetApplicationName",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "applicationName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "AddKeyEscrowSink",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "sink",
-              "Type": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyEscrowSink"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "AddKeyEscrowSink<T0>",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": [
-            {
-              "ParameterName": "TImplementation",
-              "ParameterPosition": 0,
-              "Class": true,
-              "BaseTypeOrInterfaces": [
-                "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyEscrowSink"
-              ]
-            }
-          ]
-        },
-        {
-          "Kind": "Method",
-          "Name": "AddKeyEscrowSink",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "factory",
-              "Type": "System.Func<System.IServiceProvider, Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyEscrowSink>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "AddKeyManagementOptions",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "setupAction",
-              "Type": "System.Action<Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "DisableAutomaticKeyGeneration",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "PersistKeysToFileSystem",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "directory",
-              "Type": "System.IO.DirectoryInfo"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "PersistKeysToRegistry",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "registryKey",
-              "Type": "Microsoft.Win32.RegistryKey"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithCertificate",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithCertificate",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "thumbprint",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithDpapi",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithDpapi",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "protectToLocalMachine",
-              "Type": "System.Boolean"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithDpapiNG",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ProtectKeysWithDpapiNG",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "protectionDescriptorRule",
-              "Type": "System.String"
-            },
-            {
-              "Name": "flags",
-              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "SetDefaultKeyLifetime",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "lifetime",
-              "Type": "System.TimeSpan"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "UseCryptographicAlgorithms",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "UseCustomCryptographicAlgorithms",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "UseCustomCryptographicAlgorithms",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "UseCustomCryptographicAlgorithms",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            },
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "UseEphemeralDataProtectionProvider",
-          "Parameters": [
-            {
-              "Name": "builder",
-              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionOptions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_ApplicationDiscriminator",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_ApplicationDiscriminator",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.DataProtectionUtilityExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetApplicationUniqueIdentifier",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "ReturnType": "System.String",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.EphemeralDataProtectionProvider",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateProtector",
-          "Parameters": [
-            {
-              "Name": "purpose",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtector",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.IDataProtectionProvider",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Services",
-          "Parameters": [],
-          "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.IPersistedDataProtector",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.IDataProtector"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "DangerousUnprotect",
-          "Parameters": [
-            {
-              "Name": "protectedData",
-              "Type": "System.Byte[]"
-            },
-            {
-              "Name": "ignoreRevocationErrors",
-              "Type": "System.Boolean"
-            },
-            {
-              "Name": "requiresMigration",
-              "Type": "System.Boolean",
-              "Direction": "Out"
-            },
-            {
-              "Name": "wasRevoked",
-              "Type": "System.Boolean",
-              "Direction": "Out"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.ISecret",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [
-        "System.IDisposable"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Length",
-          "Parameters": [],
-          "ReturnType": "System.Int32",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "WriteSecretIntoBuffer",
-          "Parameters": [
-            {
-              "Name": "buffer",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Secret",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.ISecret"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Length",
-          "Parameters": [],
-          "ReturnType": "System.Int32",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.ISecret",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Dispose",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "System.IDisposable",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Random",
-          "Parameters": [
-            {
-              "Name": "numBytes",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.Secret",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "WriteSecretIntoBuffer",
-          "Parameters": [
-            {
-              "Name": "buffer",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.ISecret",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "WriteSecretIntoBuffer",
-          "Parameters": [
-            {
-              "Name": "buffer",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "bufferLength",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Byte[]"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "secret",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "secretLength",
-              "Type": "System.Int32"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "secret",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ResolveCertificate",
-          "Parameters": [
-            {
-              "Name": "thumbprint",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Security.Cryptography.X509Certificates.X509Certificate2",
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateXmlEncryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IInternalCertificateXmlEncryptor",
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintextElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "thumbprint",
-              "Type": "System.String"
-            },
-            {
-              "Name": "certificateResolver",
-              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "thumbprint",
-              "Type": "System.String"
-            },
-            {
-              "Name": "certificateResolver",
-              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "certificate",
-              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags",
-      "Visibility": "Public",
-      "Kind": "Enumeration",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Field",
-          "Name": "None",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "0"
-        },
-        {
-          "Kind": "Field",
-          "Name": "NamedDescriptor",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "1"
-        },
-        {
-          "Kind": "Field",
-          "Name": "MachineKey",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "32"
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGXmlDecryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGXmlEncryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintextElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "protectionDescriptorRule",
-              "Type": "System.String"
-            },
-            {
-              "Name": "flags",
-              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "protectionDescriptorRule",
-              "Type": "System.String"
-            },
-            {
-              "Name": "flags",
-              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiXmlDecryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiXmlEncryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintextElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "protectToLocalMachine",
-              "Type": "System.Boolean"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "protectToLocalMachine",
-              "Type": "System.Boolean"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlDecryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IInternalEncryptedXmlDecryptor",
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_DecryptorType",
-          "Parameters": [],
-          "ReturnType": "System.Type",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptedElement",
-          "Parameters": [],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            },
-            {
-              "Name": "decryptorType",
-              "Type": "System.Type"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ResolveCertificate",
-          "Parameters": [
-            {
-              "Name": "thumbprint",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Security.Cryptography.X509Certificates.X509Certificate2",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintextElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.NullXmlDecryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "encryptedElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.NullXmlEncryptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintextElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_DefaultKeyStorageDirectory",
-          "Parameters": [],
-          "ReturnType": "System.IO.DirectoryInfo",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_Directory",
-          "Parameters": [],
-          "ReturnType": "System.IO.DirectoryInfo",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_Services",
-          "Parameters": [],
-          "ReturnType": "System.IServiceProvider",
-          "Visibility": "Protected",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetAllElements",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IReadOnlyCollection<System.Xml.Linq.XElement>",
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "StoreElement",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            },
-            {
-              "Name": "friendlyName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "directory",
-              "Type": "System.IO.DirectoryInfo"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "directory",
-              "Type": "System.IO.DirectoryInfo"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetAllElements",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IReadOnlyCollection<System.Xml.Linq.XElement>",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "StoreElement",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            },
-            {
-              "Name": "friendlyName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Repositories.RegistryXmlRepository",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_DefaultRegistryKey",
-          "Parameters": [],
-          "ReturnType": "Microsoft.Win32.RegistryKey",
-          "Static": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_RegistryKey",
-          "Parameters": [],
-          "ReturnType": "Microsoft.Win32.RegistryKey",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_Services",
-          "Parameters": [],
-          "ReturnType": "System.IServiceProvider",
-          "Visibility": "Protected",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetAllElements",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IReadOnlyCollection<System.Xml.Linq.XElement>",
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "StoreElement",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            },
-            {
-              "Name": "friendlyName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "registryKey",
-              "Type": "Microsoft.Win32.RegistryKey"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "registryKey",
-              "Type": "Microsoft.Win32.RegistryKey"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_ActivationDate",
-          "Parameters": [],
-          "ReturnType": "System.DateTimeOffset",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_CreationDate",
-          "Parameters": [],
-          "ReturnType": "System.DateTimeOffset",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_ExpirationDate",
-          "Parameters": [],
-          "ReturnType": "System.DateTimeOffset",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_IsRevoked",
-          "Parameters": [],
-          "ReturnType": "System.Boolean",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_KeyId",
-          "Parameters": [],
-          "ReturnType": "System.Guid",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyEscrowSink",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Store",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateNewKey",
-          "Parameters": [
-            {
-              "Name": "activationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "expirationDate",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetAllKeys",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IReadOnlyCollection<Microsoft.AspNetCore.DataProtection.KeyManagement.IKey>",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetCacheExpirationToken",
-          "Parameters": [],
-          "ReturnType": "System.Threading.CancellationToken",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "RevokeKey",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "reason",
-              "Type": "System.String",
-              "DefaultValue": "null"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "RevokeAllKeys",
-          "Parameters": [
-            {
-              "Name": "revocationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "reason",
-              "Type": "System.String",
-              "DefaultValue": "null"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.KeyManagementOptions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_AutoGenerateKeys",
-          "Parameters": [],
-          "ReturnType": "System.Boolean",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_AutoGenerateKeys",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Boolean"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_NewKeyLifetime",
-          "Parameters": [],
-          "ReturnType": "System.TimeSpan",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_NewKeyLifetime",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.TimeSpan"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-        "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateNewKey",
-          "Parameters": [
-            {
-              "Name": "activationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "expirationDate",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetAllKeys",
-          "Parameters": [],
-          "ReturnType": "System.Collections.Generic.IReadOnlyCollection<Microsoft.AspNetCore.DataProtection.KeyManagement.IKey>",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetCacheExpirationToken",
-          "Parameters": [],
-          "ReturnType": "System.Threading.CancellationToken",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "RevokeAllKeys",
-          "Parameters": [
-            {
-              "Name": "revocationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "reason",
-              "Type": "System.String",
-              "DefaultValue": "null"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "RevokeKey",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "reason",
-              "Type": "System.String",
-              "DefaultValue": "null"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "repository",
-              "Type": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository"
-            },
-            {
-              "Name": "configuration",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.CacheableKeyRing",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution",
-      "Visibility": "Public",
-      "Kind": "Struct",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Field",
-          "Name": "DefaultKey",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Field",
-          "Name": "FallbackKey",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Field",
-          "Name": "ShouldGenerateNewKey",
-          "Parameters": [],
-          "ReturnType": "System.Boolean",
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.ICacheableKeyRingProvider",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetCacheableKeyRing",
-          "Parameters": [
-            {
-              "Name": "now",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.CacheableKeyRing",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IDefaultKeyResolver",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ResolveDefaultKeyPolicy",
-          "Parameters": [
-            {
-              "Name": "now",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "allKeys",
-              "Type": "System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.DataProtection.KeyManagement.IKey>"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IDefaultKeyServices",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetKeyEncryptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetKeyRepository",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.Repositories.IXmlRepository",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateNewKey",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "creationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "activationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "expirationDate",
-              "Type": "System.DateTimeOffset"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.IKey",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "DeserializeDescriptorFromKeyElement",
-          "Parameters": [
-            {
-              "Name": "keyElement",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "RevokeSingleKey",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "revocationDate",
-              "Type": "System.DateTimeOffset"
-            },
-            {
-              "Name": "reason",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IKeyRing",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_DefaultAuthenticatedEncryptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_DefaultKeyId",
-          "Parameters": [],
-          "ReturnType": "System.Guid",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "GetAuthenticatedEncryptorByKeyId",
-          "Parameters": [
-            {
-              "Name": "keyId",
-              "Type": "System.Guid"
-            },
-            {
-              "Name": "isRevoked",
-              "Type": "System.Boolean",
-              "Direction": "Out"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IKeyRingProvider",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "GetCurrentKeyRing",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IKeyRing",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Internal.DataProtectionBuilder",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Services",
-          "Parameters": [],
-          "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Internal.IActivator",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateInstance",
-          "Parameters": [
-            {
-              "Name": "expectedBaseType",
-              "Type": "System.Type"
-            },
-            {
-              "Name": "implementationTypeName",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Object",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.Cng.Internal.CngAuthenticatedEncryptorBase",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IOptimizedAuthenticatedEncryptor",
-        "System.IDisposable"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "ciphertext",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "additionalAuthenticatedData",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "DecryptImpl",
-          "Parameters": [
-            {
-              "Name": "pbCiphertext",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "cbCiphertext",
-              "Type": "System.UInt32"
-            },
-            {
-              "Name": "pbAdditionalAuthenticatedData",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "cbAdditionalAuthenticatedData",
-              "Type": "System.UInt32"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Virtual": true,
-          "Abstract": true,
-          "Visibility": "Protected",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Dispose",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Virtual": true,
-          "Abstract": true,
-          "ImplementedInterface": "System.IDisposable",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintext",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "additionalAuthenticatedData",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintext",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "additionalAuthenticatedData",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "preBufferSize",
-              "Type": "System.UInt32"
-            },
-            {
-              "Name": "postBufferSize",
-              "Type": "System.UInt32"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IOptimizedAuthenticatedEncryptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "EncryptImpl",
-          "Parameters": [
-            {
-              "Name": "pbPlaintext",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "cbPlaintext",
-              "Type": "System.UInt32"
-            },
-            {
-              "Name": "pbAdditionalAuthenticatedData",
-              "Type": "System.Byte*"
-            },
-            {
-              "Name": "cbAdditionalAuthenticatedData",
-              "Type": "System.UInt32"
-            },
-            {
-              "Name": "cbPreBuffer",
-              "Type": "System.UInt32"
-            },
-            {
-              "Name": "cbPostBuffer",
-              "Type": "System.UInt32"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "Virtual": true,
-          "Abstract": true,
-          "Visibility": "Protected",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Protected",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithm",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithm",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_ValidationAlgorithm",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_ValidationAlgorithm",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Validate",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithm",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithm",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmProvider",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmProvider",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmKeySize",
-          "Parameters": [],
-          "ReturnType": "System.Int32",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmKeySize",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_HashAlgorithm",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_HashAlgorithm",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_HashAlgorithmProvider",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_HashAlgorithmProvider",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Validate",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithm",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithm",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmProvider",
-          "Parameters": [],
-          "ReturnType": "System.String",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmProvider",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.String"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmKeySize",
-          "Parameters": [],
-          "ReturnType": "System.Int32",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmKeySize",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Validate",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm",
-      "Visibility": "Public",
-      "Kind": "Enumeration",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Field",
-          "Name": "AES_128_CBC",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "0"
-        },
-        {
-          "Kind": "Field",
-          "Name": "AES_192_CBC",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "1"
-        },
-        {
-          "Kind": "Field",
-          "Name": "AES_256_CBC",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "2"
-        },
-        {
-          "Kind": "Field",
-          "Name": "AES_128_GCM",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "3"
-        },
-        {
-          "Kind": "Field",
-          "Name": "AES_192_GCM",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "4"
-        },
-        {
-          "Kind": "Field",
-          "Name": "AES_256_GCM",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "5"
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "Decrypt",
-          "Parameters": [
-            {
-              "Name": "ciphertext",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "additionalAuthenticatedData",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Encrypt",
-          "Parameters": [
-            {
-              "Name": "plaintext",
-              "Type": "System.ArraySegment<System.Byte>"
-            },
-            {
-              "Name": "additionalAuthenticatedData",
-              "Type": "System.ArraySegment<System.Byte>"
-            }
-          ],
-          "ReturnType": "System.Byte[]",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmType",
-          "Parameters": [],
-          "ReturnType": "System.Type",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmType",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Type"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_EncryptionAlgorithmKeySize",
-          "Parameters": [],
-          "ReturnType": "System.Int32",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_EncryptionAlgorithmKeySize",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Int32"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_ValidationAlgorithmType",
-          "Parameters": [],
-          "ReturnType": "System.Type",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "set_ValidationAlgorithmType",
-          "Parameters": [
-            {
-              "Name": "value",
-              "Type": "System.Type"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "Validate",
-          "Parameters": [],
-          "ReturnType": "System.Void",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IInternalAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm",
-      "Visibility": "Public",
-      "Kind": "Enumeration",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Field",
-          "Name": "HMACSHA256",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "0"
-        },
-        {
-          "Kind": "Field",
-          "Name": "HMACSHA512",
-          "Parameters": [],
-          "GenericParameter": [],
-          "Literal": "1"
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorConfiguration",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IInternalAuthenticatedEncryptorConfiguration"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Settings",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateNewDescriptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ExportToXml",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.AuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorDescriptorDeserializer",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ImportFromXml",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngCbcAuthenticatedEncryptorConfiguration",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IInternalAuthenticatedEncryptorConfiguration"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Settings",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateNewDescriptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngCbcAuthenticatedEncryptorDescriptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ExportToXml",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngCbcAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngCbcAuthenticatedEncryptorDescriptorDeserializer",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ImportFromXml",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngGcmAuthenticatedEncryptorConfiguration",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IInternalAuthenticatedEncryptorConfiguration"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Settings",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateNewDescriptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngGcmAuthenticatedEncryptorDescriptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ExportToXml",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.CngGcmAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.CngGcmAuthenticatedEncryptorDescriptorDeserializer",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ImportFromXml",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateNewDescriptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ExportToXml",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer",
-      "Visibility": "Public",
-      "Kind": "Interface",
-      "Abstract": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ImportFromXml",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.ManagedAuthenticatedEncryptorConfiguration",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IInternalAuthenticatedEncryptorConfiguration"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_Settings",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "CreateNewDescriptor",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorConfiguration",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.ManagedAuthenticatedEncryptorDescriptor",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "CreateEncryptorInstance",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "ExportToXml",
-          "Parameters": [],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "settings",
-              "Type": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptionSettings"
-            },
-            {
-              "Name": "masterKey",
-              "Type": "Microsoft.AspNetCore.DataProtection.ISecret"
-            },
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.ManagedAuthenticatedEncryptorDescriptorDeserializer",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [
-        "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer"
-      ],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "ImportFromXml",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptor",
-          "Sealed": true,
-          "Virtual": true,
-          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.IAuthenticatedEncryptorDescriptorDeserializer",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [],
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "services",
-              "Type": "System.IServiceProvider"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlExtensions",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Abstract": true,
-      "Static": true,
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "MarkAsRequiresEncryption",
-          "Parameters": [
-            {
-              "Name": "element",
-              "Type": "System.Xml.Linq.XElement"
-            }
-          ],
-          "ReturnType": "System.Void",
-          "Static": true,
-          "Extension": true,
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    },
-    {
-      "Name": "Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.XmlSerializedDescriptorInfo",
-      "Visibility": "Public",
-      "Kind": "Class",
-      "Sealed": true,
-      "ImplementedInterfaces": [],
-      "Members": [
-        {
-          "Kind": "Method",
-          "Name": "get_DeserializerType",
-          "Parameters": [],
-          "ReturnType": "System.Type",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Method",
-          "Name": "get_SerializedDescriptorElement",
-          "Parameters": [],
-          "ReturnType": "System.Xml.Linq.XElement",
-          "Visibility": "Public",
-          "GenericParameter": []
-        },
-        {
-          "Kind": "Constructor",
-          "Name": ".ctor",
-          "Parameters": [
-            {
-              "Name": "serializedDescriptorElement",
-              "Type": "System.Xml.Linq.XElement"
-            },
-            {
-              "Name": "deserializerType",
-              "Type": "System.Type"
-            }
-          ],
-          "Visibility": "Public",
-          "GenericParameter": []
-        }
-      ],
-      "GenericParameters": []
-    }
-  ]
-}

+ 234 - 0
src/Microsoft.AspNetCore.DataProtection/baseline.netcore.json

@@ -230,6 +230,44 @@
           "Visibility": "Public",
           "GenericParameter": []
         },
+        {
+          "Kind": "Method",
+          "Name": "ProtectKeysWithCertificate",
+          "Parameters": [
+            {
+              "Name": "builder",
+              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
+            },
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
+          "Static": true,
+          "Extension": true,
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Method",
+          "Name": "ProtectKeysWithCertificate",
+          "Parameters": [
+            {
+              "Name": "builder",
+              "Type": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder"
+            },
+            {
+              "Name": "thumbprint",
+              "Type": "System.String"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.IDataProtectionBuilder",
+          "Static": true,
+          "Extension": true,
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
         {
           "Kind": "Method",
           "Name": "ProtectKeysWithDpapi",
@@ -745,6 +783,132 @@
       ],
       "GenericParameters": []
     },
+    {
+      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver",
+      "Visibility": "Public",
+      "Kind": "Class",
+      "ImplementedInterfaces": [
+        "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
+      ],
+      "Members": [
+        {
+          "Kind": "Method",
+          "Name": "ResolveCertificate",
+          "Parameters": [
+            {
+              "Name": "thumbprint",
+              "Type": "System.String"
+            }
+          ],
+          "ReturnType": "System.Security.Cryptography.X509Certificates.X509Certificate2",
+          "Virtual": true,
+          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver",
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [],
+          "Visibility": "Public",
+          "GenericParameter": []
+        }
+      ],
+      "GenericParameters": []
+    },
+    {
+      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateXmlEncryptor",
+      "Visibility": "Public",
+      "Kind": "Class",
+      "Sealed": true,
+      "ImplementedInterfaces": [
+        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IInternalCertificateXmlEncryptor",
+        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor"
+      ],
+      "Members": [
+        {
+          "Kind": "Method",
+          "Name": "Encrypt",
+          "Parameters": [
+            {
+              "Name": "plaintextElement",
+              "Type": "System.Xml.Linq.XElement"
+            }
+          ],
+          "ReturnType": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
+          "Sealed": true,
+          "Virtual": true,
+          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlEncryptor",
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [
+            {
+              "Name": "thumbprint",
+              "Type": "System.String"
+            },
+            {
+              "Name": "certificateResolver",
+              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
+            }
+          ],
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [
+            {
+              "Name": "thumbprint",
+              "Type": "System.String"
+            },
+            {
+              "Name": "certificateResolver",
+              "Type": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver"
+            },
+            {
+              "Name": "services",
+              "Type": "System.IServiceProvider"
+            }
+          ],
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            }
+          ],
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [
+            {
+              "Name": "certificate",
+              "Type": "System.Security.Cryptography.X509Certificates.X509Certificate2"
+            },
+            {
+              "Name": "services",
+              "Type": "System.IServiceProvider"
+            }
+          ],
+          "Visibility": "Public",
+          "GenericParameter": []
+        }
+      ],
+      "GenericParameters": []
+    },
     {
       "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.DpapiNGProtectionDescriptorFlags",
       "Visibility": "Public",
@@ -990,6 +1154,54 @@
       ],
       "GenericParameters": []
     },
+    {
+      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlDecryptor",
+      "Visibility": "Public",
+      "Kind": "Class",
+      "Sealed": true,
+      "ImplementedInterfaces": [
+        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IInternalEncryptedXmlDecryptor",
+        "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor"
+      ],
+      "Members": [
+        {
+          "Kind": "Method",
+          "Name": "Decrypt",
+          "Parameters": [
+            {
+              "Name": "encryptedElement",
+              "Type": "System.Xml.Linq.XElement"
+            }
+          ],
+          "ReturnType": "System.Xml.Linq.XElement",
+          "Sealed": true,
+          "Virtual": true,
+          "ImplementedInterface": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [],
+          "Visibility": "Public",
+          "GenericParameter": []
+        },
+        {
+          "Kind": "Constructor",
+          "Name": ".ctor",
+          "Parameters": [
+            {
+              "Name": "services",
+              "Type": "System.IServiceProvider"
+            }
+          ],
+          "Visibility": "Public",
+          "GenericParameter": []
+        }
+      ],
+      "GenericParameters": []
+    },
     {
       "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.EncryptedXmlInfo",
       "Visibility": "Public",
@@ -1032,6 +1244,28 @@
       ],
       "GenericParameters": []
     },
+    {
+      "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.ICertificateResolver",
+      "Visibility": "Public",
+      "Kind": "Interface",
+      "Abstract": true,
+      "ImplementedInterfaces": [],
+      "Members": [
+        {
+          "Kind": "Method",
+          "Name": "ResolveCertificate",
+          "Parameters": [
+            {
+              "Name": "thumbprint",
+              "Type": "System.String"
+            }
+          ],
+          "ReturnType": "System.Security.Cryptography.X509Certificates.X509Certificate2",
+          "GenericParameter": []
+        }
+      ],
+      "GenericParameters": []
+    },
     {
       "Name": "Microsoft.AspNetCore.DataProtection.XmlEncryption.IXmlDecryptor",
       "Visibility": "Public",

+ 4 - 1
test/Microsoft.AspNetCore.Cryptography.Internal.Test/Microsoft.AspNetCore.Cryptography.Internal.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
@@ -14,6 +14,9 @@
 
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Cryptography.Internal\Microsoft.AspNetCore.Cryptography.Internal.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
     <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />

+ 4 - 1
test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test/Microsoft.AspNetCore.Cryptography.KeyDerivation.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
@@ -15,6 +15,9 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Cryptography.Internal\Microsoft.AspNetCore.Cryptography.Internal.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Cryptography.KeyDerivation\Microsoft.AspNetCore.Cryptography.KeyDerivation.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
     <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />

+ 4 - 1
test/Microsoft.AspNetCore.DataProtection.Abstractions.Test/Microsoft.AspNetCore.DataProtection.Abstractions.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
@@ -14,6 +14,9 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Cryptography.Internal\Microsoft.AspNetCore.Cryptography.Internal.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Abstractions\Microsoft.AspNetCore.DataProtection.Abstractions.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
     <PackageReference Include="Moq" Version="$(MoqVersion)" />

+ 4 - 1
test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test/Microsoft.AspNetCore.DataProtection.AzureStorage.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">$(PackageTargetFallback);dnxcore50;portable-net451+win8</PackageTargetFallback>
@@ -12,6 +12,9 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.AzureStorage\Microsoft.AspNetCore.DataProtection.AzureStorage.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />

+ 21 - 27
test/Microsoft.AspNetCore.DataProtection.Extensions.Test/DataProtectionProviderTests.cs

@@ -4,7 +4,9 @@
 using System;
 using System.IO;
 using System.Reflection;
+using System.Runtime.InteropServices;
 using System.Security.Cryptography.X509Certificates;
+using Microsoft.AspNetCore.DataProtection.Repositories;
 using Microsoft.AspNetCore.DataProtection.Test.Shared;
 using Microsoft.AspNetCore.Testing.xunit;
 using Xunit;
@@ -13,8 +15,7 @@ namespace Microsoft.AspNetCore.DataProtection
 {
     public class DataProtectionProviderTests
     {
-        [ConditionalFact]
-        [ConditionalRunTestOnlyIfLocalAppDataAvailable]
+        [Fact]
         public void System_UsesProvidedDirectory()
         {
             WithUniqueTempDirectory(directory =>
@@ -37,13 +38,13 @@ namespace Microsoft.AspNetCore.DataProtection
             });
         }
 
-        [ConditionalFact]
-        [ConditionalRunTestOnlyIfLocalAppDataAvailable]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void System_NoKeysDirectoryProvided_UsesDefaultKeysDirectory()
         {
-            var keysPath = Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "ASP.NET", "DataProtection-Keys");
-            var tempPath = Path.Combine(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%"), "ASP.NET", "DataProtection-KeysTemp");
+            Assert.NotNull(FileSystemXmlRepository.DefaultKeyStorageDirectory);
+
+            var keysPath = FileSystemXmlRepository.DefaultKeyStorageDirectory.FullName;
+            var tempPath = FileSystemXmlRepository.DefaultKeyStorageDirectory.FullName + "Temp";
 
             try
             {
@@ -57,13 +58,21 @@ namespace Microsoft.AspNetCore.DataProtection
                 var protector = DataProtectionProvider.Create("TestApplication").CreateProtector("purpose");
                 Assert.Equal("payload", protector.Unprotect(protector.Protect("payload")));
 
-                // Step 3: Validate that there's now a single key in the directory and that it's protected using Windows DPAPI.
+                // Step 3: Validate that there's now a single key in the directory
                 var newFileName = Assert.Single(Directory.GetFiles(keysPath));
                 var file = new FileInfo(newFileName);
                 Assert.StartsWith("key-", file.Name, StringComparison.OrdinalIgnoreCase);
                 var fileText = File.ReadAllText(file.FullName);
-                Assert.DoesNotContain("Warning: the key below is in an unencrypted form.", fileText, StringComparison.Ordinal);
-                Assert.Contains("This key is encrypted with Windows DPAPI.", fileText, StringComparison.Ordinal);
+                // On Windows, validate that it's protected using Windows DPAPI.
+                if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+                {
+                    Assert.DoesNotContain("Warning: the key below is in an unencrypted form.", fileText, StringComparison.Ordinal);
+                    Assert.Contains("This key is encrypted with Windows DPAPI.", fileText, StringComparison.Ordinal);
+                }
+                else
+                {
+                    Assert.Contains("Warning: the key below is in an unencrypted form.", fileText, StringComparison.Ordinal);
+                }
             }
             finally
             {
@@ -79,7 +88,6 @@ namespace Microsoft.AspNetCore.DataProtection
         }
 
         [ConditionalFact]
-        [ConditionalRunTestOnlyIfLocalAppDataAvailable]
         [ConditionalRunTestOnlyOnWindows]
         public void System_UsesProvidedDirectory_WithConfigurationCallback()
         {
@@ -106,16 +114,13 @@ namespace Microsoft.AspNetCore.DataProtection
             });
         }
 
-#if NET46 // [[ISSUE60]] Remove this #ifdef when Core CLR gets support for EncryptedXml
-        [ConditionalFact]
-        [ConditionalRunTestOnlyIfLocalAppDataAvailable]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void System_UsesProvidedDirectoryAndCertificate()
         {
             var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx");
             var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
             store.Open(OpenFlags.ReadWrite);
-            store.Add(new X509Certificate2(filePath, "password"));
+            store.Add(new X509Certificate2(filePath, "password", X509KeyStorageFlags.Exportable));
             store.Close();
 
             WithUniqueTempDirectory(directory =>
@@ -149,10 +154,6 @@ namespace Microsoft.AspNetCore.DataProtection
                 }
             });
         }
-#elif NETCOREAPP2_0
-#else
-#error Target framework needs to be updated
-#endif
 
         /// <summary>
         /// Runs a test and cleans up the temp directory afterward.
@@ -175,13 +176,6 @@ namespace Microsoft.AspNetCore.DataProtection
             }
         }
 
-        private class ConditionalRunTestOnlyIfLocalAppDataAvailable : Attribute, ITestCondition
-        {
-            public bool IsMet => Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%") != null;
-
-            public string SkipReason { get; } = "%LOCALAPPDATA% couldn't be located.";
-        }
-
         private static string GetTestFilesPath()
         {
             var projectName = typeof(DataProtectionProviderTests).GetTypeInfo().Assembly.GetName().Name;

+ 4 - 1
test/Microsoft.AspNetCore.DataProtection.Extensions.Test/Microsoft.AspNetCore.DataProtection.Extensions.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
@@ -14,6 +14,9 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Abstractions\Microsoft.AspNetCore.DataProtection.Abstractions.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Extensions\Microsoft.AspNetCore.DataProtection.Extensions.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
     <PackageReference Include="Moq" Version="$(MoqVersion)" />

+ 4 - 1
test/Microsoft.AspNetCore.DataProtection.Redis.Test/Microsoft.AspNetCore.DataProtection.Redis.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
   </PropertyGroup>
 
@@ -14,6 +14,9 @@
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Abstractions\Microsoft.AspNetCore.DataProtection.Abstractions.csproj" />
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection.Redis\Microsoft.AspNetCore.DataProtection.Redis.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />

+ 2 - 2
test/Microsoft.AspNetCore.DataProtection.Test/AnonymousImpersonation.cs

@@ -1,7 +1,7 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46
+#if NET461
 using System;
 using System.Runtime.ConstrainedExecution;
 using System.Runtime.InteropServices;
@@ -89,4 +89,4 @@ namespace Microsoft.AspNetCore.DataProtection
 #elif NETCOREAPP2_0
 #else
 #error Target framework needs to be updated
-#endif
+#endif

+ 3 - 6
test/Microsoft.AspNetCore.DataProtection.Test/Cng/CngAuthenticatedEncryptorBaseTests.cs

@@ -11,8 +11,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal
 {
     public unsafe class CngAuthenticatedEncryptorBaseTests
     {
-        [ConditionalFact]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void Decrypt_ForwardsArraySegment()
         {
             // Arrange
@@ -37,8 +36,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal
             Assert.Equal(new byte[] { 0x20, 0x21, 0x22 }, retVal);
         }
 
-        [ConditionalFact]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void Decrypt_HandlesEmptyAADPointerFixup()
         {
             // Arrange
@@ -63,8 +61,7 @@ namespace Microsoft.AspNetCore.DataProtection.Cng.Internal
             Assert.Equal(new byte[] { 0x20, 0x21, 0x22 }, retVal);
         }
 
-        [ConditionalFact]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void Decrypt_HandlesEmptyCiphertextPointerFixup()
         {
             // Arrange

+ 1 - 2
test/Microsoft.AspNetCore.DataProtection.Test/Managed/ManagedAuthenticatedEncryptorTests.cs

@@ -79,8 +79,7 @@ namespace Microsoft.AspNetCore.DataProtection.Managed
             });
         }
 
-        [ConditionalFact]
-        [ConditionalRunTestOnlyOnWindows]
+        [Fact]
         public void Encrypt_KnownKey()
         {
             // Arrange

+ 4 - 5
test/Microsoft.AspNetCore.DataProtection.Test/Microsoft.AspNetCore.DataProtection.Test.csproj

@@ -3,7 +3,7 @@
   <Import Project="..\..\build\common.props" />
 
   <PropertyGroup>
-    <TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
+    <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
     <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
@@ -14,6 +14,9 @@
 
   <ItemGroup>
     <ProjectReference Include="..\..\src\Microsoft.AspNetCore.DataProtection\Microsoft.AspNetCore.DataProtection.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
     <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCoreVersion)" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
@@ -22,8 +25,4 @@
     <PackageReference Include="xunit" Version="$(XunitVersion)" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(TargetFramework)'=='net46'">
-    <Reference Include="System.Security" />
-  </ItemGroup>
-
 </Project>

+ 8 - 23
test/Microsoft.AspNetCore.DataProtection.Test/Repositories/FileSystemXmlRepositoryTests.cs

@@ -4,8 +4,8 @@
 using System;
 using System.IO;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Xml.Linq;
-using Microsoft.AspNetCore.Testing.xunit;
 using Microsoft.Extensions.Logging.Abstractions;
 using Xunit;
 
@@ -13,16 +13,19 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
 {
     public class FileSystemXmlRepositoryTests
     {
-        [ConditionalFact]
-        [ConditionalRunTestOnlyIfLocalAppDataAvailable]
+        [Fact]
         public void DefaultKeyStorageDirectory_Property()
         {
+            var baseDir = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
+                ? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET")
+                : Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet");
+            var expectedDir = new DirectoryInfo(Path.Combine(baseDir, "DataProtection-Keys")).FullName;
+
             // Act
             var defaultDirInfo = FileSystemXmlRepository.DefaultKeyStorageDirectory;
 
             // Assert
-            Assert.Equal(defaultDirInfo.FullName,
-                new DirectoryInfo(Path.Combine(GetLocalApplicationData(), "ASP.NET", "DataProtection-Keys")).FullName);
+            Assert.Equal(expectedDir, defaultDirInfo.FullName);
         }
 
         [Fact]
@@ -156,23 +159,5 @@ namespace Microsoft.AspNetCore.DataProtection.Repositories
                 }
             }
         }
-
-        private static string GetLocalApplicationData()
-        {
-#if NETCOREAPP2_0
-            return Environment.GetEnvironmentVariable("LOCALAPPDATA");
-#elif NET46
-            return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-#else
-#error Target framework needs to be updated
-#endif
-        }
-
-        private class ConditionalRunTestOnlyIfLocalAppDataAvailable : Attribute, ITestCondition
-        {
-            public bool IsMet => GetLocalApplicationData() != null;
-
-            public string SkipReason { get; } = "%LOCALAPPDATA% couldn't be located.";
-        }
     }
 }

+ 4 - 9
test/Microsoft.AspNetCore.DataProtection.Test/TypeForwardingActivatorTests.cs

@@ -103,11 +103,12 @@ namespace Microsoft.AspNetCore.DataProtection
         [MemberData(nameof(AssemblyVersions))]
         public void CreateInstance_ForwardsAcrossVersionChanges(Version version)
         {
-#if NET46
+#if NET461
             // run this test in an appdomain without testhost's custom assembly resolution hooks
             var setupInfo = new AppDomainSetup
             {
-                ApplicationBase = AppDomain.CurrentDomain.BaseDirectory
+                ApplicationBase = AppDomain.CurrentDomain.BaseDirectory,
+                ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
             };
             var domain = AppDomain.CreateDomain("TestDomain", null, setupInfo);
             var wrappedTestClass = (TypeForwardingActivatorTests)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, typeof(TypeForwardingActivatorTests).FullName);
@@ -132,13 +133,7 @@ namespace Microsoft.AspNetCore.DataProtection
 
             Assert.NotEqual(typeInfo.AssemblyQualifiedName, newName);
             Assert.IsType<ClassWithParameterlessCtor>(activator.CreateInstance(typeof(object), newName, out var forwarded));
-#if NET46
             Assert.True(forwarded, "Should have forwarded this type to new version or namespace");
-#elif NETCOREAPP2_0
-            Assert.False(forwarded, "Should not have forwarded this type to new version or namespace");
-#else
-#error Target framework should be updated
-#endif
         }
 
         public static TheoryData<Version> AssemblyVersions
@@ -174,4 +169,4 @@ namespace Microsoft.AspNetCore.DataProtection
         {
         }
     }
-}
+}

+ 0 - 6
test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/CertificateXmlEncryptionTests.cs

@@ -1,7 +1,6 @@
 // Copyright (c) .NET Foundation. All rights reserved.
 // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
 
-#if NET46
 using System;
 using System.Security.Cryptography;
 using System.Security.Cryptography.Xml;
@@ -61,8 +60,3 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
         }
     }
 }
-#elif NETCOREAPP2_0
-#else
-#error Target framework needs to be updated
-#endif
-

+ 1 - 1
test/Microsoft.AspNetCore.DataProtection.Test/XmlEncryption/DpapiXmlEncryptionTests.cs

@@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.DataProtection.XmlEncryption
             XmlAssert.Equal(originalXml, roundTrippedElement);
         }
 
-#if NET46
+#if NET461
         [ConditionalFact]
         [ConditionalRunTestOnlyOnWindows]
         public void Encrypt_CurrentUser_Decrypt_ImpersonatedAsAnonymous_Fails()