Use WSE to Encrypt SOAP packets (4)

Source: Internet
Author: User

Encrypt messages sent externally
Here I will briefly describe how to create a Web service that can return an encrypted XML document. In the first step, use the using indicator to add the necessary namespace, as shown below:
Using System. Web. Services;
Using Microsoft. Web. Services;
Using Microsoft. Web. Services. Security;
Using System. Security. Cryptography;
Using System. Security. Cryptography. Xml;
Using System. Xml;
The GetXmlDocument method uses the. NET framework to implement the ternary DES algorithm. It uses a 128-bit key and a 64-bit initialization vector (IV) to generate a symmetric key. This key will also have a name and be added to the SoapContext element of the response message. Then it will be used by SecurityOutputFilter to encrypt simple XML documents. This method will finally be returned to the client.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.