//
using System;
using System.Collections.Generic;
-using System.IdentityModel.Selectors;
-using System.IdentityModel.Tokens;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Security;
+#if !MOBILE
+using System.IdentityModel.Selectors;
+using System.IdentityModel.Tokens;
using System.ServiceModel.Security.Tokens;
+#endif
namespace System.ServiceModel.Description
{
public class ClientCredentials
+#if MOBILE || XAMMAC_4_5
+ : IEndpointBehavior
+#else
: SecurityCredentialsManager, IEndpointBehavior
+#endif
{
public ClientCredentials ()
{
[MonoTODO]
protected ClientCredentials (ClientCredentials source)
{
- throw new NotImplementedException ();
+ userpass = source.userpass.Clone ();
+ digest = source.digest.Clone ();
+ initiator = source.initiator.Clone ();
+ recipient = source.recipient.Clone ();
+ windows = source.windows.Clone ();
+#if !MOBILE
+ issued_token = source.issued_token.Clone ();
+ peer = source.peer.Clone ();
+ support_interactive = source.support_interactive;
+#endif
}
- IssuedTokenClientCredential issued_token =
- new IssuedTokenClientCredential ();
+ UserNamePasswordClientCredential userpass =
+ new UserNamePasswordClientCredential ();
+
HttpDigestClientCredential digest =
new HttpDigestClientCredential ();
X509CertificateInitiatorClientCredential initiator =
new X509CertificateInitiatorClientCredential ();
X509CertificateRecipientClientCredential recipient =
new X509CertificateRecipientClientCredential ();
- UserNamePasswordClientCredential userpass =
- new UserNamePasswordClientCredential ();
WindowsClientCredential windows =
new WindowsClientCredential ();
- PeerCredential peer = new PeerCredential ();
- bool support_interactive = true;
public X509CertificateInitiatorClientCredential ClientCertificate {
get { return initiator; }
get { return digest; }
}
+ public X509CertificateRecipientClientCredential ServiceCertificate {
+ get { return recipient; }
+ }
+
+ public WindowsClientCredential Windows {
+ get { return windows; }
+ }
+
+#if !MOBILE
+ IssuedTokenClientCredential issued_token =
+ new IssuedTokenClientCredential ();
+ PeerCredential peer = new PeerCredential ();
+ bool support_interactive = true;
+
public IssuedTokenClientCredential IssuedToken {
get { return issued_token; }
}
get { return peer; }
}
- public X509CertificateRecipientClientCredential ServiceCertificate {
- get { return recipient; }
- }
-
public bool SupportInteractive {
get { return support_interactive; }
set { support_interactive = value; }
}
+#endif
public UserNamePasswordClientCredential UserName {
get { return userpass; }
}
- public WindowsClientCredential Windows {
- get { return windows; }
- }
-
public ClientCredentials Clone ()
{
ClientCredentials ret = CloneCore ();
return new ClientCredentials (this);
}
+#if !MOBILE && !XAMMAC_4_5
public override SecurityTokenManager CreateSecurityTokenManager ()
{
return new ClientCredentialsSecurityTokenManager (this);
{
throw new NotImplementedException ();
}
+#endif
- [MonoTODO]
- void IEndpointBehavior.AddBindingParameters (ServiceEndpoint endpoint,
- BindingParameterCollection parameters)
+ void IEndpointBehavior.ApplyDispatchBehavior (ServiceEndpoint endpoint,
+ EndpointDispatcher dispatcher)
{
- parameters.Add (this);
+ // documented as to have no effect.
}
- [MonoTODO]
- void IEndpointBehavior.ApplyDispatchBehavior (ServiceEndpoint endpoint,
- EndpointDispatcher dispatcher)
+ void IEndpointBehavior.AddBindingParameters (ServiceEndpoint endpoint,
+ BindingParameterCollection parameters)
{
- throw new NotImplementedException ();
+ parameters.Add (this);
}
[MonoTODO]
- void IEndpointBehavior.ApplyClientBehavior (
+ public virtual void ApplyClientBehavior (
ServiceEndpoint endpoint, ClientRuntime behavior)
{
- //throw new NotImplementedException ();
+ if (endpoint == null)
+ throw new ArgumentNullException ("endpoint");
+ if (behavior == null)
+ throw new ArgumentNullException ("behavior");
+
+ // FIXME: apply to endpoint when there is not security binding element.
}
- [MonoTODO]
void IEndpointBehavior.Validate (ServiceEndpoint endpoint)
{
- throw new NotImplementedException ();
+ // documented as reserved for future use.
}
}
}