C# 클래스 SnmpSharpNet.PrivacyAES

AES privacy protocol implementation class.
상속: IPrivacyProtocol
파일 보기 프로젝트 열기: griffina/SnmpSharpNet

보호된 프로퍼티들

프로퍼티 타입 설명
_keyBytes int
_salt System.Int64

공개 메소드들

메소드 설명
Decrypt ( byte cryptedData, int offset, int length, byte key, int engineBoots, int engineTime, byte privacyParameters ) : byte[]

Decrypt ScopedPdu BER encoded byte array.

Encrypt ( byte unencryptedData, int offset, int length, byte key, int engineBoots, int engineTime, byte &privacyParameters, IAuthenticationDigest authDigest ) : byte[]

Encrypt ScopedPdu data BER encoded in a byte array.

ExtendShortKey ( byte shortKey, byte password, byte engineID, IAuthenticationDigest authProtocol ) : byte[]

Some protocols support a method to extend the encryption or decryption key when supplied key is too short.

GetEncryptedLength ( int scopedPduLength ) : int

Calculates and returns length of the buffer that is the result of the encryption method.

PasswordToKey ( byte secret, byte engineId, IAuthenticationDigest authProtocol ) : byte[]

Convert privacy password into encryption key using packet authentication hash.

PrivacyAES ( int keyBytes ) : System

Standard constructor.

보호된 메소드들

메소드 설명
NextSalt ( ) : System.Int64

Get next salt Int64 value. Used internally to encrypt data.

메소드 상세

Decrypt() 공개 메소드

Decrypt ScopedPdu BER encoded byte array.
public Decrypt ( byte cryptedData, int offset, int length, byte key, int engineBoots, int engineTime, byte privacyParameters ) : byte[]
cryptedData byte Encrypted data byte array
offset int Offset within the buffer to start decryption process from
length int Length of data to decrypt
key byte Decryption key
engineBoots int Authoritative engine boots value. Retrieved as part of SNMP v3 discovery procedure
engineTime int Authoritative engine time value. Retrieved as part of SNMP v3 discovery procedure
privacyParameters byte Privacy parameters parsed from the incoming packet.
리턴 byte[]

Encrypt() 공개 메소드

Encrypt ScopedPdu data BER encoded in a byte array.
public Encrypt ( byte unencryptedData, int offset, int length, byte key, int engineBoots, int engineTime, byte &privacyParameters, IAuthenticationDigest authDigest ) : byte[]
unencryptedData byte BER encoded byte array that needs to be encrypted
offset int Offset within the BER encoded byte array to start encryption operation from.
length int Length of data to encrypt
key byte Encryption key
engineBoots int Authoritative engine boots value. Retrieved as part of SNMP v3 discovery process.
engineTime int Authoritative engine time value. Retrieved as part of SNMP v3 discovery process.
privacyParameters byte Byte array that will receive privacy parameters information that is the result of the /// encryption procedure.
authDigest IAuthenticationDigest Authentication digest reference. Not used by AES protocol and can be null
리턴 byte[]

ExtendShortKey() 공개 메소드

Some protocols support a method to extend the encryption or decryption key when supplied key is too short.
public ExtendShortKey ( byte shortKey, byte password, byte engineID, IAuthenticationDigest authProtocol ) : byte[]
shortKey byte Key that needs to be extended
password byte Privacy password as configured on the SNMP agent.
engineID byte Authoritative engine id. Value is retrieved as part of SNMP v3 discovery procedure
authProtocol IAuthenticationDigest Authentication protocol class instance cast as
리턴 byte[]

GetEncryptedLength() 공개 메소드

Calculates and returns length of the buffer that is the result of the encryption method.
public GetEncryptedLength ( int scopedPduLength ) : int
scopedPduLength int Length of the buffer that is needs to be encrypted.
리턴 int

NextSalt() 보호된 메소드

Get next salt Int64 value. Used internally to encrypt data.
protected NextSalt ( ) : System.Int64
리턴 System.Int64

PasswordToKey() 공개 메소드

Convert privacy password into encryption key using packet authentication hash.
Thrown when key size is shorter then MinimumKeyLength
public PasswordToKey ( byte secret, byte engineId, IAuthenticationDigest authProtocol ) : byte[]
secret byte Privacy user secret
engineId byte Authoritative engine id of the snmp agent
authProtocol IAuthenticationDigest Authentication protocol
리턴 byte[]

PrivacyAES() 공개 메소드

Standard constructor.
public PrivacyAES ( int keyBytes ) : System
keyBytes int Key size in bytes. Acceptable values are /// 16 = 128-bit key size, 24 = 192-bit key size, or 32 = 256-bit key size.
리턴 System

프로퍼티 상세

_keyBytes 보호되어 있는 프로퍼티

AES protocol key bytes. Valid values are 16 (for AES128), 24 (AES192) or 32 (AES256).
protected int _keyBytes
리턴 int

_salt 보호되어 있는 프로퍼티

Salt value
protected Int64,System _salt
리턴 System.Int64