DataProtector.GetHashedPurpose Method ()

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Creates a hash of the property values specified by the constructor.

Namespace:   System.Security.Cryptography
Assembly:  System.Security (in System.Security.dll)

abstract GetHashedPurpose : unit -> byte[]
override GetHashedPurpose : unit -> byte[]

Return Value

Type: System.Byte[]

An array of bytes that contain the hash of the ApplicationName, PrimaryPurpose, and SpecificPurposes properties.

GetHashedPurpose computes the hash of the application name and the full purpose. The full purpose is a concatenation of all the PrimaryPurpose and SpecificPurposes properties. Each of the three parts is prefaced with its length so the hash can be reversed.

The following example shows how to use the GetHashedPurpose method to hash the purpose properties for use as extra entropy. It is part of a larger code example for the DataProtector class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 4.5
Return to top