C# Class FP300Service.MessageBuilder

Exibir arquivo Open project: huginsdk/fpu Class Usage Examples

Public Properties

Property Type Description
DefaultEncoding System.Text.Encoding

Public Methods

Method Description
AddLength ( int len ) : byte[]
AddTimeFromBcd ( byte blockData, int index, int &outIndex, System.DateTime dtToAdd ) : System.DateTime
ByteArrayToHex ( byte bytesArray, int offset, int len ) : int
ByteArrayToString ( byte bytesArray, int offset, int len ) : string
BytesToHexString ( List bytesArr ) : string
CalculateLRC ( List reqPacket ) : byte
ConvertBcdToInt ( byte bytesBCD, int offset, int len ) : int
ConvertBytesToDate ( byte bytesBCD, int offset ) : System.DateTime
ConvertBytesToTime ( byte bytesBCD, int offset ) : System.DateTime
ConvertDecimalToBCD ( decimal value, int decimalCnt ) : byte[]
ConvertIntToBCD ( int value, int bcdLen ) : byte[]
ConvertIpToBcd ( String idAddress ) : byte[]
Create3DESKey ( ) : byte[]
DecryptTriple ( byte data, int len, byte tripleKey ) : byte[]
EncryptRSA ( byte rsaModulus, byte exponent, byte data ) : byte[]
EncryptTriple ( byte data, int len, byte tripleKey ) : byte[]
GetBytesFromOffset ( byte bytesArray, int offset, int len ) : byte[]
GetDateFromBcd ( byte blockData, int index, int &outIndex ) : System.DateTime
GetDateInBytes ( System.DateTime date ) : byte[]
GetDateTimeInBytes ( System.DateTime date ) : byte[]
GetLength ( byte msgBytes, int offset, int &outIndex ) : int
GetString ( byte bytesArray, int index, int &outIndex, Encoding encoding ) : string
GetTag ( byte bytesArray, int offset, int &outOffset ) : int
GetTimeInBytes ( System.DateTime time ) : byte[]
HexStringToBytes ( string strBytes ) : List
HexToByteArray ( int hexNum ) : byte[]
VerifyRSA ( byte rsaModulus, byte exponent, byte data, byte sign ) : bool

Private Methods

Method Description
FixTurkish ( string str ) : string
GetTripleDESProvider ( byte tripleKey ) : TripleDESCryptoServiceProvider

Method Details

AddLength() public static method

public static AddLength ( int len ) : byte[]
len int
return byte[]

AddTimeFromBcd() public static method

public static AddTimeFromBcd ( byte blockData, int index, int &outIndex, System.DateTime dtToAdd ) : System.DateTime
blockData byte
index int
outIndex int
dtToAdd System.DateTime
return System.DateTime

ByteArrayToHex() public static method

public static ByteArrayToHex ( byte bytesArray, int offset, int len ) : int
bytesArray byte
offset int
len int
return int

ByteArrayToString() public static method

public static ByteArrayToString ( byte bytesArray, int offset, int len ) : string
bytesArray byte
offset int
len int
return string

BytesToHexString() public static method

public static BytesToHexString ( List bytesArr ) : string
bytesArr List
return string

CalculateLRC() public static method

public static CalculateLRC ( List reqPacket ) : byte
reqPacket List
return byte

ConvertBcdToInt() public static method

public static ConvertBcdToInt ( byte bytesBCD, int offset, int len ) : int
bytesBCD byte
offset int
len int
return int

ConvertBytesToDate() public static method

public static ConvertBytesToDate ( byte bytesBCD, int offset ) : System.DateTime
bytesBCD byte
offset int
return System.DateTime

ConvertBytesToTime() public static method

public static ConvertBytesToTime ( byte bytesBCD, int offset ) : System.DateTime
bytesBCD byte
offset int
return System.DateTime

ConvertDecimalToBCD() public static method

public static ConvertDecimalToBCD ( decimal value, int decimalCnt ) : byte[]
value decimal
decimalCnt int
return byte[]

ConvertIntToBCD() public static method

public static ConvertIntToBCD ( int value, int bcdLen ) : byte[]
value int
bcdLen int
return byte[]

ConvertIpToBcd() public static method

public static ConvertIpToBcd ( String idAddress ) : byte[]
idAddress String
return byte[]

Create3DESKey() public static method

public static Create3DESKey ( ) : byte[]
return byte[]

DecryptTriple() public static method

public static DecryptTriple ( byte data, int len, byte tripleKey ) : byte[]
data byte
len int
tripleKey byte
return byte[]

EncryptRSA() public static method

public static EncryptRSA ( byte rsaModulus, byte exponent, byte data ) : byte[]
rsaModulus byte
exponent byte
data byte
return byte[]

EncryptTriple() public static method

public static EncryptTriple ( byte data, int len, byte tripleKey ) : byte[]
data byte
len int
tripleKey byte
return byte[]

GetBytesFromOffset() public static method

public static GetBytesFromOffset ( byte bytesArray, int offset, int len ) : byte[]
bytesArray byte
offset int
len int
return byte[]

GetDateFromBcd() public static method

public static GetDateFromBcd ( byte blockData, int index, int &outIndex ) : System.DateTime
blockData byte
index int
outIndex int
return System.DateTime

GetDateInBytes() public static method

public static GetDateInBytes ( System.DateTime date ) : byte[]
date System.DateTime
return byte[]

GetDateTimeInBytes() public static method

public static GetDateTimeInBytes ( System.DateTime date ) : byte[]
date System.DateTime
return byte[]

GetLength() public static method

public static GetLength ( byte msgBytes, int offset, int &outIndex ) : int
msgBytes byte
offset int
outIndex int
return int

GetString() public static method

public static GetString ( byte bytesArray, int index, int &outIndex, Encoding encoding ) : string
bytesArray byte
index int
outIndex int
encoding System.Text.Encoding
return string

GetTag() public static method

public static GetTag ( byte bytesArray, int offset, int &outOffset ) : int
bytesArray byte
offset int
outOffset int
return int

GetTimeInBytes() public static method

public static GetTimeInBytes ( System.DateTime time ) : byte[]
time System.DateTime
return byte[]

HexStringToBytes() public static method

public static HexStringToBytes ( string strBytes ) : List
strBytes string
return List

HexToByteArray() public static method

public static HexToByteArray ( int hexNum ) : byte[]
hexNum int
return byte[]

VerifyRSA() public static method

public static VerifyRSA ( byte rsaModulus, byte exponent, byte data, byte sign ) : bool
rsaModulus byte
exponent byte
data byte
sign byte
return bool

Property Details

DefaultEncoding public_oe static_oe property

public static Encoding,System.Text DefaultEncoding
return System.Text.Encoding