|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--de.bb.security.MessageDigest
This class is copied from Sun's source for java.security.MessageDigest because it's not shipped with Netscape's JVM
| Constructor Summary | |
protected |
MessageDigest(java.lang.String name)
Creates a message digest with the specified algorithm name. |
| Method Summary | |
abstract java.lang.Object |
clone()
|
byte[] |
digest()
Completes the hash computation by performing final operations such as padding. |
byte[] |
digest(byte[] input)
Performs a final update on the digest using the specified array of bytes, then completes the digest computation. |
protected abstract byte[] |
engineDigest()
SPI: Completes the hash computation by performing final operations such as padding. |
protected abstract void |
engineReset()
SPI: Resets the digest for further use. |
protected abstract void |
engineUpdate(byte input)
SPI: Updates the digest using the specified byte. |
protected void |
engineUpdate(byte[] b,
int off,
int len)
add the given part of the byte array to rge digest |
java.lang.String |
getAlgorithm()
Returns a string that identifies the algorithm, independent of implementation details. |
static MessageDigest |
getInstance(java.lang.String algorithm)
Generates a MessageDigest object that implements the specified digest algorithm. |
static MessageDigest |
getInstance(java.lang.String algorithm,
java.lang.String provider)
Generates a MessageDigest object implementing the specified algorithm, as supplied from the specified provider, if such an algorithm is available from the provider. |
byte[] |
hmac(byte[] k,
byte[] t1,
byte[] t2,
byte[] t3,
byte[] t4,
byte[] t5)
create some hash bytes formula: MD(k ^ 0x5C, MD(k ^ 0x36, t1+t2+t3+t4+t5)) tested on MD5-test-vectors found in RFC 2104 |
static boolean |
isEqual(byte[] digesta,
byte[] digestb)
Compares two digests for equality. |
void |
reset()
Resets the digest for further use. |
protected static int |
rol(int value,
int bits)
rotate the given value to left side |
void |
update(byte input)
Updates the digest using the specified byte. |
void |
update(byte[] input)
Updates the digest using the specified array of bytes. |
void |
update(byte[] input,
int offset,
int len)
Updates the digest using the specified array of bytes, starting at the specified offset. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected MessageDigest(java.lang.String name)
algorithm - the standard name of the digest algorithm.
See Appendix A in the
Java Cryptography Architecture API Specification & Reference
for information about standard algorithm names.| Method Detail |
public final byte[] digest()
public final byte[] digest(byte[] input)
input - the input to be updated before the digest is
completed.public final java.lang.String getAlgorithm()
public static MessageDigest getInstance(java.lang.String algorithm)
throws java.lang.Exception
algorithm - the name of the algorithm requested.
See Appendix A in the
Java Cryptography Architecture API Specification & Reference
for information about standard algorithm names.NoSuchAlgorithmException - if the algorithm is
not available in the caller's environment.
public static MessageDigest getInstance(java.lang.String algorithm,
java.lang.String provider)
throws java.lang.Exception
algorithm - the name of the algorithm requested.
See Appendix A in the
Java Cryptography Architecture API Specification & Reference
for information about standard algorithm names.provider - the name of the provider.NoSuchAlgorithmException - if the algorithm is
not available in the package supplied by the requested
provider.NoSuchProviderException - if the provider is not
available in the environment.Provider
public static boolean isEqual(byte[] digesta,
byte[] digestb)
digesta - one of the digests to compare.digestb - the other digest to compare.public void reset()
public final void update(byte input)
input - the byte with which to update the digest.
public final void update(byte[] input,
int offset,
int len)
input - the array of bytes.offset - the offset to start from in the array of bytes.len - the number of bytes to use, starting at
offset.public final void update(byte[] input)
input - the array of bytes.protected abstract byte[] engineDigest()
engineDigest has
been called, the engine should be reset (see reset). Resetting is the responsibility of the
engine implementor.protected abstract void engineReset()
protected abstract void engineUpdate(byte input)
input - the byte to use for the update.
protected void engineUpdate(byte[] b,
int off,
int len)
b - the byte array whichs data is addedoff - offset into the arraylen - count of bytes which are added
protected static final int rol(int value,
int bits)
value - - value to by rotateted leftbist - - count of bits to rotate left
public final byte[] hmac(byte[] k,
byte[] t1,
byte[] t2,
byte[] t3,
byte[] t4,
byte[] t5)
md - MessageDigestk - key-parameter(see formula)t1..t5 - text parameters(see formula)public abstract java.lang.Object clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||