C# Class SnmpSharpNet.UserSecurityModel

User security model implementation class.
Inheritance: AsnType, ICloneable
Afficher le fichier Open project: griffina/SnmpSharpNet Class Usage Examples

Protected Properties

Свойство Type Description
_authentication AuthenticationDigests
_authenticationSecret MutableByte
_engineBoots Integer32
_engineId OctetString
_engineTime Integer32
_privacy PrivacyProtocols
_privacyParameters OctetString
_privacySecret MutableByte
_securityName OctetString

Méthodes publiques

Méthode 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 méthode

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.
Résultat void

Authenticate() public méthode

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.
Résultat void

Clone() public méthode

Clone object
public Clone ( ) : object
Résultat object

IsAuthentic() public méthode

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

IsAuthentic() public méthode

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
Résultat bool

Reset() public méthode

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
Résultat void

SetEngineTime() public méthode

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
Résultat void

UserSecurityModel() public méthode

Standard constructor.
public UserSecurityModel ( ) : System
Résultat System

UserSecurityModel() public méthode

Copy constructor.
public UserSecurityModel ( UserSecurityModel value ) : System
value UserSecurityModel Class to copy values from
Résultat System

Valid() public méthode

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
Résultat bool

decode() public méthode

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
Résultat int

encode() public méthode

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
Résultat void

Property Details

_authentication protected_oe property

Authentication digest enumeration value. For acceptable values see AuthenticationDigests
protected AuthenticationDigests _authentication
Résultat AuthenticationDigests

_authenticationSecret protected_oe property

Authentication secret
protected MutableByte _authenticationSecret
Résultat MutableByte

_engineBoots protected_oe property

Authoritative engine boots value
protected Integer32 _engineBoots
Résultat Integer32

_engineId protected_oe property

Authoritative engine id
protected OctetString _engineId
Résultat OctetString

_engineTime protected_oe property

Authoritative engine time value
protected Integer32 _engineTime
Résultat Integer32

_privacy protected_oe property

Privacy protocol. For valid values see PrivacyProtocols
protected PrivacyProtocols _privacy
Résultat PrivacyProtocols

_privacyParameters protected_oe property

Privacy parameters in authPriv requests
protected OctetString _privacyParameters
Résultat OctetString

_privacySecret protected_oe property

Privacy secret
protected MutableByte _privacySecret
Résultat MutableByte

_securityName protected_oe property

SNMP version 3 security name (or user name)
protected OctetString _securityName
Résultat OctetString