PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/WCFWebApi/src/Microsoft.ApplicationServer.Http/Microsoft/ApplicationServer/Http/HttpBindingSecurity.cs

#
C# | 69 lines | 42 code | 9 blank | 18 comment | 0 complexity | 9f454a0c644b0ca6c594a9920ee9dc12 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
  1. // <copyright>
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. // </copyright>
  4. namespace Microsoft.ApplicationServer.Http
  5. {
  6. using System.ComponentModel;
  7. using System.ServiceModel;
  8. using Microsoft.Server.Common;
  9. /// <summary>
  10. /// Specifies the types of security available to a service endpoint configured to use an
  11. /// <see cref="HttpBinding"/> binding.
  12. /// </summary>
  13. public sealed class HttpBindingSecurity
  14. {
  15. internal const HttpBindingSecurityMode DefaultMode = HttpBindingSecurityMode.None;
  16. private HttpBindingSecurityMode mode;
  17. private HttpTransportSecurity transportSecurity;
  18. /// <summary>
  19. /// Creates a new instance of the <see cref="HttpBindingSecurity"/> class.
  20. /// </summary>
  21. public HttpBindingSecurity()
  22. {
  23. this.mode = DefaultMode;
  24. this.transportSecurity = new HttpTransportSecurity();
  25. }
  26. /// <summary>
  27. /// Gets or sets the mode of security that is used by an endpoint configured to use an
  28. /// <see cref="HttpBinding"/> binding.
  29. /// </summary>
  30. public HttpBindingSecurityMode Mode
  31. {
  32. get
  33. {
  34. return this.mode;
  35. }
  36. set
  37. {
  38. HttpBindingSecurityModeHelper.Validate(value, "value");
  39. this.IsModeSet = true;
  40. this.mode = value;
  41. }
  42. }
  43. /// <summary>
  44. /// Gets or sets an object that contains the transport-level security settings for the
  45. /// <see cref="HttpBinding"/> binding.
  46. /// </summary>
  47. public HttpTransportSecurity Transport
  48. {
  49. get
  50. {
  51. return this.transportSecurity;
  52. }
  53. set
  54. {
  55. this.transportSecurity = value ?? new HttpTransportSecurity();
  56. }
  57. }
  58. internal bool IsModeSet { get; private set; }
  59. }
  60. }