|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.asunder.content.AsunderContentManager
org.asunder.content.SSCHKContentManager
public class SSCHKContentManager
Constructor Summary | |
---|---|
SSCHKContentManager(SSCHKContent content)
Creates a new instance of SSCHKContentManager |
Method Summary | |
---|---|
void |
computeDataDigest()
|
void |
computeKbrIdBytes()
Computes and sets the kbr id for the content |
void |
computeSignature(java.security.PrivateKey priKey)
Computes the content's signature using the supplied private key (which must match the public key of course) as sign(prikey,concat(hash,path)) Assumes the dataDigest is correct, so be warned This can be processor intensive, so be sure to run in a thread |
static SSCHKContent |
generateSSCHKContent(byte[] data,
java.security.PublicKey pubKey,
java.security.PrivateKey priKey,
java.lang.String path)
|
static SSCHKContentKey |
generateSSCHKContentKey(byte[] dataDigest,
java.security.PublicKey pubKey,
java.lang.String path)
Don't really know how fast this will run, so no recommendation on running in separate thread |
protected byte[] |
getComputedDataDigest()
|
protected byte[] |
getComputedKbrIdBytes()
Computes the kbrId bytes as digest(concat(pubkey,hash,path)) |
DHTContentKey |
getContentKey()
|
byte[] |
getDataDigest()
|
java.lang.String |
getPath()
|
java.security.PublicKey |
getPublicKey()
|
byte[] |
getSignature()
|
boolean |
verifyContent()
|
boolean |
verifyDataDigest()
|
boolean |
verifyKbrIdBytes()
Verifies the the kbr ID is properly computed from the public key, data digest, and (optional) path |
boolean |
verifySignature()
Verifies the contents signature. |
Methods inherited from class org.asunder.content.AsunderContentManager |
---|
getManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SSCHKContentManager(SSCHKContent content)
Method Detail |
---|
public byte[] getDataDigest()
public java.lang.String getPath()
public java.security.PublicKey getPublicKey()
public byte[] getSignature()
public DHTContentKey getContentKey()
protected byte[] getComputedDataDigest() throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException
public void computeDataDigest() throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException
public boolean verifyDataDigest() throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException
public boolean verifySignature() throws java.security.NoSuchAlgorithmException, java.io.IOException, java.security.SignatureException, java.security.InvalidKeyException, DHTContentHashException
java.security.NoSuchAlgorithmException
java.io.IOException
java.security.SignatureException
java.security.InvalidKeyException
DHTContentHashException
public void computeSignature(java.security.PrivateKey priKey) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.io.IOException, java.security.SignatureException
priKey
- the publisher's private key
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.io.IOException
java.security.SignatureException
protected byte[] getComputedKbrIdBytes() throws DHTContentHashException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
Computes the kbrId bytes as digest(concat(pubkey,hash,path))
Computes the data digest too if this is not set (but assumes it is correct if it is)
DHTContentHashException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
public void computeKbrIdBytes() throws DHTContentHashException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
Computes and sets the kbr id for the content
Notice that this does not involve the signature, so it may be computed without access to the private key
DHTContentHashException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
public boolean verifyKbrIdBytes() throws DHTContentHashException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
Verifies the the kbr ID is properly computed from the public key, data digest, and (optional) path
Notice that no assumptions are made as to the validity of the data digest
DHTContentHashException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
public boolean verifyContent() throws DHTContentHashException, DHTContentSignatureException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
verifyContent
in class AsunderContentManager
DHTContentHashException
DHTContentSignatureException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
public static SSCHKContent generateSSCHKContent(byte[] data, java.security.PublicKey pubKey, java.security.PrivateKey priKey, java.lang.String path) throws DHTContentHashException, DHTContentSignatureException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
DHTContentHashException
DHTContentSignatureException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
public static SSCHKContentKey generateSSCHKContentKey(byte[] dataDigest, java.security.PublicKey pubKey, java.lang.String path) throws DHTContentHashException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.SignatureException, java.security.InvalidKeyException
Don't really know how fast this will run, so no recommendation on running in separate thread
DHTContentHashException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.SignatureException
java.security.InvalidKeyException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |