DataProtector.PrependHashedPurposeToPlaintext 属性

定义

指定哈希是否已附加到加密前的文本数组。Specifies whether the hash is prepended to the text array before encryption.

protected:
 virtual property bool PrependHashedPurposeToPlaintext { bool get(); };
protected virtual bool PrependHashedPurposeToPlaintext { get; }
member this.PrependHashedPurposeToPlaintext : bool
Protected Overridable ReadOnly Property PrependHashedPurposeToPlaintext As Boolean

属性值

Boolean

总是为 trueAlways true.

注解

默认情况下,假定派生类在加密之前将、和属性的哈希预先预置 ApplicationName PrimaryPurpose SpecificPurposes 到纯文本,并在解密过程中检查并验证哈希。By default, it is assumed that derived classes will prepend the hash of the ApplicationName, PrimaryPurpose, and SpecificPurposes properties to the plain text before encryption, and will check and verify the hash during decryption. 如果派生类需要在其自身的 (上指定预置数据(例如) 可选的熵值),则可以重写此属性,并将其设置为返回 falseIf a derived class wants to specify the prepended data on its own (for example as an optional entropy value), this property can be overridden and set to return false. 如果 PrependHashedPurposeToPlaintextfalse ,则将 Protect Unprotect 直接传递到 ProviderProtect 并重 ProviderUnprotect 写,而不会更改字节数组。If PrependHashedPurposeToPlaintext is false, Protect and Unprotect passes directly through to the ProviderProtect and ProviderUnprotect overrides without altering the byte array.

适用于