Dela via


DataProtectionAdvancedExtensions.Unprotect Method

Definition

Cryptographically unprotects a piece of protected data.

public:
[System::Runtime::CompilerServices::Extension]
 static System::String ^ Unprotect(Microsoft::AspNetCore::DataProtection::ITimeLimitedDataProtector ^ protector, System::String ^ protectedData, [Runtime::InteropServices::Out] DateTimeOffset % expiration);
public static string Unprotect (this Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector protector, string protectedData, out DateTimeOffset expiration);
static member Unprotect : Microsoft.AspNetCore.DataProtection.ITimeLimitedDataProtector * string * DateTimeOffset -> string
<Extension()>
Public Function Unprotect (protector As ITimeLimitedDataProtector, protectedData As String, ByRef expiration As DateTimeOffset) As String

Parameters

protector
ITimeLimitedDataProtector

The protector to use.

protectedData
String

The protected data to unprotect.

expiration
DateTimeOffset

An 'out' parameter which upon a successful unprotect operation receives the expiration date of the payload.

Returns

The plaintext form of the protected data.

Exceptions

Thrown if protectedData is invalid, malformed, or expired.

Applies to