Partilhar via


Cryptographic Agility in WCF Security

This sample shows how to specify in a standard/custom algorithm to provide a cryptographic agile implementation in a Windows Communication Foundation (WCF) client and service. The sample is composed of the following projects:

  • Service
    This is a self-hosted WCF service that implements the ICalculator interface and secures the endpoint using the WsHttpBinding with secure session and reliable session disabled. The service defines a custom SecurityAlgorithmSuite class to specify the cryptographic algorithms to be used for message security.
  • Client
    This is a WCFclient that accesses the service after successful authentication. It invokes the operations exposed by the ICalculator interface and implemented by the service. The client also defines the same custom SecurityAlgorithmSuite class to specify the cryptographic algorithms to be used for message security.

To use this sample

  1. Open the CryptoAgility.sln solution in Visual Studio 2010.

  2. Press CTRL+SHIFT+B to build the solution.

  3. Open Windows Explorer and navigate to the \WCF\Basic\Security\CryptoAgility\Service\bin directory and run the service.exe file with administrator privileges by right-clicking service.exe and selecting Run as administrator.

  4. Navigate to \WCF\Basic\Security\CryptoAgility\Client\bin directory and run the client.exe file normally.

Ee624147.Important(en-us,VS.100).gif Note:
The samples may already be installed on your machine. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WCF\Basic\Security\CryptoAgility

See Also

Other Resources

Windows Communication Foundation Security