I'm trying to add a custom AlgorithmSuite to a WCF Service (SOAP) I host in IIS programmatically. For this I created my own ServiceHostFactory and my own CustomBinding() instance. However 1 thing I can't manage to do is apply my custom AlgorithmSuite, and I don't know the reason why I shouldn't be able to do that. I use the same CustomBinding (+ the same AlgorithmSuite) for a WCF client and it works fine. Here is my complete CustomBinding: var customBinding = new CustomBinding(); AsymmetricSecurityBindingElement sec = (AsymmetricSecurityBindingElement)AsymmetricSecurityBindingElement.CreateMutualCertificateBindingEle ment(MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecuri tyProfile10); sec.DefaultAlgorithmSuite = new MyCustomAlgorithmSuite(); sec.SetKeyDerivation(false); sec.MessageSecurityVersion = MessageSecurityVersion.WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityPro file10; sec.MessageProtectionOrder = MessageProtectionOrder.EncryptBeforeSign; sec.EnableUnsecuredResponse = false; sec.SecurityHeaderLayout = SecurityHeaderLayout.Lax; sec.AllowSerializedSigningTokenOnReply = true; TextMessageEncodingBindingElement enc = new TextMessageEncodingBindingElement(MessageVersion.Soap11, Encoding.UTF8); HttpsTransportBindingElement trans = new HttpsTransportBindingElement(); trans.RequireClientCertificate = true; customBinding.Elements.Add(sec); customBinding.Elements.Add(enc); customBinding.Elements.Add(trans);
What happens is that on runtime I get a ArgumentOutOfRangeException: parameter suite. Thrown by this method: https://referencesource.microsoft.co...cf1,references That assertion implies that I can ONLY use the AlgorithmSuites defined by Microsoft itself. Can I bypass this? Or is there another way to apply MyCustomAlgorithmSuite to the WCF service, if so how?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)