SecurityTokenHandlerCollection.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.IdentityModel.Selectors;
  5. using System.Security.Claims;
  6. using System.Xml;
  7. namespace System.IdentityModel.Tokens
  8. {
  9. public class SecurityTokenHandlerCollection : Collection<SecurityTokenHandler>
  10. {
  11. private SecurityTokenHandlerConfiguration config;
  12. private IEnumerable<string> tokenTypeIdentifiers = new List<string> ();
  13. private IEnumerable<Type> tokenTypes = new List<Type> ();
  14. public SecurityTokenHandlerConfiguration Configuration { get { return this.config; } }
  15. public IEnumerable<string> TokenTypeIdentifiers { get { return tokenTypeIdentifiers; } }
  16. public IEnumerable<Type> TokenTypes { get { return tokenTypes; } }
  17. public SecurityTokenHandler this[SecurityToken token] {
  18. get {
  19. if (token == null) { return null; }
  20. return this[token.GetType ()];
  21. }
  22. }
  23. [MonoTODO]
  24. public SecurityTokenHandler this[string tokenTypeIdentifier] {
  25. get {
  26. throw new NotImplementedException ();
  27. }
  28. }
  29. [MonoTODO]
  30. public SecurityTokenHandler this[Type tokenType] {
  31. get {
  32. throw new NotImplementedException ();
  33. }
  34. }
  35. public SecurityTokenHandlerCollection ()
  36. : this(new SecurityTokenHandlerConfiguration ())
  37. { }
  38. public SecurityTokenHandlerCollection (SecurityTokenHandlerConfiguration configuration) {
  39. config = configuration;
  40. }
  41. public SecurityTokenHandlerCollection (IEnumerable<SecurityTokenHandler> handlers)
  42. : this (handlers, new SecurityTokenHandlerConfiguration ())
  43. { }
  44. public SecurityTokenHandlerCollection (IEnumerable<SecurityTokenHandler> handlers, SecurityTokenHandlerConfiguration configuration) : this (configuration) {
  45. foreach (var handler in handlers) {
  46. Add (handler);
  47. }
  48. }
  49. [MonoTODO]
  50. public void AddOrReplace(SecurityTokenHandler handler) {
  51. throw new NotImplementedException ();
  52. }
  53. [MonoTODO]
  54. public bool CanReadKeyIdentifierClause(XmlReader reader) {
  55. throw new NotImplementedException ();
  56. }
  57. [MonoTODO]
  58. protected virtual bool CanReadKeyIdentifierClauseCore(XmlReader reader) {
  59. throw new NotImplementedException ();
  60. }
  61. [MonoTODO]
  62. public bool CanReadToken(string tokenString) {
  63. throw new NotImplementedException ();
  64. }
  65. [MonoTODO]
  66. public bool CanReadToken(XmlReader reader) {
  67. throw new NotImplementedException ();
  68. }
  69. [MonoTODO]
  70. public bool CanWriteToken(SecurityToken token) {
  71. throw new NotImplementedException ();
  72. }
  73. [MonoTODO]
  74. protected override void ClearItems() {
  75. throw new NotImplementedException ();
  76. }
  77. [MonoTODO]
  78. public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection() {
  79. throw new NotImplementedException ();
  80. }
  81. [MonoTODO]
  82. public static SecurityTokenHandlerCollection CreateDefaultSecurityTokenHandlerCollection(SecurityTokenHandlerConfiguration configuration) {
  83. throw new NotImplementedException ();
  84. }
  85. [MonoTODO]
  86. public SecurityToken CreateToken(SecurityTokenDescriptor tokenDescriptor) {
  87. throw new NotImplementedException ();
  88. }
  89. [MonoTODO]
  90. protected override void InsertItem(int index, SecurityTokenHandler item) {
  91. throw new NotImplementedException ();
  92. }
  93. [MonoTODO]
  94. public SecurityKeyIdentifierClause ReadKeyIdentifierClause(XmlReader reader) {
  95. throw new NotImplementedException ();
  96. }
  97. [MonoTODO]
  98. protected virtual SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore(XmlReader reader) {
  99. throw new NotImplementedException ();
  100. }
  101. [MonoTODO]
  102. public SecurityToken ReadToken(string tokenString) {
  103. throw new NotImplementedException ();
  104. }
  105. [MonoTODO]
  106. public SecurityToken ReadToken(XmlReader reader) {
  107. throw new NotImplementedException ();
  108. }
  109. [MonoTODO]
  110. protected override void RemoveItem(int index) {
  111. throw new NotImplementedException ();
  112. }
  113. [MonoTODO]
  114. protected override void SetItem(int index, SecurityTokenHandler item) {
  115. throw new NotImplementedException ();
  116. }
  117. [MonoTODO]
  118. public ReadOnlyCollection<ClaimsIdentity> ValidateToken(SecurityToken token) {
  119. throw new NotImplementedException ();
  120. }
  121. [MonoTODO]
  122. public void WriteKeyIdentifierClause(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
  123. throw new NotImplementedException ();
  124. }
  125. [MonoTODO]
  126. protected virtual void WriteKeyIdentifierClauseCore(XmlWriter writer, SecurityKeyIdentifierClause keyIdentifierClause) {
  127. throw new NotImplementedException ();
  128. }
  129. [MonoTODO]
  130. public string WriteToken(SecurityToken token) {
  131. throw new NotImplementedException ();
  132. }
  133. [MonoTODO]
  134. public void WriteToken(XmlWriter writer, SecurityToken token) {
  135. throw new NotImplementedException ();
  136. }
  137. }
  138. }