Encrypt ScopedPdu using TripleDES encryption protocol
Namespace: SnmpSharpNetAssembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.9.1.0 (0.9.1)
Syntax
| C# |
|---|
public byte[] Encrypt( byte[] unencryptedData, int offset, int length, byte[] key, int engineBoots, int engineTime, out byte[] privacyParameters, IAuthenticationDigest authDigest ) |
| Visual Basic |
|---|
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(), _ authDigest As IAuthenticationDigest _ ) 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, IAuthenticationDigest^ authDigest ) 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.
- 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
- authDigest
- Type: SnmpSharpNet..::..IAuthenticationDigest
Authentication digest class reference. Used by TripleDES.
Return Value
Encrypted byte arrayImplements
IPrivacyProtocol..::..Encrypt(array<Byte>[]()[][], Int32, Int32, array<Byte>[]()[][], Int32, Int32, array<Byte>[]()[][]%, IAuthenticationDigest)
Exceptions
| Exception | Condition |
|---|---|
| System..::..ArgumentOutOfRangeException | Thrown when encryption key is null or length of the encryption key is too short. |