}
#if !NET_2_1
- [MonoTODO]
public XmlElement GetTransportTokenAssertion ()
{
- throw new NotImplementedException ();
+ var doc = new XmlDocument ();
+ var token = doc.CreateElement ("sp", "HttpsToken", PolicyImportHelper.SecurityPolicyNS);
+ token.SetAttribute ("RequireClientCertificate", req_cli_cert ? "true" : "false");
+ return token;
+ }
+
+ // overriden only in full profile
+ public override T GetProperty<T> (BindingContext context)
+ {
+ if (typeof (T) == typeof (ISecurityCapabilities))
+ return (T) (object) new HttpsBindingProperties (this);
+ return base.GetProperty<T> (context);
}
#endif
}
+
+#if !NET_2_1
+ class HttpsBindingProperties : HttpBindingProperties
+ {
+ HttpsTransportBindingElement source;
+
+ public HttpsBindingProperties (HttpsTransportBindingElement source)
+ : base (source)
+ {
+ this.source = source;
+ }
+
+ public override ProtectionLevel SupportedRequestProtectionLevel {
+ get { return ProtectionLevel.EncryptAndSign; }
+ }
+
+ public override ProtectionLevel SupportedResponseProtectionLevel {
+ get { return ProtectionLevel.EncryptAndSign; }
+ }
+
+ public override bool SupportsClientAuthentication {
+ get { return source.RequireClientCertificate || base.SupportsClientAuthentication; }
+ }
+
+ public override bool SupportsServerAuthentication {
+ get { return true; }
+ }
+
+ public override bool SupportsClientWindowsIdentity {
+ get { return source.RequireClientCertificate || base.SupportsClientWindowsIdentity; }
+ }
+ }
+#endif
}