たぶん↓が一番簡単なWS-SecurityをサポートするBinding
AsymmetricSecurityBindingElement sbe =
new AsymmetricSecurityBindingElement ();
sbe.SecurityHeaderLayout = SecurityHeaderLayout.Lax; // 1.ゆる〜く
sbe.RequireSignatureConfirmation = false; // 2.な〜も確認しない
sbe.LocalServiceSettings.DetectReplays = false; // 3.リプレイなんてシラソ
sbe.IncludeTimestamp = false; // 4.いつ作られたメッセージでもキニシナイ!
sbe.RecipientTokenParameters = new X509SecurityTokenParameters (
X509KeyIdentifierClauseType.Thumbprint,
SecurityTokenInclusionMode.Never);
sbe.InitiatorTokenParameters = new X509SecurityTokenParameters (
X509KeyIdentifierClauseType.Thumbprint,
SecurityTokenInclusionMode.AlwaysToRecipient);
sbe.SetKeyDerivation (false); // 5.鍵なんて毎回同じ奴でおk
sbe.MessageProtectionOrder =
MessageProtectionOrder.SignBeforeEncrypt;
HttpTransportBindingElement hbe =
new HttpTransportBindingElement ();
CustomBinding binding = new CustomBinding (sbe, hbe);
WSHttpBindingなんてク じゃあ、と思った人はどうぞ。<違いすぎ
WSHttpBindingを使うことしか知らない人がここまでたどり着くまでどれくらいかかるかは、まあ、何とも言えない。
これならmonoでもとりあえず通信はできる。あんまし安全じゃないけど。