|
AXL Software | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
ObjectHMAC_MD5
JAVA translation of the hmac_md5() function from RFC 2104.
HMAC: Keyed-Hashing for Message Authentication.
Copyright (C) Michael Lecuyer (1999). All Rights Reserved.
This source code and extensions of it may be used freely as long as the copyright notice above and this paragraph are included in all copies and derivative works.
A notice about the original C code: Copyright (C) The Internet Society (1999). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE."
| Field Summary | |
static int |
DIGEST_LENGTH
MD5 Hash length - 16. |
| Constructor Summary | |
HMAC_MD5()
Defaultl Constructor |
|
HMAC_MD5(byte[] key)
Defaultl Constructor |
|
| Method Summary | |
byte[] |
digest()
Return the digest as calculated by the sign() method. |
byte[] |
doFinal()
Finishes the MAC operation. |
byte[] |
doFinal(byte[] input)
Finishes the MAC operation. |
static HMAC_MD5 |
get()
Compatibility with the way this is used by the RADIUS software. |
String |
getAlgorithm()
Returns the algorithm name of this Mac object. |
int |
getMacLength()
Return the Mac length. |
void |
init(byte[] key)
Initializes this Mac object with the given key. |
void |
init(Key key)
Initializes this Mac object with the given key. |
static void |
main(String[] arg)
Run standard tests from the RFC: |
void |
reset()
Resets this Mac object. |
String |
toString()
Return the digest as a HEX string. |
void |
update(byte text)
HMAC_MD5 function. |
void |
update(byte[] text)
HMAC_MD5 function. |
void |
update(byte[] text,
int textStart,
int textLen)
HMAC_MD5 function. |
boolean |
verify(byte[] signature)
Validate a signature against the current digest. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DIGEST_LENGTH
| Constructor Detail |
public HMAC_MD5()
public HMAC_MD5(byte[] key)
throws InvalidKeyException
key - Key| Method Detail |
public byte[] digest()
public byte[] doFinal()
public byte[] doFinal(byte[] input)
public static HMAC_MD5 get()
public String getAlgorithm()
public int getMacLength()
public void init(byte[] key)
throws InvalidKeyException
key - SecretKey.
InvalidKeyException
public void init(Key key)
throws InvalidKeyException
key - SecretKey.
InvalidKeyExceptionpublic static void main(String[] arg)
public void reset()
public String toString()
public void update(byte text)
text - Text to process
public void update(byte[] text)
text - Text to process
public void update(byte[] text,
int textStart,
int textLen)
text - Text to processtextStart - Start position of text in text buffer.textLen - Length of text to use from text buffer.
public boolean verify(byte[] signature)
signature -
|
AXL Software | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||