/// <summary>
 ///   Initializes a new instance of the <see cref="BySessionIdCookieIdentificationMethod" /> class.
 /// </summary>
 public BySessionIdCookieIdentificationMethod(CryptographyConfiguration cryptoConfig) {
   if (cryptoConfig == null) throw new ArgumentNullException("cryptoConfig");
   _encryptionProvider = cryptoConfig.EncryptionProvider;
   _hmacProvider = cryptoConfig.HmacProvider;
   _sessionIdentificationDataProvider = new SessionIdentificationDataProvider(cryptoConfig.HmacProvider);
   _hmacValidator = new HmacValidator(cryptoConfig.HmacProvider);
   _sessionIdFactory = new SessionIdFactory();
   _cookieFactory = new CookieFactory();
   CookieName = DefaultCookieName;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="ByQueryStringParamIdentificationMethod" /> class.
 /// </summary>
 public ByQueryStringParamIdentificationMethod(CryptographyConfiguration cryptoConfig) {
   if (cryptoConfig == null) throw new ArgumentNullException("cryptoConfig");
   _encryptionProvider = cryptoConfig.EncryptionProvider;
   _hmacProvider = cryptoConfig.HmacProvider;
   _sessionIdentificationDataProvider = new SessionIdentificationDataProvider(cryptoConfig.HmacProvider);
   _hmacValidator = new HmacValidator(cryptoConfig.HmacProvider);
   _sessionIdFactory = new SessionIdFactory();
   _responseManipulatorForSession = new ResponseManipulatorForSession();
   ParameterName = DefaultParameterName;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="BySessionIdCookieIdentificationMethod" /> class.
 /// </summary>
 public BySessionIdCookieIdentificationMethod(CryptographyConfiguration cryptoConfig)
 {
     if (cryptoConfig == null)
     {
         throw new ArgumentNullException("cryptoConfig");
     }
     _encryptionProvider = cryptoConfig.EncryptionProvider;
     _hmacProvider       = cryptoConfig.HmacProvider;
     _sessionIdentificationDataProvider = new SessionIdentificationDataProvider(cryptoConfig.HmacProvider);
     _hmacValidator    = new HmacValidator(cryptoConfig.HmacProvider);
     _sessionIdFactory = new SessionIdFactory();
     _cookieFactory    = new CookieFactory();
     CookieName        = DefaultCookieName;
 }
Ejemplo n.º 4
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="ByQueryStringParamIdentificationMethod" /> class.
 /// </summary>
 public ByQueryStringParamIdentificationMethod(CryptographyConfiguration cryptoConfig)
 {
     if (cryptoConfig == null)
     {
         throw new ArgumentNullException("cryptoConfig");
     }
     _encryptionProvider = cryptoConfig.EncryptionProvider;
     _hmacProvider       = cryptoConfig.HmacProvider;
     _sessionIdentificationDataProvider = new SessionIdentificationDataProvider(cryptoConfig.HmacProvider);
     _hmacValidator    = new HmacValidator(cryptoConfig.HmacProvider);
     _sessionIdFactory = new SessionIdFactory();
     _responseManipulatorForSession = new ResponseManipulatorForSession();
     ParameterName = DefaultParameterName;
 }
 public ByQueryStringParamIdentificationMethodFixture() {
   _fakeEncryptionProvider = A.Fake<IEncryptionProvider>();
   _fakeHmacProvider = A.Fake<IHmacProvider>();
   _validConfiguration = new InProcSessionsConfiguration();
   _fakeSessionIdentificationDataProvider = A.Fake<ISessionIdentificationDataProvider>();
   _fakeHmacValidator = A.Fake<IHmacValidator>();
   _fakeSessionIdFactory = A.Fake<ISessionIdFactory>();
   _fakeResponseManipulatorForSession = A.Fake<IResponseManipulatorForSession>();
   _byQueryStringParamIdentificationMethod = new ByQueryStringParamIdentificationMethod(
     _fakeEncryptionProvider,
     _fakeHmacProvider,
     _fakeSessionIdentificationDataProvider,
     _fakeHmacValidator,
     _fakeSessionIdFactory,
     _fakeResponseManipulatorForSession);
   _parameterName = "TheNameOfTheParameter";
   _byQueryStringParamIdentificationMethod.ParameterName = _parameterName;
 }
 public BySessionIdCookieIdentificationMethodFixture() {
   _fakeEncryptionProvider = A.Fake<IEncryptionProvider>();
   _fakeHmacProvider = A.Fake<IHmacProvider>();
   _validConfiguration = new InProcSessionsConfiguration();
   _fakeSessionIdentificationDataProvider = A.Fake<ISessionIdentificationDataProvider>();
   _fakeHmacValidator = A.Fake<IHmacValidator>();
   _fakeSessionIdFactory = A.Fake<ISessionIdFactory>();
   _fakeCookieFactory = A.Fake<ICookieFactory>();
   _bySessionIdCookieIdentificationMethod = new BySessionIdCookieIdentificationMethod(
     _fakeEncryptionProvider,
     _fakeHmacProvider,
     _fakeSessionIdentificationDataProvider,
     _fakeHmacValidator,
     _fakeSessionIdFactory,
     _fakeCookieFactory);
   _cookieName = "TheNameOfTheCookie";
   _bySessionIdCookieIdentificationMethod.CookieName = _cookieName;
 }
 public BySessionIdCookieIdentificationMethodFixture()
 {
     _fakeEncryptionProvider = A.Fake <IEncryptionProvider>();
     _fakeHmacProvider       = A.Fake <IHmacProvider>();
     _validConfiguration     = new InProcSessionsConfiguration();
     _fakeSessionIdentificationDataProvider = A.Fake <ISessionIdentificationDataProvider>();
     _fakeHmacValidator    = A.Fake <IHmacValidator>();
     _fakeSessionIdFactory = A.Fake <ISessionIdFactory>();
     _fakeCookieFactory    = A.Fake <ICookieFactory>();
     _bySessionIdCookieIdentificationMethod = new BySessionIdCookieIdentificationMethod(
         _fakeEncryptionProvider,
         _fakeHmacProvider,
         _fakeSessionIdentificationDataProvider,
         _fakeHmacValidator,
         _fakeSessionIdFactory,
         _fakeCookieFactory);
     _cookieName = "TheNameOfTheCookie";
     _bySessionIdCookieIdentificationMethod.CookieName = _cookieName;
 }
 public ByQueryStringParamIdentificationMethodFixture()
 {
     _fakeEncryptionProvider = A.Fake <IEncryptionProvider>();
     _fakeHmacProvider       = A.Fake <IHmacProvider>();
     _validConfiguration     = new InProcSessionsConfiguration();
     _fakeSessionIdentificationDataProvider = A.Fake <ISessionIdentificationDataProvider>();
     _fakeHmacValidator    = A.Fake <IHmacValidator>();
     _fakeSessionIdFactory = A.Fake <ISessionIdFactory>();
     _fakeResponseManipulatorForSession      = A.Fake <IResponseManipulatorForSession>();
     _byQueryStringParamIdentificationMethod = new ByQueryStringParamIdentificationMethod(
         _fakeEncryptionProvider,
         _fakeHmacProvider,
         _fakeSessionIdentificationDataProvider,
         _fakeHmacValidator,
         _fakeSessionIdFactory,
         _fakeResponseManipulatorForSession);
     _parameterName = "TheNameOfTheParameter";
     _byQueryStringParamIdentificationMethod.ParameterName = _parameterName;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="ByQueryStringParamIdentificationMethod" /> class.
 /// </summary>
 internal ByQueryStringParamIdentificationMethod(
   IEncryptionProvider encryptionProvider,
   IHmacProvider hmacProvider,
   ISessionIdentificationDataProvider sessionIdentificationDataProvider,
   IHmacValidator hmacValidator,
   ISessionIdFactory sessionIdFactory,
   IResponseManipulatorForSession responseManipulatorForSession) {
   if (encryptionProvider == null) throw new ArgumentNullException("encryptionProvider");
   if (hmacProvider == null) throw new ArgumentNullException("hmacProvider");
   if (sessionIdentificationDataProvider == null) throw new ArgumentNullException("configuration");
   if (hmacValidator == null) throw new ArgumentNullException("configuration");
   if (sessionIdFactory == null) throw new ArgumentNullException("configuration");
   if (responseManipulatorForSession == null) throw new ArgumentNullException("responseManipulatorForSession");
   _encryptionProvider = encryptionProvider;
   _hmacProvider = hmacProvider;
   _sessionIdentificationDataProvider = sessionIdentificationDataProvider;
   _hmacValidator = hmacValidator;
   _sessionIdFactory = sessionIdFactory;
   _responseManipulatorForSession = responseManipulatorForSession;
   ParameterName = DefaultParameterName;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="BySessionIdCookieIdentificationMethod" /> class.
 /// </summary>
 internal BySessionIdCookieIdentificationMethod(
   IEncryptionProvider encryptionProvider,
   IHmacProvider hmacProvider,
   ISessionIdentificationDataProvider sessionIdentificationDataProvider,
   IHmacValidator hmacValidator,
   ISessionIdFactory sessionIdFactory,
   ICookieFactory cookieFactory) {
   if (encryptionProvider == null) throw new ArgumentNullException("encryptionProvider");
   if (hmacProvider == null) throw new ArgumentNullException("hmacProvider");
   if (sessionIdentificationDataProvider == null) throw new ArgumentNullException("sessionIdentificationDataProvider");
   if (hmacValidator == null) throw new ArgumentNullException("hmacValidator");
   if (sessionIdFactory == null) throw new ArgumentNullException("sessionIdFactory");
   if (cookieFactory == null) throw new ArgumentNullException("cookieFactory");
   _encryptionProvider = encryptionProvider;
   _hmacProvider = hmacProvider;
   _sessionIdentificationDataProvider = sessionIdentificationDataProvider;
   _hmacValidator = hmacValidator;
   _sessionIdFactory = sessionIdFactory;
   _cookieFactory = cookieFactory;
   CookieName = DefaultCookieName;
 }
 /// <summary>
 ///   Initializes a new instance of the <see cref="BySessionIdCookieIdentificationMethod" /> class.
 /// </summary>
 internal BySessionIdCookieIdentificationMethod(
     IEncryptionProvider encryptionProvider,
     IHmacProvider hmacProvider,
     ISessionIdentificationDataProvider sessionIdentificationDataProvider,
     IHmacValidator hmacValidator,
     ISessionIdFactory sessionIdFactory,
     ICookieFactory cookieFactory)
 {
     if (encryptionProvider == null)
     {
         throw new ArgumentNullException("encryptionProvider");
     }
     if (hmacProvider == null)
     {
         throw new ArgumentNullException("hmacProvider");
     }
     if (sessionIdentificationDataProvider == null)
     {
         throw new ArgumentNullException("sessionIdentificationDataProvider");
     }
     if (hmacValidator == null)
     {
         throw new ArgumentNullException("hmacValidator");
     }
     if (sessionIdFactory == null)
     {
         throw new ArgumentNullException("sessionIdFactory");
     }
     if (cookieFactory == null)
     {
         throw new ArgumentNullException("cookieFactory");
     }
     _encryptionProvider = encryptionProvider;
     _hmacProvider       = hmacProvider;
     _sessionIdentificationDataProvider = sessionIdentificationDataProvider;
     _hmacValidator    = hmacValidator;
     _sessionIdFactory = sessionIdFactory;
     _cookieFactory    = cookieFactory;
     CookieName        = DefaultCookieName;
 }
Ejemplo n.º 12
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="ByQueryStringParamIdentificationMethod" /> class.
 /// </summary>
 internal ByQueryStringParamIdentificationMethod(
     IEncryptionProvider encryptionProvider,
     IHmacProvider hmacProvider,
     ISessionIdentificationDataProvider sessionIdentificationDataProvider,
     IHmacValidator hmacValidator,
     ISessionIdFactory sessionIdFactory,
     IResponseManipulatorForSession responseManipulatorForSession)
 {
     if (encryptionProvider == null)
     {
         throw new ArgumentNullException("encryptionProvider");
     }
     if (hmacProvider == null)
     {
         throw new ArgumentNullException("hmacProvider");
     }
     if (sessionIdentificationDataProvider == null)
     {
         throw new ArgumentNullException("configuration");
     }
     if (hmacValidator == null)
     {
         throw new ArgumentNullException("configuration");
     }
     if (sessionIdFactory == null)
     {
         throw new ArgumentNullException("configuration");
     }
     if (responseManipulatorForSession == null)
     {
         throw new ArgumentNullException("responseManipulatorForSession");
     }
     _encryptionProvider = encryptionProvider;
     _hmacProvider       = hmacProvider;
     _sessionIdentificationDataProvider = sessionIdentificationDataProvider;
     _hmacValidator    = hmacValidator;
     _sessionIdFactory = sessionIdFactory;
     _responseManipulatorForSession = responseManipulatorForSession;
     ParameterName = DefaultParameterName;
 }