Übersetzung vorschlagen
 
Andere Vorschläge:

progress indicator
Keine anderen Vorschläge
Per Mausklick bewerten und Feedback geben
MSDN
MSDN Library
.NET Entwicklung
.NET Framework 4
System.Configuration
Alle reduzieren/Alle erweitern Alle reduzieren
Inhalt anzeigen:  Englisch mit deutscher ÜbersetzungInhalt anzeigen: Englisch mit deutscher Übersetzung
.NET Framework Class Library
DpapiProtectedConfigurationProvider Class

Provides a ProtectedConfigurationProvider object that uses the Windows data protection API (DPAPI) to encrypt and decrypt configuration data.

System..::.Object
  System.Configuration.Provider..::.ProviderBase
    System.Configuration..::.ProtectedConfigurationProvider
      System.Configuration..::.DpapiProtectedConfigurationProvider

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)
Visual Basic
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public NotInheritable Class DpapiProtectedConfigurationProvider _
    Inherits ProtectedConfigurationProvider
C#
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public sealed class DpapiProtectedConfigurationProvider : ProtectedConfigurationProvider
Visual C++
[PermissionSetAttribute(SecurityAction::Demand, Name = L"FullTrust")]
public ref class DpapiProtectedConfigurationProvider sealed : public ProtectedConfigurationProvider
F#
[<Sealed>]
[<PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")>]
type DpapiProtectedConfigurationProvider =  
    class
        inherit ProtectedConfigurationProvider
    end

The DpapiProtectedConfigurationProvider type exposes the following members.

  NameDescription
Public methodDpapiProtectedConfigurationProviderInitializes a new instance of the DpapiProtectedConfigurationProvider class using default settings.
Top
  NameDescription
Public propertyDescriptionGets a brief, friendly description suitable for display in administrative tools or other user interfaces (UIs). (Inherited from ProviderBase.)
Public propertyNameGets the friendly name used to refer to the provider during configuration. (Inherited from ProviderBase.)
Public propertyUseMachineProtectionGets a value that indicates whether the DpapiProtectedConfigurationProvider object is using machine-specific or user-account-specific protection.
Top
  NameDescription
Public methodDecryptDecrypts the passed XmlNode object. (Overrides ProtectedConfigurationProvider..::.Decrypt(XmlNode).)
Public methodEncryptEncrypts the passed XmlNode object. (Overrides ProtectedConfigurationProvider..::.Encrypt(XmlNode).)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeInitializes the provider with default settings. (Overrides ProviderBase..::.Initialize(String, NameValueCollection).)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The DpapiProtectedConfigurationProvider allows you to protect sensitive information stored in a configuration file from unauthorized access.

You use the standard DpapiProtectedConfigurationProvider by declaring the provider and appropriate settings in the configuration file rather than creating an instance of this class. Refer to the next example.

For more information about Protected Configuration, see Encrypting Configuration Information Using Protected Configuration.

The DpapiProtectedConfigurationProvider uses the Windows built-in cryptographic services and can be configured for either machine-specific or user-account-specific protection. Machine-specific protection is useful for anonymous services but provides less security. User-account-specific protection can be used with services that run with a specific user identity.

The following example shows how to use the standard DpapiProtectedConfigurationProvider to protect or unprotect a configuration section.

The following configuration excerpts show the configuration section before and after the protection has been applied.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="NorthwindConnectionString" 
      connectionString="Data Source=webnetue2;Initial Catalog=Northwind;User ID=aspnet_test;Password=test"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <EncryptedData>
      <CipherData>                <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAcAMh0jIC1kigyFfd9AUZfQQAAAACAAAAAAADZgAAqAAAABAAAADQwbQ2DgIgIlqskE1RI9UpAAAAAASAAACgAAAAEAAAAAXlYBxi3jhM6wv4sxLhugsQAgAAgoReHZS2406dc/AyRDd6WuNr4ihHn6fbipd4tzHEmeuyS4o4fS4CmT3jMt/WjsP/kR7TF4ygwr2GG47podK79ECpVCZHAgctCauCYjE2Ls3iphKXy/pHic2o6aaClt/xPm+fb4OfODv6XjrJhJzGK2lqUPXkyJN1w2zwh6OVpDQF9N8vTyxL4eitp35/M5zYbW7e6VVAgYUOxlNxgCV5+jXpUKh/rPovopTD392u8KavqQFW1iu+gBPSPq/xeZNz+qYMKbUl+r4VTzBQg3fPlRxp1lNZmM2yRgUbkYPNaFb9ihS7GAg5/wZn8lLmThvq39eA0Vlp6hDE92iop885umELt0/NBKf5umQCqqz9EXXLbmmGc7qoLqTaYVuOmqx0LsvrJL0wSL1dSySCjmB/dNAtVUYgg02eWQNKyaLqnpMdCbTLLQ/oCKuNkL5OQ7t1yl5wQGjQhieIRzLtrMgpTSyaHbqDsRurp9Bc5mM078IAg1hXquQNKlJC/wiJ9kbHerFCbtuLGy/7nXVrFH91ud4U4ExCJEuhoTdmuql5kbqYd6Ye/bu2CftPni19nDkSJ8w4NoqMNKbK3Mi/Cd0o113HsVYlETMv1vlJWZWYP91PK9trixiY4E0G81c6IKITjHDrOJ9evdw2T1/TrvY6pzre3UXSJbFMDQVX6JoAxFk02SRZDKOZdRojeoX19lgrFAAAABzjlz3Qg2as3vn7MRQVxDfZucgE</CipherValue>
      </CipherData>
    </EncryptedData>
  </connectionStrings>
  <configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
    <providers>
      <clear />
      <add keyContainerName="NetFrameworkConfigurationKey" cspProviderName=""
        useMachineContainer="true" useOAEP="false" description="Uses RsaCryptoServiceProvider to encrypt and decrypt"
        name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add useMachineProtection="true" description="Uses CryptProtectData and CryptUnProtectData Windows APIs to encrypt and decrypt"
        keyEntropy="" name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
  </configProtectedData>
</configuration>

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
.NET Framework-Klassenbibliothek
DpapiProtectedConfigurationProvider-Klasse

Stellt ein ProtectedConfigurationProvider-Objekt bereit, das die Windows Data Protection API (DPAPI) zum Verschlüsseln und Entschlüsseln von Konfigurationsdaten verwendet.

System..::.Object
  System.Configuration.Provider..::.ProviderBase
    System.Configuration..::.ProtectedConfigurationProvider
      System.Configuration..::.DpapiProtectedConfigurationProvider

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)
Visual Basic
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public NotInheritable Class DpapiProtectedConfigurationProvider _
    Inherits ProtectedConfigurationProvider
C#
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public sealed class DpapiProtectedConfigurationProvider : ProtectedConfigurationProvider
Visual C++
[PermissionSetAttribute(SecurityAction::Demand, Name = L"FullTrust")]
public ref class DpapiProtectedConfigurationProvider sealed : public ProtectedConfigurationProvider
F#
[<Sealed>]
[<PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")>]
type DpapiProtectedConfigurationProvider =  
    class
        inherit ProtectedConfigurationProvider
    end

Der DpapiProtectedConfigurationProvider-Typ macht die folgenden Member verfügbar.

  NameBeschreibung
Öffentliche MethodeDpapiProtectedConfigurationProviderInitialisiert eine neue Instanz der DpapiProtectedConfigurationProvider-Klasse mithilfe von Standardeinstellungen.
Zum Seitenanfang
  NameBeschreibung
Öffentliche EigenschaftDescriptionRuft eine kurze, benutzerfreundliche Beschreibung ab, die für die Anzeige in Verwaltungstools oder anderen Benutzeroberflächen geeignet ist. (Von ProviderBase geerbt.)
Öffentliche EigenschaftNameRuft den Anzeigennamen ab, der verwendet wird, um während der Konfiguration auf den Anbieter zu verweisen. (Von ProviderBase geerbt.)
Öffentliche EigenschaftUseMachineProtectionRuft einen Wert ab, der angibt, ob das DpapiProtectedConfigurationProvider-Objekt computerspezifischen oder benutzerkontospezifischen Schutz verwendet.
Zum Seitenanfang
  NameBeschreibung
Öffentliche MethodeDecryptEntschlüsselt das übergebene XmlNode-Objekt. (Überschreibt ProtectedConfigurationProvider..::.Decrypt(XmlNode).)
Öffentliche MethodeEncryptVerschlüsselt das übergebene XmlNode-Objekt. (Überschreibt ProtectedConfigurationProvider..::.Encrypt(XmlNode).)
Öffentliche MethodeEquals(Object)Bestimmt, ob das angegebene Object und das aktuelle Object gleich sind. (Von Object geerbt.)
Geschützte MethodeFinalizeGibt einem Objekt Gelegenheit zu dem Versuch, Ressourcen freizugeben und andere Bereinigungen durchzuführen, bevor es von der Garbage Collection freigegeben wird. (Von Object geerbt.)
Öffentliche MethodeGetHashCodeFungiert als Hashfunktion für einen bestimmten Typ. (Von Object geerbt.)
Öffentliche MethodeGetTypeRuft den Type der aktuellen Instanz ab. (Von Object geerbt.)
Öffentliche MethodeInitializeInitialisiert den Anbieter mit Standardeinstellungen. (Überschreibt ProviderBase..::.Initialize(String, NameValueCollection).)
Geschützte MethodeMemberwiseCloneErstellt eine flache Kopie des aktuellen Object. (Von Object geerbt.)
Öffentliche MethodeToStringGibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Von Object geerbt.)
Zum Seitenanfang

Mit dem DpapiProtectedConfigurationProvider können Sie vertrauliche Informationen, die in einer Konfigurationsdatei gespeichert sind, vor unberechtigtem Zugriff schützen.

Anstatt eine Instanz dieser Klasse zu erstellen, sollten Sie den Standard-DpapiProtectedConfigurationProvider verwenden, indem Sie den Anbieter und die entsprechenden Einstellungen in der Konfigurationsdatei deklarieren. Weitere Informationen dazu finden Sie im folgenden Beispiel.

Weitere Informationen über die geschützte Konfiguration finden Sie unter Verschlüsseln von Konfigurationsinformationen mithilfe der geschützten Konfiguration.

Der DpapiProtectedConfigurationProvider verwendet die integrierten Kryptografiedienste in Windows und kann entweder für einen computerspezifischen oder einen benutzerkontospezifischen Schutz konfiguriert werden. Computerspezifischer Schutz ist sinnvoll für anonyme Dienste, bietet aber weniger Sicherheit. Benutzerkontospezifischer Schutz kann mit Diensten verwendet werden, die mit einer bestimmten Benutzeridentität ausgeführt werden.

Im folgenden Beispiel wird veranschaulicht, wie der Standard-DpapiProtectedConfigurationProvider verwendet wird, um einen Konfigurationsabschnitt zu schützen oder den Schutz aufzuheben.

Die folgenden Konfigurationsauszüge zeigen den Konfigurationsabschnitt, bevor der Schutz angewendet wurde bzw. danach.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="NorthwindConnectionString" 
      connectionString="Data Source=webnetue2;Initial Catalog=Northwind;User ID=aspnet_test;Password=test"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <connectionStrings>
    <EncryptedData>
      <CipherData>                <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAcAMh0jIC1kigyFfd9AUZfQQAAAACAAAAAAADZgAAqAAAABAAAADQwbQ2DgIgIlqskE1RI9UpAAAAAASAAACgAAAAEAAAAAXlYBxi3jhM6wv4sxLhugsQAgAAgoReHZS2406dc/AyRDd6WuNr4ihHn6fbipd4tzHEmeuyS4o4fS4CmT3jMt/WjsP/kR7TF4ygwr2GG47podK79ECpVCZHAgctCauCYjE2Ls3iphKXy/pHic2o6aaClt/xPm+fb4OfODv6XjrJhJzGK2lqUPXkyJN1w2zwh6OVpDQF9N8vTyxL4eitp35/M5zYbW7e6VVAgYUOxlNxgCV5+jXpUKh/rPovopTD392u8KavqQFW1iu+gBPSPq/xeZNz+qYMKbUl+r4VTzBQg3fPlRxp1lNZmM2yRgUbkYPNaFb9ihS7GAg5/wZn8lLmThvq39eA0Vlp6hDE92iop885umELt0/NBKf5umQCqqz9EXXLbmmGc7qoLqTaYVuOmqx0LsvrJL0wSL1dSySCjmB/dNAtVUYgg02eWQNKyaLqnpMdCbTLLQ/oCKuNkL5OQ7t1yl5wQGjQhieIRzLtrMgpTSyaHbqDsRurp9Bc5mM078IAg1hXquQNKlJC/wiJ9kbHerFCbtuLGy/7nXVrFH91ud4U4ExCJEuhoTdmuql5kbqYd6Ye/bu2CftPni19nDkSJ8w4NoqMNKbK3Mi/Cd0o113HsVYlETMv1vlJWZWYP91PK9trixiY4E0G81c6IKITjHDrOJ9evdw2T1/TrvY6pzre3UXSJbFMDQVX6JoAxFk02SRZDKOZdRojeoX19lgrFAAAABzjlz3Qg2as3vn7MRQVxDfZucgE</CipherValue>
      </CipherData>
    </EncryptedData>
  </connectionStrings>
  <configProtectedData defaultProvider="RsaProtectedConfigurationProvider">
    <providers>
      <clear />
      <add keyContainerName="NetFrameworkConfigurationKey" cspProviderName=""
        useMachineContainer="true" useOAEP="false" description="Uses RsaCryptoServiceProvider to encrypt and decrypt"
        name="RsaProtectedConfigurationProvider" type="System.Configuration.RsaProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add useMachineProtection="true" description="Uses CryptProtectData and CryptUnProtectData Windows APIs to encrypt and decrypt"
        keyEntropy="" name="DataProtectionConfigurationProvider" type="System.Configuration.DpapiProtectedConfigurationProvider,System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
  </configProtectedData>
</configuration>

.NET Framework

Unterstützt in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Unterstützt in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 oder höher, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core wird nicht unterstützt), Windows Server 2008 R2 (Server Core wird mit SP1 oder höher unterstützt), Windows Server 2003 SP2

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.
Alle öffentlichen static (Shared in Visual Basic)-Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.
Communityinhalt   Was ist Community Content?
Neuen Inhalt hinzufügen RSS  Anmerkungen
Processing
© 2012 Microsoft. Alle Rechte vorbehalten. Nutzungsbedingungen | Markenzeichen | Informationen zur Datensicherheit
Page view tracker