C# Класс Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrc.PccrcUtility

The PCCRC utility.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
GetHashAlgorithm ( dwHashAlgoV2_Values hashAlgo, HashAlgorithm &hashAlgorithm, HMAC &hmacAlgorithm ) : void

Get the hash algorithm and hmac algorithm for V2.

GetHashAlgorithm ( dwHashAlgo_Values hashAlgo, HashAlgorithm &hashAlgorithm, HMAC &hmacAlgorithm, int &blockHashSize ) : void

Get the hash algorithm and hmac algorithm for V1.

GetHoHoDkBytes ( byte kp, byte hod, dwHashAlgoV2_Values hashAlgo ) : byte[]

Compute the segment HoD.

GetHoHoDkBytes ( byte kp, byte hod, dwHashAlgo_Values hashAlgo ) : byte[]

Compute the segment HoD.

GetHoHoDkString ( byte kp, byte hod, dwHashAlgo_Values hashAlgo ) : string

Compute the segment HoD.

ParseContentInformation ( byte data ) : Content_Information_Data_Structure

Parse the information of the content

ParseContentInformation ( byte data, int &index ) : Content_Information_Data_Structure

Parse the information of the content

ParseContentInformationV2 ( byte data ) : Content_Information_Data_Structure_V2

Parse the information of the content

ParseContentInformationV2 ( byte data, int &index ) : Content_Information_Data_Structure_V2

Parse the information of the content

ReadFile ( string filePath ) : byte[]

Read files from assigned directory.

ToHexString ( byte data ) : string

Transfer a byte array to a hex string. Example from a byte array { 0x0a, 0x0b, 0x0c }, the return is a string 0A0B0C.

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

Метод Описание
GetBytes ( byte buffer, int &index, int count ) : byte[]

Get bytes from bytes.

GetDataSizeByHashAlgo ( dwHashAlgo_Values dwHashAlgo ) : int

Get data size by hash algorithm.

GetUInt16 ( byte buffer, int &index ) : ushort

Parse UInt16 from bytes.

GetUInt32 ( byte buffer, int &index ) : uint

Parse UInt32 from bytes

GetUInt64 ( byte buffer, int &index ) : ulong

Parse UInt64 from bytes.

ParseBlocks ( dwHashAlgo_Values dwHashAlgo, uint cSegments, byte data, int &index ) : Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrc.SegmentContentBlocks[]

Parse the information of the block.

ParseSements ( dwHashAlgo_Values dwHashAlgo, uint cSegments, byte data, int &index ) : Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrc.SegmentDescription[]

Parse the information of segment.

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

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

Get the hash algorithm and hmac algorithm for V2.
public static GetHashAlgorithm ( dwHashAlgoV2_Values hashAlgo, HashAlgorithm &hashAlgorithm, HMAC &hmacAlgorithm ) : void
hashAlgo dwHashAlgoV2_Values The hash algorithm value
hashAlgorithm System.Security.Cryptography.HashAlgorithm
hmacAlgorithm System.Security.Cryptography.HMAC
Результат void

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

Get the hash algorithm and hmac algorithm for V1.
public static GetHashAlgorithm ( dwHashAlgo_Values hashAlgo, HashAlgorithm &hashAlgorithm, HMAC &hmacAlgorithm, int &blockHashSize ) : void
hashAlgo dwHashAlgo_Values The hash algorithm value
hashAlgorithm System.Security.Cryptography.HashAlgorithm
hmacAlgorithm System.Security.Cryptography.HMAC
blockHashSize int
Результат void

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

Compute the segment HoD.
public static GetHoHoDkBytes ( byte kp, byte hod, dwHashAlgoV2_Values hashAlgo ) : byte[]
kp byte The Kp data
hod byte The segment HoD
hashAlgo dwHashAlgoV2_Values The HoHoDk hash algorithm.
Результат byte[]

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

Compute the segment HoD.
public static GetHoHoDkBytes ( byte kp, byte hod, dwHashAlgo_Values hashAlgo ) : byte[]
kp byte The Kp data
hod byte The segment HoD
hashAlgo dwHashAlgo_Values The HoHoDk hash algorithm.
Результат byte[]

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

Compute the segment HoD.
public static GetHoHoDkString ( byte kp, byte hod, dwHashAlgo_Values hashAlgo ) : string
kp byte The Kp data
hod byte The segment HoD
hashAlgo dwHashAlgo_Values The HoHoDk hash algorithm.
Результат string

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

Parse the information of the content
public static ParseContentInformation ( byte data ) : Content_Information_Data_Structure
data byte The byte data in little-endian order.
Результат Content_Information_Data_Structure

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

Parse the information of the content
public static ParseContentInformation ( byte data, int &index ) : Content_Information_Data_Structure
data byte The byte data in little-endian order.
index int The start index.
Результат Content_Information_Data_Structure

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

Parse the information of the content
public static ParseContentInformationV2 ( byte data ) : Content_Information_Data_Structure_V2
data byte The byte data in little-endian order.
Результат Content_Information_Data_Structure_V2

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

Parse the information of the content
public static ParseContentInformationV2 ( byte data, int &index ) : Content_Information_Data_Structure_V2
data byte The byte data in little-endian order.
index int The start index.
Результат Content_Information_Data_Structure_V2

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

Read files from assigned directory.
public static ReadFile ( string filePath ) : byte[]
filePath string The file path.
Результат byte[]

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

Transfer a byte array to a hex string. Example from a byte array { 0x0a, 0x0b, 0x0c }, the return is a string 0A0B0C.
public static ToHexString ( byte data ) : string
data byte The input byte array
Результат string