Beispiel #1
0
 public static void SetDataProtectionProvider(this IAppBuilder app, IDataProtectionProvider dataProtectionProvider)
 {
     if (app == null)
     {
         throw new ArgumentNullException("app");
     }
     if (dataProtectionProvider == null)
     {
         app.Properties.Remove("security.DataProtectionProvider");
     }
     else
     {
         app.Properties["security.DataProtectionProvider"] = new DataProtectionProviderDelegate(purposes =>
         {
             IDataProtecter dataProtection = dataProtectionProvider.Create(purposes);
             return(new DataProtectionTuple(dataProtection.Protect, dataProtection.Unprotect));
         });
     }
 }
 public SecureDataHandler(IDataSerializer <TData> serializer, IDataProtecter protecter, ITextEncoder encoder)
 {
     _serializer = serializer;
     _protecter  = protecter;
     _encoder    = encoder;
 }
 public TicketDataHandler(IDataProtecter protecter) : base(DataSerializers.Ticket, protecter, TextEncodings.Base64Url)
 {
 }
 public ExtraDataHandler(IDataProtecter protecter)
     : base(DataSerializers.Extra, protecter, TextEncodings.Base64Url)
 {
 }