SecurityTokenSerializer.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. //
  2. // SecurityTokenSerializer.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005 Novell, Inc. http://www.novell.com
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining
  10. // a copy of this software and associated documentation files (the
  11. // "Software"), to deal in the Software without restriction, including
  12. // without limitation the rights to use, copy, modify, merge, publish,
  13. // distribute, sublicense, and/or sell copies of the Software, and to
  14. // permit persons to whom the Software is furnished to do so, subject to
  15. // the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  24. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. //
  28. using System;
  29. using System.Collections.Generic;
  30. using System.IdentityModel.Selectors;
  31. using System.IdentityModel.Tokens;
  32. using System.Xml;
  33. namespace System.IdentityModel.Selectors
  34. {
  35. public abstract class SecurityTokenSerializer
  36. {
  37. protected SecurityTokenSerializer ()
  38. {
  39. }
  40. [MonoTODO]
  41. public bool CanReadKeyIdentifier (XmlReader reader)
  42. {
  43. return CanReadKeyIdentifierCore (reader);
  44. }
  45. [MonoTODO]
  46. public bool CanReadKeyIdentifierClause (XmlReader reader)
  47. {
  48. return CanReadKeyIdentifierClauseCore (reader);
  49. }
  50. [MonoTODO]
  51. public bool CanReadToken (XmlReader reader)
  52. {
  53. return CanReadTokenCore (reader);
  54. }
  55. [MonoTODO]
  56. public SecurityKeyIdentifier ReadKeyIdentifier (
  57. XmlReader reader)
  58. {
  59. return ReadKeyIdentifierCore (reader);
  60. }
  61. [MonoTODO]
  62. public SecurityKeyIdentifierClause ReadKeyIdentifierClause (
  63. XmlReader reader)
  64. {
  65. return ReadKeyIdentifierClauseCore (reader);
  66. }
  67. [MonoTODO]
  68. public SecurityToken ReadToken (
  69. XmlReader reader,
  70. SecurityTokenResolver tokenResolver)
  71. {
  72. return ReadTokenCore (reader, tokenResolver);
  73. }
  74. [MonoTODO]
  75. public bool CanWriteKeyIdentifier (
  76. SecurityKeyIdentifier keyIdentifier)
  77. {
  78. return CanWriteKeyIdentifierCore (keyIdentifier);
  79. }
  80. [MonoTODO]
  81. public bool CanWriteKeyIdentifierClause (
  82. SecurityKeyIdentifierClause keyIdentifierClause)
  83. {
  84. return CanWriteKeyIdentifierClauseCore (keyIdentifierClause);
  85. }
  86. [MonoTODO]
  87. public bool CanWriteToken (SecurityToken token)
  88. {
  89. return CanWriteTokenCore (token);
  90. }
  91. [MonoTODO]
  92. public void WriteKeyIdentifier (
  93. XmlWriter writer,
  94. SecurityKeyIdentifier keyIdentifier)
  95. {
  96. WriteKeyIdentifierCore (writer, keyIdentifier);
  97. }
  98. [MonoTODO]
  99. public void WriteKeyIdentifierClause (
  100. XmlWriter writer,
  101. SecurityKeyIdentifierClause keyIdentifierClause)
  102. {
  103. WriteKeyIdentifierClauseCore (writer, keyIdentifierClause);
  104. }
  105. [MonoTODO]
  106. public void WriteToken (
  107. XmlWriter writer, SecurityToken token)
  108. {
  109. WriteTokenCore (writer, token);
  110. }
  111. protected abstract bool CanReadKeyIdentifierClauseCore (XmlReader reader);
  112. protected abstract bool CanReadKeyIdentifierCore (XmlReader reader);
  113. protected abstract bool CanReadTokenCore (XmlReader reader);
  114. protected abstract SecurityKeyIdentifier ReadKeyIdentifierCore (
  115. XmlReader reader);
  116. protected abstract SecurityKeyIdentifierClause ReadKeyIdentifierClauseCore (
  117. XmlReader reader);
  118. protected abstract SecurityToken ReadTokenCore (
  119. XmlReader reader,
  120. SecurityTokenResolver tokenResolver);
  121. protected abstract bool CanWriteKeyIdentifierCore (
  122. SecurityKeyIdentifier keyIdentifier);
  123. protected abstract bool CanWriteKeyIdentifierClauseCore (
  124. SecurityKeyIdentifierClause keyIdentifierClause);
  125. protected abstract bool CanWriteTokenCore (SecurityToken token);
  126. protected abstract void WriteKeyIdentifierCore (
  127. XmlWriter writer,
  128. SecurityKeyIdentifier keyIdentifier);
  129. protected abstract void WriteKeyIdentifierClauseCore (
  130. XmlWriter writer,
  131. SecurityKeyIdentifierClause keyIdentifierClause);
  132. protected abstract void WriteTokenCore (
  133. XmlWriter writer, SecurityToken token);
  134. }
  135. }