ValidateHash Class

Summary

Defines a ITask which validates that the cryptographic hash of a file matches the hash provided.
graph TD Base0["FileHashTask"]-->Type click Base0 "/nBuildKit.MsBuild/api/NBuildKit.MsBuild.Tasks.FileSystem/FileHashTask" Base1["BaseTask"]-->Base0 click Base1 "/nBuildKit.MsBuild/api/NBuildKit.MsBuild.Tasks.Core/BaseTask" Base2["Task"]-->Base1 Type["ValidateHash"] class Type type-node

Syntax

public sealed class ValidateHash : FileHashTask

Properties

Name Value Summary
Algorithm string
Gets or sets the algorithm that should be used to calculate the file hash.
Inherited from FileHashTask
ErrorInformation ITaskItem[]
Gets or sets the collection containing the error codes for the task.
Inherited from BaseTask
Hash string
Gets or sets the hexidecimal representation of the expected hash value.
HashFile ITaskItem
Gets or sets the full path of the file containing the expected hash. The file is expected to contain a line with the hash value followed by the name of the file for which the hash is computed.
Path ITaskItem
Gets or sets the full path to the file for which the hash should be validated.

Methods

Name Value Summary
ComputeHash(string) byte[]
Calculates the file has for the given file path with the selected algorithm.
Inherited from FileHashTask
ConvertHashToString(byte[]) string
Converts a byte array containing a hash to a hexadecimal string.
Inherited from FileHashTask
static
ErrorCodeById(string) string
Returns the error code for the given ID.
Inherited from BaseTask
Execute() bool
GetAbsolutePath(ITaskItem) string
Returns the absolute path for the given path item.
Inherited from BaseTask
GetAbsolutePath(ITaskItem, ITaskItem) string
Returns the absolute path for the given path item.
Inherited from BaseTask
GetAbsolutePath(string) string
Returns the absolute path for the given path item.
Inherited from BaseTask
VerbosityForCurrentMsBuildInstance() string
Gets the verbosity that the current MsBuild instance is running at.
Inherited from BaseTask
static