disable broken tests on net_4_0
[mcs.git] / class / System.ServiceModel / System.ServiceModel.Security.Tokens / SecurityTokenParameters.cs
blob39b0fdcceb7e2d98c3edfa6d2604ab3bebb4a8c3
1 //
2 // SecurityTokenParameters.cs
3 //
4 // Author:
5 // Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2006 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.
28 using System.IdentityModel.Selectors;
29 using System.IdentityModel.Tokens;
30 using System.ServiceModel.Channels;
31 using System.ServiceModel.Security;
33 namespace System.ServiceModel.Security.Tokens
35 public abstract class SecurityTokenParameters
37 protected SecurityTokenParameters ()
41 protected SecurityTokenParameters (SecurityTokenParameters source)
45 SecurityTokenInclusionMode inclusion_mode;
46 SecurityTokenReferenceStyle reference_style;
47 bool require_derived_keys = true;
48 BindingContext issuer_binding_context;
50 public SecurityTokenInclusionMode InclusionMode {
51 get { return inclusion_mode; }
52 set { inclusion_mode = value; }
55 public SecurityTokenReferenceStyle ReferenceStyle {
56 get { return reference_style; }
57 set { reference_style = value; }
60 public bool RequireDerivedKeys {
61 get { return require_derived_keys; }
62 set { require_derived_keys = value; }
65 public SecurityTokenParameters Clone ()
67 return CloneCore ();
70 [MonoTODO]
71 public override string ToString ()
73 return base.ToString ();
76 protected abstract bool HasAsymmetricKey { get; }
78 protected abstract bool SupportsClientAuthentication { get; }
80 protected abstract bool SupportsClientWindowsIdentity { get; }
82 protected abstract bool SupportsServerAuthentication { get; }
84 internal bool InternalHasAsymmetricKey {
85 get { return HasAsymmetricKey; }
88 internal bool InternalSupportsClientAuthentication {
89 get { return SupportsClientAuthentication; }
92 internal bool InternalSupportsClientWindowsIdentity {
93 get { return SupportsClientWindowsIdentity; }
96 internal bool InternalSupportsServerAuthentication {
97 get { return SupportsServerAuthentication; }
100 protected abstract SecurityTokenParameters CloneCore ();
102 protected abstract SecurityKeyIdentifierClause CreateKeyIdentifierClause (
103 SecurityToken token, SecurityTokenReferenceStyle referenceStyle);
105 // internalized call to CreateKeyIdentifierClause()
106 internal SecurityKeyIdentifierClause CallCreateKeyIdentifierClause (
107 SecurityToken token, SecurityTokenReferenceStyle referenceStyle)
109 return CreateKeyIdentifierClause (token, referenceStyle);
112 protected abstract void InitializeSecurityTokenRequirement (SecurityTokenRequirement requirement);
114 internal BindingContext IssuerBindingContext {
115 set { issuer_binding_context = value; }
118 internal void CallInitializeSecurityTokenRequirement (SecurityTokenRequirement requirement)
120 if (issuer_binding_context != null)
121 requirement.Properties [ServiceModelSecurityTokenRequirement.IssuerBindingContextProperty] = issuer_binding_context;
122 InitializeSecurityTokenRequirement (requirement);
125 [MonoTODO]
126 protected virtual bool MatchesKeyIdentifierClause (
127 SecurityToken token,
128 SecurityKeyIdentifierClause keyIdentifierClause,
129 SecurityTokenReferenceStyle referenceStyle)
131 throw new NotImplementedException ();