How can i enable WCF Data-Encryption

Someone asked on Stack Overflow:

How can I enable the encryption of an WCF (Windows Communication Foundation) Service with VB.NET?

Is it enough to add a certificate to a service an set to “TransportWithMessageCredential”? Or is there any other settings needed?

If this is enough:

What’s with the client? Maybe I’m wrong but I thought the client and the server need a certificate?!

The client can encrypt messages with the server public key. But how does the server encrypt messages to the client? Or does the client generate an symmetric encryptionkey and send it to the server?

I posted the following answer, which was chosen as the accepted answer:

It depends what type of end point you are using. If you are using an HTTP/HTTPS endpoint, simply having a server certificate is sufficient.


Originally posted on Stack Overflow — 0 upvotes (accepted answer). Licensed under CC BY-SA.

signed letter b

Dad. Geek. Gamer. Software developer. Cloud user. Old Car enthusiast.  Blogger.


Top Posts


profile for Nate on Stack Exchange, a network of free, community-driven Q&A sites
a proud member of the blue team of 512KB club
Thoughts, opinions, and ideas shared here are my own. © 2026 Nate Bross.