|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
com.Ostermiller.util.MD5OutputStream
public class MD5OutputStream
Implements MD5 functionality on a stream. More information about this class is available from ostermiller.org.
This class produces a 128-bit "fingerprint" or "message digest" for all data written to this stream. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given pre-specified target message digest. The MD5 algorithm is intended for digital signature applications, where a large file must be "compressed" in a secure manner before being encrypted with a private (secret) key under a public-key cryptosystem such as RSA.
For more information see RFC1321.
MD5
,
MD5InputStream
Constructor Summary | |
---|---|
MD5OutputStream(OutputStream out)
Creates MD5OutputStream |
Method Summary | |
---|---|
byte[] |
getHash()
Returns array of bytes representing hash of the stream so far. |
String |
getHashString()
Get a 32-character hex representation representing hash of the stream so far. |
void |
write(byte[] b,
int off,
int len)
Writes length bytes from the specified byte array starting a offset off to this output stream. |
void |
write(int b)
Writes the specified byte to this output stream. |
Methods inherited from class java.io.FilterOutputStream |
---|
close, flush, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MD5OutputStream(OutputStream out)
out
- The output streamMethod Detail |
---|
public void write(int b) throws IOException
write
in class FilterOutputStream
b
- the byte.
IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.
IOException
- if an I/O error occurs.public byte[] getHash()
public String getHashString()
|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2012 by Stephen Ostermiller