How can I verify that my WCF message has been signed? I've got my setup running and working just fine, but need to be able to inspect the signature on the server side. How is this done? I'm using MsmqIntegrationBinding, and signing it with an X509Certificate2.
var binding = new MsmqIntegrationBinding(MsmqIntegrationSecurityMode.Transport)
{
SerializationFormat = MsmqMessageSerializationFormat.Binary,
Security = new MsmqIntegrationSecurity()
{
Mode = MsmqIntegrationSecurityMode.Transport,
Transport = new MsmqTransportSecurity()
{
MsmqAuthenticationMode = MsmqAuthenticationMode.Certificate,
MsmqProtectionLevel = System.Net.Security.ProtectionLevel.Sign
}
}
};
EndpointAddress address = new EndpointAddress("myaddress");
ChannelFactory<IMyMessage> channelFactory = new ChannelFactory<IMyMessage>(binding, address);
channelFactory.Credentials.ClientCertificate.Certificate = my_x509certificate2;
IMyMessage channel = channelFactory.CreateChannel();
//create message and send using the channel