com.sun.management.snmp
Interface SnmpUsmKeyHandler


public interface SnmpUsmKeyHandler

This interface allows you to compute key localization and delta generation. It is useful when adding user in USM MIB. An instance of SnmpUsmKeyHandler is associated to each SnmpEngine object. When computing key, an authentication algorithm is needed. The supported ones are : usmHMACMD5AuthProtocol and usmHMACSHAAuthProtocol.

Since:
Java DMK 5.1

Field Summary
static int DES_DELTA_SIZE
          DES privacy algorithm delta size.
static int DES_KEY_SIZE
          DES privacy algorithm key size.
 
Method Summary
 byte[] calculateAuthDelta(String algoName, byte[] oldKey, byte[] newKey, byte[] random)
          Calculate the delta parameter needed when processing key change.
 byte[] calculatePrivDelta(String algoName, byte[] oldKey, byte[] newKey, byte[] random, int deltaSize)
          Calculate the delta parameter needed when processing key change for a privacy algorithm.
 byte[] localizeAuthKey(String algoName, byte[] key, SnmpEngineId engineId)
          Localize the passed key using the passed SnmpEngineId.
 byte[] localizePrivKey(String algoName, byte[] key, SnmpEngineId engineId, int keysize)
          Localize the passed privacy key using the passed SnmpEngineId.
 byte[] password_to_key(String algoName, String password)
          Translate a password to a key.
 

Field Detail

DES_KEY_SIZE

static final int DES_KEY_SIZE
DES privacy algorithm key size. To be used when localizing privacy key

See Also:
Constant Field Values

DES_DELTA_SIZE

static final int DES_DELTA_SIZE
DES privacy algorithm delta size. To be used when calculating privacy key delta.

See Also:
Constant Field Values
Method Detail

password_to_key

byte[] password_to_key(String algoName,
                       String password)
                       throws IllegalArgumentException
Translate a password to a key. It MUST be compliant to RFC 2574 description.

Parameters:
algoName - The authentication algorithm to use.
password - Password to convert.
Returns:
The key.
Throws:
IllegalArgumentException - If the algorithm is unknown.

localizeAuthKey

byte[] localizeAuthKey(String algoName,
                       byte[] key,
                       SnmpEngineId engineId)
                       throws IllegalArgumentException
Localize the passed key using the passed SnmpEngineId. It MUST be compliant to RFC 2574 description.

Parameters:
algoName - The authentication algorithm to use.
key - The key to localize;
engineId - The Id used to localize the key.
Returns:
The localized key.
Throws:
IllegalArgumentException - If the algorithm is unknown.

localizePrivKey

byte[] localizePrivKey(String algoName,
                       byte[] key,
                       SnmpEngineId engineId,
                       int keysize)
                       throws IllegalArgumentException
Localize the passed privacy key using the passed SnmpEngineId. It MUST be compliant to RFC 2574 description.

Parameters:
algoName - The authentication algorithm to use.
key - The key to localize;
engineId - The Id used to localize the key.
keysize - The privacy algorithm key size.
Returns:
The localized key.
Throws:
IllegalArgumentException - If the algorithm is unknown.

calculateAuthDelta

byte[] calculateAuthDelta(String algoName,
                          byte[] oldKey,
                          byte[] newKey,
                          byte[] random)
                          throws IllegalArgumentException
Calculate the delta parameter needed when processing key change. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.

Parameters:
algoName - The authentication algorithm to use.
oldKey - The old key.
newKey - The new key.
random - The random value.
Returns:
The delta.
Throws:
IllegalArgumentException - If the algorithm is unknown.

calculatePrivDelta

byte[] calculatePrivDelta(String algoName,
                          byte[] oldKey,
                          byte[] newKey,
                          byte[] random,
                          int deltaSize)
                          throws IllegalArgumentException
Calculate the delta parameter needed when processing key change for a privacy algorithm. This computation is done by the key change initiator. It MUST be compliant to RFC 2574 description.

Parameters:
algoName - The authentication algorithm to use.
oldKey - The old key.
newKey - The new key.
random - The random value.
deltaSize - The algorithm delta size.
Returns:
The delta.
Throws:
IllegalArgumentException - If the algorithm is unknown.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.