C# Class Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pccrr.PccrrUtitlity

Utitlity of pccrr.
ファイルを表示 Open project: Microsoft/WindowsProtocolTestSuites Class Usage Examples

Public Methods

Method Description
CreateAes ( CryptoAlgoId_Values cryptoAlgoId ) : Aes

Creates Aes instance based on specified algorithm.

CreateMessageHeader ( CryptoAlgoId_Values cryptoAlgoIdValues, MsgType_Values msgTypeValues, ProtoVersion protoVer ) : MESSAGE_HEADER

Create MessageHeader.

DecodeRequestMessage ( byte rawdata, Uri uri, HttpMethod method ) : PccrrPacket

Decode request message.

DecodeResponseMessage ( byte rawdata ) : PccrrPacket

Decode response message.

Decrypt ( Aes aes, byte encrypted, byte key, byte iv ) : byte[]

Decrypts data.

Encrypt ( Aes aes, byte content, byte key, byte iv ) : byte[]

Encrypts data.

MergeBytesArray ( byte buffer ) : byte[]

Merge bytes array to byte array

ToByteArray ( string str ) : byte[]

Convert to byte array.

Private Methods

Method Description
DecodeMSG_BLK ( byte data, int &index ) : MSG_BLK

Decode MSG_BLK message.

DecodeMSG_BLKLIST ( byte data, int &index ) : MSG_BLKLIST

Decode MSG_BLKLIST message.

DecodeMSG_GETBLKLIST ( byte data, int &index ) : MSG_GETBLKLIST

Decode MSG_GETBLKLIST message

DecodeMSG_GETBLKS ( byte data, int &index ) : MSG_GETBLKS

Decode MSG_GETBLKS message.

DecodeMSG_NEGO_REQ ( byte data, int &index ) : MSG_NEGO_REQ

Decode MSG_NEGO_REQ message.

DecodeMSG_NEGO_RESP ( byte data, int &index ) : MSG_NEGO_RESP

Decode MSG_NEGO_RESP message.

DecodeMessageHeader ( byte data, int &index ) : MESSAGE_HEADER

Decode message header.

Method Details

CreateAes() public static method

Creates Aes instance based on specified algorithm.
public static CreateAes ( CryptoAlgoId_Values cryptoAlgoId ) : Aes
cryptoAlgoId CryptoAlgoId_Values Algorithm ID.
return System.Security.Cryptography.Aes

CreateMessageHeader() public static method

Create MessageHeader.
public static CreateMessageHeader ( CryptoAlgoId_Values cryptoAlgoIdValues, MsgType_Values msgTypeValues, ProtoVersion protoVer ) : MESSAGE_HEADER
cryptoAlgoIdValues CryptoAlgoId_Values The cryptoAlgoIdValues.
msgTypeValues MsgType_Values The msgTypeValues.
protoVer ProtoVersion The protoVer.
return MESSAGE_HEADER

DecodeRequestMessage() public method

Decode request message.
public DecodeRequestMessage ( byte rawdata, Uri uri, HttpMethod method ) : PccrrPacket
rawdata byte The raw data.
uri System.Uri The request uri.
method HttpMethod The request method.
return PccrrPacket

DecodeResponseMessage() public method

Decode response message.
public DecodeResponseMessage ( byte rawdata ) : PccrrPacket
rawdata byte The raw data.
return PccrrPacket

Decrypt() public static method

Decrypts data.
public static Decrypt ( Aes aes, byte encrypted, byte key, byte iv ) : byte[]
aes System.Security.Cryptography.Aes Aes object.
encrypted byte Encrypted data to be decrypted.
key byte Encryption key.
iv byte Initial vector.
return byte[]

Encrypt() public static method

Encrypts data.
public static Encrypt ( Aes aes, byte content, byte key, byte iv ) : byte[]
aes System.Security.Cryptography.Aes Aes object.
content byte Content to be encrypted.
key byte Encryption key.
iv byte Initial vector.
return byte[]

MergeBytesArray() public static method

Merge bytes array to byte array
public static MergeBytesArray ( byte buffer ) : byte[]
buffer byte The buffer of bytes array
return byte[]

ToByteArray() public static method

Convert to byte array.
public static ToByteArray ( string str ) : byte[]
str string The string.
return byte[]