Encrypt ScopedPdu using DES encryption protocol

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

Syntax

         
 C#  Visual Basic  Visual C++ 
public byte[] Encrypt(
	byte[] unencryptedData,
	int offset,
	int length,
	byte[] key,
	int engineBoots,
	int engineTime,
	out byte[] privacyParameters
)
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()
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
array< Byte >[]()[]
Unencrypted ScopedPdu byte array
offset
Int32
Offset to start encryption
length
Int32
Length of data to encrypt
key
array< Byte >[]()[]
Encryption key. Key has to be at least 32 bytes is length
engineBoots
Int32
Authoritative engine boots value
engineTime
Int32
Authoritative engine time value. Not used for DES
privacyParameters
array< 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