C# Class SnmpSharpNet.UserSecurityModel

User security model implementation class.
Inheritance: AsnType, ICloneable
Datei anzeigen Open project: griffina/SnmpSharpNet Class Usage Examples

Protected Properties

Property Type Description
_authentication AuthenticationDigests
_authenticationSecret MutableByte
_engineBoots Integer32
_engineId OctetString
_engineTime Integer32
_privacy PrivacyProtocols
_privacyParameters OctetString
_privacySecret MutableByte
_securityName OctetString

Public Methods

Method Description
Authenticate ( MutableByte &wholePacket ) : void

Authenticate SNMP version 3 message. Before calling this member, entire SNMP version 3 packet needs to be encoded. After authentication process is completed, authenticationParameters value in the USM header is updated and SNMPv3 packet needs to be re-encoded to include it in the BER encoded stream prior to transmission.

Authenticate ( byte authKey, MutableByte &wholePacket ) : void

Authenticate SNMP version 3 message. Before calling this member, entire SNMP version 3 packet needs to be encoded. After authentication process is completed, authenticationParameters value in the USM header is updated and SNMPv3 packet needs to be re-encoded to include it in the BER encoded stream prior to transmission.

Clone ( ) : object

Clone object

IsAuthentic ( MutableByte wholePacket ) : bool

Authenticate incoming packet

IsAuthentic ( byte authKey, MutableByte wholePacket ) : bool

Authenticate incoming packet

Reset ( ) : void

Reset USM object to default values. All OctetString and MutableByte members are reset to 0 length and privacy and authentication protocols are set to none.

SetEngineTime ( Int32 engineTime, Int32 engineBoots ) : void

Set SNMP version 3 agent engine time related values.

UserSecurityModel ( ) : System

Standard constructor.

UserSecurityModel ( UserSecurityModel value ) : System

Copy constructor.

Valid ( ) : bool

Checks for validity and completeness of information in this class. This method doesn't "know" what you are trying to do so it tests for minimal information required.

decode ( byte buffer, int offset ) : int

Decode USM portion of the SNMP version 3 packet.

encode ( MutableByte buffer ) : void

BER encode security model field.

USM security model is a SEQUENCE encoded inside a OCTETSTRING. To encode it, first encode the sequence of class values then "wrap" it inside a OCTETSTRING field

Method Details

Authenticate() public method

Authenticate SNMP version 3 message. Before calling this member, entire SNMP version 3 packet needs to be encoded. After authentication process is completed, authenticationParameters value in the USM header is updated and SNMPv3 packet needs to be re-encoded to include it in the BER encoded stream prior to transmission.
public Authenticate ( MutableByte &wholePacket ) : void
wholePacket MutableByte SNMP version 3 BER encoded packet.
return void

Authenticate() public method

Authenticate SNMP version 3 message. Before calling this member, entire SNMP version 3 packet needs to be encoded. After authentication process is completed, authenticationParameters value in the USM header is updated and SNMPv3 packet needs to be re-encoded to include it in the BER encoded stream prior to transmission.
public Authenticate ( byte authKey, MutableByte &wholePacket ) : void
authKey byte Authentication key (not password)
wholePacket MutableByte SNMP version 3 BER encoded packet.
return void

Clone() public method

Clone object
public Clone ( ) : object
return object

IsAuthentic() public method

Authenticate incoming packet
public IsAuthentic ( MutableByte wholePacket ) : bool
wholePacket MutableByte Received BER encoded SNMP version 3 packet
return bool

IsAuthentic() public method

Authenticate incoming packet
public IsAuthentic ( byte authKey, MutableByte wholePacket ) : bool
authKey byte Authentication key (not password)
wholePacket MutableByte Received BER encoded SNMP version 3 packet
return bool

Reset() public method

Reset USM object to default values. All OctetString and MutableByte members are reset to 0 length and privacy and authentication protocols are set to none.
public Reset ( ) : void
return void

SetEngineTime() public method

Set SNMP version 3 agent engine time related values.
public SetEngineTime ( Int32 engineTime, Int32 engineBoots ) : void
engineTime System.Int32 SNMP version 3 agent engine time value
engineBoots System.Int32 SNMP version 3 agent engine boot value
return void

UserSecurityModel() public method

Standard constructor.
public UserSecurityModel ( ) : System
return System

UserSecurityModel() public method

Copy constructor.
public UserSecurityModel ( UserSecurityModel value ) : System
value UserSecurityModel Class to copy values from
return System

Valid() public method

Checks for validity and completeness of information in this class. This method doesn't "know" what you are trying to do so it tests for minimal information required.
public Valid ( ) : bool
return bool

decode() public method

Decode USM portion of the SNMP version 3 packet.
Thrown when decoding enountered invalid data type in USM information Thrown when packet is too small to contain information length specified in header
public decode ( byte buffer, int offset ) : int
buffer byte Received SNMP packet BER encoded
offset int Offset within the buffer to start decoding USM information
return int

encode() public method

BER encode security model field.
USM security model is a SEQUENCE encoded inside a OCTETSTRING. To encode it, first encode the sequence of class values then "wrap" it inside a OCTETSTRING field
public encode ( MutableByte buffer ) : void
buffer MutableByte Buffer to store encoded USM security model header
return void

Property Details

_authentication protected_oe property

Authentication digest enumeration value. For acceptable values see AuthenticationDigests
protected AuthenticationDigests _authentication
return AuthenticationDigests

_authenticationSecret protected_oe property

Authentication secret
protected MutableByte _authenticationSecret
return MutableByte

_engineBoots protected_oe property

Authoritative engine boots value
protected Integer32 _engineBoots
return Integer32

_engineId protected_oe property

Authoritative engine id
protected OctetString _engineId
return OctetString

_engineTime protected_oe property

Authoritative engine time value
protected Integer32 _engineTime
return Integer32

_privacy protected_oe property

Privacy protocol. For valid values see PrivacyProtocols
protected PrivacyProtocols _privacy
return PrivacyProtocols

_privacyParameters protected_oe property

Privacy parameters in authPriv requests
protected OctetString _privacyParameters
return OctetString

_privacySecret protected_oe property

Privacy secret
protected MutableByte _privacySecret
return MutableByte

_securityName protected_oe property

SNMP version 3 security name (or user name)
protected OctetString _securityName
return OctetString