InitiatorServiceModelSecurityTokenRequirement.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. using System;
  5. using System.ServiceModel;
  6. using System.Xml;
  7. using System.Collections.Generic;
  8. using System.IdentityModel.Selectors;
  9. using System.Globalization;
  10. using System.Net;
  11. namespace System.ServiceModel.Security.Tokens
  12. {
  13. public sealed class InitiatorServiceModelSecurityTokenRequirement : ServiceModelSecurityTokenRequirement
  14. {
  15. WebHeaderCollection webHeaderCollection;
  16. public InitiatorServiceModelSecurityTokenRequirement()
  17. : base()
  18. {
  19. Properties.Add(IsInitiatorProperty, (object)true);
  20. }
  21. public EndpointAddress TargetAddress
  22. {
  23. get
  24. {
  25. return GetPropertyOrDefault<EndpointAddress>(TargetAddressProperty, null);
  26. }
  27. set
  28. {
  29. this.Properties[TargetAddressProperty] = value;
  30. }
  31. }
  32. public Uri Via
  33. {
  34. get
  35. {
  36. return GetPropertyOrDefault<Uri>(ViaProperty, null);
  37. }
  38. set
  39. {
  40. this.Properties[ViaProperty] = value;
  41. }
  42. }
  43. internal bool IsOutOfBandToken
  44. {
  45. get
  46. {
  47. return GetPropertyOrDefault<bool>(IsOutOfBandTokenProperty, false);
  48. }
  49. set
  50. {
  51. this.Properties[IsOutOfBandTokenProperty] = value;
  52. }
  53. }
  54. internal bool PreferSslCertificateAuthenticator
  55. {
  56. get
  57. {
  58. return GetPropertyOrDefault<bool>(PreferSslCertificateAuthenticatorProperty, false);
  59. }
  60. set
  61. {
  62. this.Properties[PreferSslCertificateAuthenticatorProperty] = value;
  63. }
  64. }
  65. internal WebHeaderCollection WebHeaders
  66. {
  67. get
  68. {
  69. return this.webHeaderCollection;
  70. }
  71. set
  72. {
  73. this.webHeaderCollection = value;
  74. }
  75. }
  76. public override string ToString()
  77. {
  78. return InternalToString();
  79. }
  80. }
  81. }