org.asunder.content
Class CHKContentManager
java.lang.Object
org.asunder.content.AsunderContentManager
org.asunder.content.CHKContentManager
public class CHKContentManager
- extends AsunderContentManager
- Author:
- simms2k
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CHKContentManager
public CHKContentManager(CHKContent content)
- Creates a new instance of CHKContentManager
getDataDigest
public byte[] getDataDigest()
- get the (not necessarily verified) data digest
computeDataDigest
public byte[] computeDataDigest()
throws java.io.IOException,
java.security.NoSuchAlgorithmException
- Sets the content's kbrId to the data digest
Called on locally created CHKContent to prepare it for transport
This can be processor intensive, so be sure to run in a thread
- Returns:
- the computed digest
- Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
verifyDataDigest
public boolean verifyDataDigest()
throws java.io.IOException,
java.security.NoSuchAlgorithmException
- Verifies the digest of content that has been received by the local node
- Returns:
- whether the digest is correct
- Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
getContentKey
public DHTContentKey getContentKey()
verifyContent
public boolean verifyContent()
throws java.io.IOException,
java.security.NoSuchAlgorithmException
- Specified by:
verifyContent
in class AsunderContentManager
- Throws:
java.io.IOException
java.security.NoSuchAlgorithmException
generateCHKContent
public static CHKContent generateCHKContent(byte[] data)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
- Throws:
java.io.IOException
java.security.NoSuchAlgorithmException