RsaSecurityTokenParameters.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //-----------------------------------------------------------------------------
  4. //-----------------------------------------------------------------------
  5. // <copyright file="UserNameSecurityTokenParameters.cs" company="Microsoft">
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. // </copyright>
  8. //-----------------------------------------------------------------------
  9. namespace System.ServiceModel.Security.Tokens
  10. {
  11. using System.ServiceModel.Security;
  12. using System.ServiceModel;
  13. using System.IdentityModel.Selectors;
  14. using System.IdentityModel.Tokens;
  15. public class RsaSecurityTokenParameters : SecurityTokenParameters
  16. {
  17. protected RsaSecurityTokenParameters(RsaSecurityTokenParameters other)
  18. : base(other)
  19. {
  20. this.InclusionMode = SecurityTokenInclusionMode.Never;
  21. }
  22. public RsaSecurityTokenParameters()
  23. : base()
  24. {
  25. this.InclusionMode = SecurityTokenInclusionMode.Never;
  26. }
  27. internal protected override bool HasAsymmetricKey { get { return true; } }
  28. internal protected override bool SupportsClientAuthentication { get { return true; } }
  29. internal protected override bool SupportsServerAuthentication { get { return true; } }
  30. internal protected override bool SupportsClientWindowsIdentity { get { return false; } }
  31. protected override SecurityTokenParameters CloneCore()
  32. {
  33. return new RsaSecurityTokenParameters(this);
  34. }
  35. internal protected override SecurityKeyIdentifierClause CreateKeyIdentifierClause(SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
  36. {
  37. return this.CreateKeyIdentifierClause<RsaKeyIdentifierClause, RsaKeyIdentifierClause>(token, referenceStyle);
  38. }
  39. protected internal override void InitializeSecurityTokenRequirement(SecurityTokenRequirement requirement)
  40. {
  41. requirement.TokenType = SecurityTokenTypes.Rsa;
  42. requirement.RequireCryptographicToken = true;
  43. requirement.KeyType = SecurityKeyType.AsymmetricKey;
  44. }
  45. }
  46. }