C# Класс Tpm2Lib.TpmHash

Наследование: TpmStructureBase, ISignatureUnion
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ISignatureUnion TpmAlgId
ToStringInternal void
TpmHash System

Открытые методы

Метод Описание
AllOnesHash ( TpmAlgId alg ) : TpmHash

Return a TpmHash of the specified algorithm with value set to 0x01010101... Note that this is not a 'real' hash value, but is the initialization value of some resettable PCR

BlockSize ( TpmAlgId hashAlg ) : ushort

Return the hash function block size in bytes

DigestSize ( TpmAlgId hashAlg ) : ushort

Return the length of the output of the hash function in bytes

Equals ( Object obj ) : bool
Event ( byte dataToExtend ) : TpmHash

Replace the hash value with the hash of the concatenation of the current hash value and DataToExtend

Extend ( Object objectToExtend ) : TpmHash

Replace the hash value with the hash of the concatenation of the current value and the TPM representation of objectToExtend

FromData ( TpmAlgId hashAlg, byte dataToHash ) : TpmHash

Return a new TpmHash set to the hash of the supplied data

FromObject ( TpmAlgId hashAlg, Object data ) : TpmHash

Make a new TpmHash from the hash of the TPM representation of data

FromRandom ( TpmAlgId hashAlg ) : TpmHash

Return a new TpmHash that is the hash of random data

FromString ( TpmAlgId hashAlg, string password ) : TpmHash

Return a TpmHash that is the hash of Encoding.Unicode.GetBytes(password)

GetHashCode ( ) : int
GetUnionSelector ( ) : TpmAlgId
TpmHash ( ) : System

Create a new TpmHash with no associated hash algorithm (generally this should only be used prior to object de-serialization)

TpmHash ( TpmAlgId hashAlgId ) : System

Create an all-zeroes TpmHash with the named hash algorithm

TpmHash ( TpmAlgId hashAlg, byte digest ) : System

Create a TpmHash from the provided digest and hash algorithm. The number of bytes in the digest must match the hash size.

ZeroHash ( TpmAlgId alg ) : TpmHash

Return a TpmHash of specified algorithm set to all zeroes

operator ( ) : bool

Returns true if the two hashes are equal, i.e. if both hash algorithms and digests are the same. When this operator is used to compare a hash object with a byte buffer representing digest, the latter is converted to a hash object with its hash algorithm set to null, which excludes the algorithms from comparison).

Приватные методы

Метод Описание
ISignatureUnion ( ) : TpmAlgId
ToStringInternal ( TpmStructPrinter p ) : void
TpmHash ( byte digest ) : System

Create a TpmHash from the provided digest. Intended to be used by the conversion from byte[] operator to construct temporary object hash objects for the purposes of comparison.

Описание методов

AllOnesHash() публичный статический Метод

Return a TpmHash of the specified algorithm with value set to 0x01010101... Note that this is not a 'real' hash value, but is the initialization value of some resettable PCR
public static AllOnesHash ( TpmAlgId alg ) : TpmHash
alg TpmAlgId
Результат TpmHash

BlockSize() публичный статический Метод

Return the hash function block size in bytes
public static BlockSize ( TpmAlgId hashAlg ) : ushort
hashAlg TpmAlgId
Результат ushort

DigestSize() публичный статический Метод

Return the length of the output of the hash function in bytes
public static DigestSize ( TpmAlgId hashAlg ) : ushort
hashAlg TpmAlgId
Результат ushort

Equals() публичный Метод

public Equals ( Object obj ) : bool
obj Object
Результат bool

Event() публичный Метод

Replace the hash value with the hash of the concatenation of the current hash value and DataToExtend
public Event ( byte dataToExtend ) : TpmHash
dataToExtend byte
Результат TpmHash

Extend() публичный Метод

Replace the hash value with the hash of the concatenation of the current value and the TPM representation of objectToExtend
public Extend ( Object objectToExtend ) : TpmHash
objectToExtend Object
Результат TpmHash

FromData() публичный статический Метод

Return a new TpmHash set to the hash of the supplied data
public static FromData ( TpmAlgId hashAlg, byte dataToHash ) : TpmHash
hashAlg TpmAlgId
dataToHash byte
Результат TpmHash

FromObject() публичный статический Метод

Make a new TpmHash from the hash of the TPM representation of data
public static FromObject ( TpmAlgId hashAlg, Object data ) : TpmHash
hashAlg TpmAlgId
data Object
Результат TpmHash

FromRandom() публичный статический Метод

Return a new TpmHash that is the hash of random data
public static FromRandom ( TpmAlgId hashAlg ) : TpmHash
hashAlg TpmAlgId
Результат TpmHash

FromString() публичный статический Метод

Return a TpmHash that is the hash of Encoding.Unicode.GetBytes(password)
public static FromString ( TpmAlgId hashAlg, string password ) : TpmHash
hashAlg TpmAlgId
password string
Результат TpmHash

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

GetUnionSelector() публичный Метод

public GetUnionSelector ( ) : TpmAlgId
Результат TpmAlgId

TpmHash() публичный Метод

Create a new TpmHash with no associated hash algorithm (generally this should only be used prior to object de-serialization)
public TpmHash ( ) : System
Результат System

TpmHash() публичный Метод

Create an all-zeroes TpmHash with the named hash algorithm
public TpmHash ( TpmAlgId hashAlgId ) : System
hashAlgId TpmAlgId
Результат System

TpmHash() публичный Метод

Create a TpmHash from the provided digest and hash algorithm. The number of bytes in the digest must match the hash size.
public TpmHash ( TpmAlgId hashAlg, byte digest ) : System
hashAlg TpmAlgId Hash algorithm used to compute digest
digest byte Byte array representing digest
Результат System

ZeroHash() публичный статический Метод

Return a TpmHash of specified algorithm set to all zeroes
public static ZeroHash ( TpmAlgId alg ) : TpmHash
alg TpmAlgId
Результат TpmHash

operator() публичный статический Метод

Returns true if the two hashes are equal, i.e. if both hash algorithms and digests are the same. When this operator is used to compare a hash object with a byte buffer representing digest, the latter is converted to a hash object with its hash algorithm set to null, which excludes the algorithms from comparison).
public static operator ( ) : bool
Результат bool