This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static IEnumerable CastEnumerable(IEnumerable<object> input, Type t) | |
| { | |
| foreach(var o in input) | |
| { | |
| yield return Cast(o, t); | |
| } | |
| } | |
| static object Cast(object obj, Type t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ///This is a Frankenstein class that can extract the AES key from a KDK as described in: | |
| /// https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/subkeyderivation?view=aspnetcore-2.2 | |
| ///With a bit of luck, this should let an ASP.NET app decrypt cookies generated by an ASPNETCore app | |
| ///Still consult https://docs.microsoft.com/en-us/aspnet/core/security/cookie-sharing?view=aspnetcore-2.2 to share cookies | |
| ///Credit for most of the code is from various parts of https://github.com/aspnet/AspNetCore/tree/master/src/DataProtection/DataProtection/src | |
| public unsafe class CookieDataProtector : IDataProtector | |
| { | |
| readonly string _base64MasterKey; |
OlderNewer