C# Class SnmpSharpNet.AuthenticationMD5

MD5 Authentication class.
Inheritance: IAuthenticationDigest
Mostrar archivo Open project: griffina/SnmpSharpNet

Public Methods

Method Description
AuthenticationMD5 ( ) : System

Standard constructor

ComputeHash ( byte data, int offset, int count ) : byte[]

Compute hash using authentication protocol.

PasswordToKey ( byte userPassword, byte engineID ) : byte[]

Convert user password to acceptable authentication key.

authenticate ( byte authKey, byte wholeMessage ) : byte[]

Authenticate packet and return authentication parameters value to the caller

authenticate ( byte authenticationSecret, byte engineId, byte wholeMessage ) : byte[]

Authenticate packet and return authentication parameters value to the caller

authenticateIncomingMsg ( byte authKey, byte authenticationParameters, MutableByte wholeMessage ) : bool

Verify MD5 authentication of a packet.

authenticateIncomingMsg ( byte userPassword, byte engineId, byte authenticationParameters, MutableByte wholeMessage ) : bool

Verifies correct MD5 authentication of the frame. Prior to calling this method, you have to extract authentication parameters from the wholeMessage and reset authenticationParameters field in the USM information block to 12 0x00 values.

Method Details

AuthenticationMD5() public method

Standard constructor
public AuthenticationMD5 ( ) : System
return System

ComputeHash() public method

Compute hash using authentication protocol.
public ComputeHash ( byte data, int offset, int count ) : byte[]
data byte Data to hash
offset int Compute hash from the source buffer offset
count int Compute hash for source data length
return byte[]

PasswordToKey() public method

Convert user password to acceptable authentication key.
Thrown when key length is less then 8 bytes
public PasswordToKey ( byte userPassword, byte engineID ) : byte[]
userPassword byte Authentication password
engineID byte Authoritative engine id
return byte[]

authenticate() public method

Authenticate packet and return authentication parameters value to the caller
public authenticate ( byte authKey, byte wholeMessage ) : byte[]
authKey byte Pre-generated authentication key
wholeMessage byte Message being authenticated
return byte[]

authenticate() public method

Authenticate packet and return authentication parameters value to the caller
public authenticate ( byte authenticationSecret, byte engineId, byte wholeMessage ) : byte[]
authenticationSecret byte User authentication secret
engineId byte SNMP agent authoritative engine id
wholeMessage byte Message to authenticate
return byte[]

authenticateIncomingMsg() public method

Verify MD5 authentication of a packet.
public authenticateIncomingMsg ( byte authKey, byte authenticationParameters, MutableByte wholeMessage ) : bool
authKey byte Authentication key (not password)
authenticationParameters byte Authentication parameters extracted from the packet being authenticated
wholeMessage MutableByte Entire packet being authenticated
return bool

authenticateIncomingMsg() public method

Verifies correct MD5 authentication of the frame. Prior to calling this method, you have to extract authentication parameters from the wholeMessage and reset authenticationParameters field in the USM information block to 12 0x00 values.
public authenticateIncomingMsg ( byte userPassword, byte engineId, byte authenticationParameters, MutableByte wholeMessage ) : bool
userPassword byte User password
engineId byte Authoritative engine id
authenticationParameters byte Extracted USM authentication parameters
wholeMessage MutableByte Whole message with authentication parameters zeroed (0x00) out
return bool