Encrypt ScopedPdu using DES encryption protocol

Namespace:  SnmpSharpNet
Assembly:  SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.2.0 (0.5.2.0)

Syntax

C#
public byte[] Encrypt(
	byte[] unencryptedData,
	int offset,
	int length,
	byte[] key,
	int engineBoots,
	int engineTime,
	out byte[] privacyParameters
)
Visual Basic (Declaration)
Public Function Encrypt ( _
	unencryptedData As Byte(), _
	offset As Integer, _
	length As Integer, _
	key As Byte(), _
	engineBoots As Integer, _
	engineTime As Integer, _
	<OutAttribute> ByRef privacyParameters As Byte() _
) As Byte()
Visual C++
public:
virtual array<unsigned char>^ Encrypt(
	array<unsigned char>^ unencryptedData, 
	int offset, 
	int length, 
	array<unsigned char>^ key, 
	int engineBoots, 
	int engineTime, 
	[OutAttribute] array<unsigned char>^% privacyParameters
) sealed

Parameters

unencryptedData
Type: array< System..::.Byte >[]()[]
Unencrypted ScopedPdu byte array
offset
Type: System..::.Int32
Offset to start encryption
length
Type: System..::.Int32
Length of data to encrypt
key
Type: array< System..::.Byte >[]()[]
Encryption key. Key has to be at least 32 bytes is length
engineBoots
Type: System..::.Int32
Authoritative engine boots value
engineTime
Type: System..::.Int32
Authoritative engine time value. Not used for DES
privacyParameters
Type: array< System..::.Byte >[]()[] %
Privacy parameters out buffer. This field will be filled in with information required to decrypt the information. Output length of this field is 8 bytes and space has to be reserved in the USM header to store this information

Return Value

Encrypted byte array

Implements

IPrivacyProtocol..::.Encrypt(array<Byte>[]()[], Int32, Int32, array<Byte>[]()[], Int32, Int32, array<Byte>[]()[]%)

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionThrown when encryption key is null or length of the encryption key is too short.

See Also