com.adventnet.snmp.snmp2.usm
Class USMSecurityJCE

java.lang.Object
  extended by com.adventnet.snmp.snmp2.usm.USMSecurity
      extended by com.adventnet.snmp.snmp2.usm.USMSecurityJCE

 class USMSecurityJCE
extends USMSecurity


Constructor Summary
USMSecurityJCE()
          The Default Constructor.
 
Method Summary
(package private)  byte[] decrypt(byte[] data, int offset, byte[] key, byte[] privParams, int privProtocol, int engineBoots, int engineTime)
          This method is used for decrypting the data from the offset position till data's end.
(package private)  int encrypt(byte[] data, int offset, byte[] key, byte[] privParams, int privProtocol, int engineBoots, int engineTime)
          This method is used for encrypting the data from the offset position till data's end.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

USMSecurityJCE

USMSecurityJCE()
The Default Constructor.

Method Detail

encrypt

int encrypt(byte[] data,
            int offset,
            byte[] key,
            byte[] privParams,
            int privProtocol,
            int engineBoots,
            int engineTime)
      throws SnmpException
Description copied from class: USMSecurity
This method is used for encrypting the data from the offset position till data's end. The encrypted data will be filled in data. As per the standard draft-blumenthal-aes-usm-08.txt, the engine boots and engine time values should be used for calculating the salt. Hence both these values are passed as an argument.

Specified by:
encrypt in class USMSecurity
Parameters:
data - the byte array which contains the data to be encrypted.
offset - the position from which data should be encrypted.
key - the privKey which is calculated from the privPassword.
privProtocol - the privacy protocol for this user. supported privacy protocols are CBC-DES and CFB-AES-128.
engineBoots - the engineBoots value associated with the snmp engine.
engineTime - the engineTime value associated with the snmp engine.
Returns:
The location from where this encrypted data has been filled inside data.
Throws:
SnmpException

decrypt

byte[] decrypt(byte[] data,
               int offset,
               byte[] key,
               byte[] privParams,
               int privProtocol,
               int engineBoots,
               int engineTime)
Description copied from class: USMSecurity
This method is used for decrypting the data from the offset position till data's end. As per the standard draft-blumenthal-aes-usm-08.txt, the engine boots and engine time values should be used for calculating the salt. Hence both these values are passed as an argument.

Specified by:
decrypt in class USMSecurity
Parameters:
data - the byte array which contains the data to be decrypted.
offset - the position from which data should be decrypted.
key - the privKey which is calculated from the privPassword.
privParams - the privParams which is present in the SNMPv3 auth-priv data.
privProtocol - the privacy protocol for this user. supported privacy protocols are CBC-DES and CFB-AES-128.
engineBoots - the engineBoots value associated with the snmp engine.
engineTime - the engineTime value associated with the snmp engine.
Returns:
the decrypted data as a byte array. This method will return null if any decryption error occurs.