Share via


DataProtection Class

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

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

Syntax

Public NotInheritable Class DataProtection

Dim instance As DataProtection
public sealed class DataProtection
public ref class DataProtection 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 connection strings as a "display" connection string, which contains no sensitive information, and as an "encrypted" connection string, which is more complete. DDEX uses the methods on this class to encrypt or decrypt these strings.

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

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Data.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 Namespace

DataConnection

DPAPIProtectedConfigurationProvider