org.neuclear.commons.crypto.channels
Class DigestChannel

java.lang.Object
  extended by org.neuclear.commons.crypto.channels.AbstractCryptoChannel
      extended by org.neuclear.commons.crypto.channels.DigestChannel
All Implemented Interfaces:
java.io.Closeable, java.nio.channels.Channel, java.nio.channels.WritableByteChannel

public class DigestChannel
extends AbstractCryptoChannel

WritableByteChannel for producing SHA! Digests from ByteBuffers


Field Summary
 
Fields inherited from class org.neuclear.commons.crypto.channels.AbstractCryptoChannel
closed
 
Constructor Summary
DigestChannel()
           
DigestChannel(java.security.MessageDigest digest)
           
DigestChannel(java.lang.String alg)
           
 
Method Summary
 void close()
           
 byte[] getDigest()
          Call this to get the Digest
 int write(java.nio.ByteBuffer buffer)
           
 
Methods inherited from class org.neuclear.commons.crypto.channels.AbstractCryptoChannel
isOpen, pipe, pipe, source, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestChannel

public DigestChannel()
              throws java.security.NoSuchAlgorithmException,
                     java.io.IOException
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException

DigestChannel

public DigestChannel(java.security.MessageDigest digest)
              throws java.io.IOException
Throws:
java.io.IOException

DigestChannel

public DigestChannel(java.lang.String alg)
              throws java.security.NoSuchAlgorithmException,
                     java.io.IOException
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException
Method Detail

write

public int write(java.nio.ByteBuffer buffer)
          throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in interface java.nio.channels.Channel
Overrides:
close in class AbstractCryptoChannel
Throws:
java.io.IOException

getDigest

public byte[] getDigest()
                 throws CryptoException
Call this to get the Digest

Returns:
Throws:
CryptoException


Copyright © 2003-2004 Antilles Software Ventures SA. All Rights Reserved.