IPersistedDataProtector Interface

An interface that can provide data protection services for data which has been persisted to long-term storage.

Namespace
Microsoft.AspNetCore.DataProtection
Assemblies
  • Microsoft.AspNetCore.DataProtection

Syntax

public interface IPersistedDataProtector : IDataProtector, IDataProtectionProvider
interface Microsoft.AspNetCore.DataProtection.IPersistedDataProtector

Methods

DangerousUnprotect(System.Byte[], System.Boolean, out System.Boolean, out System.Boolean)

Cryptographically unprotects a piece of data, optionally ignoring failures due to revocation of the cryptographic keys used to protect the payload.

Arguments:
  • protectedData (System.Byte<System.Byte>[]) – The protected data to unprotect.
  • ignoreRevocationErrors (System.Boolean) – ‘true’ if the payload should be unprotected even if the cryptographic key used to protect it has been revoked (due to potential compromise), ‘false’ if revocation should fail the unprotect operation.
  • requiresMigration (System.Boolean) – ‘true’ if the data should be reprotected before being persisted back to long-term storage, ‘false’ otherwise. Migration might be requested when the default protection key has changed, for instance.
  • wasRevoked (System.Boolean) – ‘true’ if the cryptographic key used to protect this payload has been revoked, ‘false’ otherwise. Payloads whose keys have been revoked should be treated as suspect unless the application has separate assurance that the payload has not been tampered with.
Return type:

System.Byte<System.Byte>[]

Returns:

The plaintext form of the protected data.

byte[] DangerousUnprotect(byte[] protectedData, bool ignoreRevocationErrors, out bool requiresMigration, out bool wasRevoked)