use of de.uni_koblenz.aggrimm.icp.crypto.sign.algorithm.algorithm.SignatureAlgorithmFisteus2010 in project webofneeds by researchstudio-sat.
the class WonHasher method calculateHashIdForDataset.
public String calculateHashIdForDataset(Dataset dataset) throws Exception {
SignatureAlgorithmInterface algorithm = new SignatureAlgorithmFisteus2010();
// signatureAlgorithmPool.borrowObject();
try {
GraphCollection graphCollection = ModelConverter.fromDataset(dataset);
algorithm.canonicalize(graphCollection);
algorithm.postCanonicalize(graphCollection);
algorithm.hash(graphCollection, ENV_HASH_ALGORITHM);
algorithm.postHash(graphCollection);
graphCollection.getSignature().getDigestGen().reset();
return hashToString(graphCollection.getSignature().getHash());
} finally {
if (algorithm != null) {
// signatureAlgorithmPool.returnObject(algorithm);
}
}
}
use of de.uni_koblenz.aggrimm.icp.crypto.sign.algorithm.algorithm.SignatureAlgorithmFisteus2010 in project webofneeds by researchstudio-sat.
the class WonHasher method hashNamedGraphForSigning.
/**
* Calculates the hash of the one named graph contained in the specified
* GraphCollection
*
* @param inputWithOneNamedGraph
* @return the SignatureData object that holds the hash
* @throws Exception
*/
public SignatureData hashNamedGraphForSigning(final GraphCollection inputWithOneNamedGraph) throws Exception {
SignatureAlgorithmInterface algorithm = new SignatureAlgorithmFisteus2010();
// signatureAlgorithmPool.borrowObject();
try {
algorithm.canonicalize(inputWithOneNamedGraph);
algorithm.postCanonicalize(inputWithOneNamedGraph);
algorithm.hash(inputWithOneNamedGraph, ENV_HASH_ALGORITHM);
algorithm.postHash(inputWithOneNamedGraph);
inputWithOneNamedGraph.getSignature().getDigestGen().reset();
return inputWithOneNamedGraph.getSignature();
} finally {
if (algorithm != null) {
// signatureAlgorithmPool.returnObject(algorithm);
}
}
}
Aggregations