DataProtection Class

Represents the ability to encrypt and decrypt strings by using the Windows Data Protection API (DPAPI).

Namespace:  Microsoft.VisualStudio.Data.Services
Assembly:  Microsoft.VisualStudio.Data.Services (in Microsoft.VisualStudio.Data.Services.dll)

Syntax

Public NotInheritable Class DataProtection

You do not need to declare an instance of a static class in order to access its members.
public static class DataProtection
public ref class DataProtection abstract sealed
public final class DataProtection

Remarks

When working with data connection strings, Visual Studio tries to keep encrypted data in its encrypted state. In general, the DDEX API represents a connection string as a display connection string, which contains no sensitive information, and as an encrypted connection string, which is more complete. DDEX uses the methods in this class to encrypt or decrypt these strings.

The encryption algorithm used depends on the current user and computer, and as such a string encrypted by using the EncryptString method can only be decrypted by calling the DecryptString method when running as the same user on the same computer.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.Services.DataProtection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

DataProtection Members

Microsoft.VisualStudio.Data.Services Namespace

DPAPIProtectedConfigurationProvider