|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.management.snmp.usm.SnmpUsmHmacAlgorithm
public abstract class SnmpUsmHmacAlgorithm
FOR INTERNAL USE ONLY. This is the default implementation of the Hmac +
Message Digest algorithms. It is based on the standard
java.security
packages.
Constructor Summary | |
---|---|
protected |
SnmpUsmHmacAlgorithm(String algoName,
String mdName)
|
Method Summary | |
---|---|
byte[] |
calculateAuthDelta(byte[] oldKey,
byte[] newKey,
byte[] random)
Calculate the delta parameter needed when processing key change. |
byte[] |
calculateNewAuthKey(byte[] oldKey,
byte[] randomdelta)
Compute the new key and return it. |
byte[] |
calculateNewPrivKey(byte[] oldKey,
byte[] randomdelta,
int deltaSize)
Compute the new key and return it. |
byte[] |
calculatePrivDelta(byte[] oldKey,
byte[] newKey,
byte[] random,
int deltaSize)
Calculate the delta parameter needed when processing key change for a privacy algorithm. |
String |
getAlgorithm()
Gets the unique algorithm name. |
abstract int |
getDeltaSize()
Gets the delta used for key change algorithm (see RFC 2574). |
byte[] |
localizeAuthKey(byte[] key,
SnmpEngineId engineId)
Translate a global key to a local one (RFC 2574 KUL). |
byte[] |
localizePrivKey(byte[] key,
SnmpEngineId engineId,
int keysize)
Translate a global privacy key to a local one (RFC 2574 KUL). |
byte[] |
password_to_key(String password)
Translate a password to a key according to the right algorithm (RFC 2574 algorithm). |
byte[] |
sign(byte[] key,
byte[] data,
int length)
Sign the passed data and returns the corresponding Hmac. |
String |
toString(byte[] signature)
Translate a signature to a displayable string. |
boolean |
verify(byte[] key,
byte[] data,
int length,
byte[] signature)
Verify that the passed signature is compliant with the passed data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.management.snmp.usm.SnmpUsmAlgorithm |
---|
getAlgorithm, getOid |
Constructor Detail |
---|
protected SnmpUsmHmacAlgorithm(String algoName, String mdName)
Method Detail |
---|
public abstract int getDeltaSize()
SnmpUsmAlgorithm
getDeltaSize
in interface SnmpUsmAlgorithm
public byte[] sign(byte[] key, byte[] data, int length)
sign
in interface SnmpUsmAuthAlgorithm
key
- The key to use.data
- The data to sign.length
- The data length.
public boolean verify(byte[] key, byte[] data, int length, byte[] signature)
verify
in interface SnmpUsmAuthAlgorithm
key
- The key to use.data
- The data to sign.length
- The data length.signature
- The signature (Hmac).
true
means signature OK, false
means bad signature.public String toString(byte[] signature)
signature
- The Hmac
public byte[] password_to_key(String password)
password_to_key
in interface SnmpUsmAuthAlgorithm
password
- The password.
public byte[] localizeAuthKey(byte[] key, SnmpEngineId engineId)
localizeAuthKey
in interface SnmpUsmAuthAlgorithm
key
- The key to use.engineId
- The engine Id to use.
public byte[] localizePrivKey(byte[] key, SnmpEngineId engineId, int keysize)
localizePrivKey
in interface SnmpUsmAuthAlgorithm
key
- The key to use.engineId
- The engine Id to use.keysize
- The privacy algorithm key size.
public byte[] calculateAuthDelta(byte[] oldKey, byte[] newKey, byte[] random)
calculateAuthDelta
in interface SnmpUsmAuthAlgorithm
oldKey
- The old key.newKey
- The new key.random
- The random value.
public byte[] calculatePrivDelta(byte[] oldKey, byte[] newKey, byte[] random, int deltaSize)
calculatePrivDelta
in interface SnmpUsmAuthAlgorithm
oldKey
- The old key.newKey
- The new key.random
- The random value.deltaSize
- The algorithm delta size.
public byte[] calculateNewAuthKey(byte[] oldKey, byte[] randomdelta)
calculateNewAuthKey
in interface SnmpUsmAuthAlgorithm
oldKey
- The old key.randomdelta
- Random and received delta concatenation.public byte[] calculateNewPrivKey(byte[] oldKey, byte[] randomdelta, int deltaSize)
calculateNewPrivKey
in interface SnmpUsmAuthAlgorithm
oldKey
- The old key.randomdelta
- Random and received delta concatenation.deltaSize
- The algorithm deltaSizepublic String getAlgorithm()
SnmpUsmAlgorithm
getAlgorithm
in interface SnmpUsmAlgorithm
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |