TrustVersion.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using System.Xml;
  8. namespace System.ServiceModel.Security
  9. {
  10. public abstract class TrustVersion
  11. {
  12. readonly XmlDictionaryString trustNamespace;
  13. readonly XmlDictionaryString prefix;
  14. internal TrustVersion(XmlDictionaryString ns, XmlDictionaryString prefix)
  15. {
  16. this.trustNamespace = ns;
  17. this.prefix = prefix;
  18. }
  19. public XmlDictionaryString Namespace
  20. {
  21. get
  22. {
  23. return this.trustNamespace;
  24. }
  25. }
  26. public XmlDictionaryString Prefix
  27. {
  28. get
  29. {
  30. return this.prefix;
  31. }
  32. }
  33. public static TrustVersion Default
  34. {
  35. get { return WSTrustFeb2005; }
  36. }
  37. public static TrustVersion WSTrustFeb2005
  38. {
  39. get { return WSTrustVersionFeb2005.Instance; }
  40. }
  41. public static TrustVersion WSTrust13
  42. {
  43. get { return WSTrustVersion13.Instance; }
  44. }
  45. class WSTrustVersionFeb2005 : TrustVersion
  46. {
  47. static readonly WSTrustVersionFeb2005 instance = new WSTrustVersionFeb2005();
  48. protected WSTrustVersionFeb2005()
  49. : base(XD.TrustFeb2005Dictionary.Namespace, XD.TrustFeb2005Dictionary.Prefix)
  50. {
  51. }
  52. public static TrustVersion Instance
  53. {
  54. get
  55. {
  56. return instance;
  57. }
  58. }
  59. }
  60. class WSTrustVersion13 : TrustVersion
  61. {
  62. static readonly WSTrustVersion13 instance = new WSTrustVersion13();
  63. protected WSTrustVersion13()
  64. : base(DXD.TrustDec2005Dictionary.Namespace, DXD.TrustDec2005Dictionary.Prefix)
  65. {
  66. }
  67. public static TrustVersion Instance
  68. {
  69. get
  70. {
  71. return instance;
  72. }
  73. }
  74. }
  75. }
  76. }