aQute.libg.cryptography
Class Digester<T extends Digest>

java.lang.Object
  extended by java.io.OutputStream
      extended by aQute.libg.cryptography.Digester<T>
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public abstract class Digester<T extends Digest>
extends java.io.OutputStream


Field Summary
protected  java.security.MessageDigest md
           
 
Constructor Summary
Digester(java.security.MessageDigest instance)
           
 
Method Summary
abstract  T digest()
           
abstract  T digest(byte[] bytes)
           
 T from(java.io.InputStream in)
           
abstract  java.lang.String getAlgorithm()
           
 java.security.MessageDigest getMessageDigest()
           
 void write(byte[] buffer, int offset, int length)
           
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

md

protected java.security.MessageDigest md
Constructor Detail

Digester

public Digester(java.security.MessageDigest instance)
Method Detail

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Overrides:
write in class java.io.OutputStream
Throws:
java.io.IOException

write

public void write(int b)
           throws java.io.IOException
Specified by:
write in class java.io.OutputStream
Throws:
java.io.IOException

getMessageDigest

public java.security.MessageDigest getMessageDigest()
                                             throws java.lang.Exception
Throws:
java.lang.Exception

from

public T from(java.io.InputStream in)
                      throws java.lang.Exception
Throws:
java.lang.Exception

digest

public abstract T digest()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

digest

public abstract T digest(byte[] bytes)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getAlgorithm

public abstract java.lang.String getAlgorithm()