org.neuclear.commons.crypto.channels
Class DigestChannel
java.lang.Object
org.neuclear.commons.crypto.channels.AbstractCryptoChannel
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
|
Method Summary |
void |
close()
|
byte[] |
getDigest()
Call this to get the Digest |
int |
write(java.nio.ByteBuffer buffer)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.