C# Класс SnmpSharpNet.UserSecurityModel

User security model implementation class.
Наследование: AsnType, ICloneable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_authentication AuthenticationDigests
_authenticationSecret MutableByte
_engineBoots Integer32
_engineId OctetString
_engineTime Integer32
_privacy PrivacyProtocols
_privacyParameters OctetString
_privacySecret MutableByte
_securityName OctetString

Открытые методы

Метод Описание
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

Описание методов

Authenticate() публичный Метод

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.
Результат void

Authenticate() публичный Метод

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.
Результат void

Clone() публичный Метод

Clone object
public Clone ( ) : object
Результат object

IsAuthentic() публичный Метод

Authenticate incoming packet
public IsAuthentic ( MutableByte wholePacket ) : bool
wholePacket MutableByte Received BER encoded SNMP version 3 packet
Результат bool

IsAuthentic() публичный Метод

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
Результат bool

Reset() публичный Метод

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
Результат void

SetEngineTime() публичный Метод

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
Результат void

UserSecurityModel() публичный Метод

Standard constructor.
public UserSecurityModel ( ) : System
Результат System

UserSecurityModel() публичный Метод

Copy constructor.
public UserSecurityModel ( UserSecurityModel value ) : System
value UserSecurityModel Class to copy values from
Результат System

Valid() публичный Метод

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
Результат bool

decode() публичный Метод

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
Результат int

encode() публичный Метод

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
Результат void

Описание свойств

_authentication защищенное свойство

Authentication digest enumeration value. For acceptable values see AuthenticationDigests
protected AuthenticationDigests _authentication
Результат AuthenticationDigests

_authenticationSecret защищенное свойство

Authentication secret
protected MutableByte _authenticationSecret
Результат MutableByte

_engineBoots защищенное свойство

Authoritative engine boots value
protected Integer32 _engineBoots
Результат Integer32

_engineId защищенное свойство

Authoritative engine id
protected OctetString _engineId
Результат OctetString

_engineTime защищенное свойство

Authoritative engine time value
protected Integer32 _engineTime
Результат Integer32

_privacy защищенное свойство

Privacy protocol. For valid values see PrivacyProtocols
protected PrivacyProtocols _privacy
Результат PrivacyProtocols

_privacyParameters защищенное свойство

Privacy parameters in authPriv requests
protected OctetString _privacyParameters
Результат OctetString

_privacySecret защищенное свойство

Privacy secret
protected MutableByte _privacySecret
Результат MutableByte

_securityName защищенное свойство

SNMP version 3 security name (or user name)
protected OctetString _securityName
Результат OctetString