|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.crypto.HMACGenerator
Calculate the HMAC-MD5 of a key+message. All the good stuff occurs
in HMac
and
MD5Digest
.
Constructor Summary | |
HMACGenerator(I2PAppContext context)
|
Method Summary | |
Hash |
calculate(SessionKey key,
byte[] data)
Calculate the HMAC of the data with the given key |
void |
calculate(SessionKey key,
byte[] data,
int offset,
int length,
byte[] target,
int targetOffset)
Calculate the HMAC of the data with the given key |
boolean |
verify(SessionKey key,
byte[] curData,
int curOffset,
int curLength,
byte[] origMAC,
int origMACOffset,
int origMACLength)
Verify the MAC inline, reducing some unnecessary memory churn. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HMACGenerator(I2PAppContext context)
Method Detail |
public Hash calculate(SessionKey key, byte[] data)
public void calculate(SessionKey key, byte[] data, int offset, int length, byte[] target, int targetOffset)
public boolean verify(SessionKey key, byte[] curData, int curOffset, int curLength, byte[] origMAC, int origMACOffset, int origMACLength)
key
- session key to verify the MAC withcurData
- MAC to verifycurOffset
- index into curData to MACcurLength
- how much data in curData do we want to run the HMAC overorigMAC
- what do we expect the MAC of curData to equalorigMACOffset
- index into origMACorigMACLength
- how much of the MAC do we want to verify
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |