DataProtector.ProviderUnprotect(Byte[]) 메서드

정의

기본 클래스의 Unprotect(Byte[]) 메서드가 다시 호출할 파생 클래스에서 대리자 메서드를 지정합니다.

protected:
 abstract cli::array <System::Byte> ^ ProviderUnprotect(cli::array <System::Byte> ^ encryptedData);
protected abstract byte[] ProviderUnprotect (byte[] encryptedData);
abstract member ProviderUnprotect : byte[] -> byte[]
Protected MustOverride Function ProviderUnprotect (encryptedData As Byte()) As Byte()

매개 변수

encryptedData
Byte[]

암호화되지 않을 데이터입니다.

반환

Byte[]

암호화되지 않은 데이터입니다.

예제

다음 예제에서는 ProviderUnprotect 메서드의 구현을 보여 줍니다. 클래스에 대한 더 큰 코드 예제의 DataProtector 일부입니다.

// To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission
// in the constructor, but Assert the permission when ProviderUnprotect is called..  This is similar to FileStream
// where access is checked at time of creation, not time of use.
[SecuritySafeCritical]
[DataProtectionPermission(SecurityAction.Assert, UnprotectData = true)]
protected override byte[] ProviderUnprotect(byte[] encryptedData)
{

    ProtectedMemory.Unprotect(encryptedData,Scope);
        return encryptedData;
}
' To allow a service to hand out instances of a DataProtector we demand unrestricted DataProtectionPermission 
' in the constructor, but Assert the permission when ProviderUnprotect is called..  This is similar to FileStream
' where access is checked at time of creation, not time of use.
<SecuritySafeCritical(), DataProtectionPermission(SecurityAction.Assert, UnprotectData:=True)> _
Protected Overrides Function ProviderUnprotect(ByVal encryptedData() As Byte) As Byte()

    ProtectedMemory.Unprotect(encryptedData, Scope)
    Return encryptedData

End Function 'ProviderUnprotect

적용 대상