Encrypt ScopedPdu using DES encryption protocol
Namespace:
SnmpSharpNetAssembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax
| C# | Visual Basic | 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
- 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 arrayImplements
IPrivacyProtocol..::.Encrypt(array<Byte>[]()[], Int32, Int32, array<Byte>[]()[], Int32, Int32, array<Byte>[]()[]%)
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentOutOfRangeException | Thrown when encryption key is null or length of the encryption key is too short. |