Package org.bouncycastle.tsp
Class PartialHashTreeProcessor
java.lang.Object
org.bouncycastle.tsp.PartialHashTreeProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsHash(byte[] hash) Checks whether a PartialHashtree (RFC4998) contains a given hash.byte[]getHash(DigestCalculator digestCalculator) Compute a hash over the whole partialHashTree: - Concatenate all the hashes contained in the partial hash tree; - Generate a hash over the concatenated hashes, using a providedDigestCalculator.voidverifyContainsHash(byte[] hash) Checks whether a PartialHashtree (RFC4998) contains a given hash.
-
Constructor Details
-
PartialHashTreeProcessor
public PartialHashTreeProcessor(org.bouncycastle.asn1.tsp.PartialHashtree tree)
-
-
Method Details
-
getHash
Compute a hash over the whole partialHashTree: - Concatenate all the hashes contained in the partial hash tree; - Generate a hash over the concatenated hashes, using a providedDigestCalculator.- Parameters:
digestCalculator- theDigestCalculatorto use in order to generate the hash- Returns:
- a hash value that is representative of the whole partial hash tree.
-
verifyContainsHash
Checks whether a PartialHashtree (RFC4998) contains a given hash.- Parameters:
hash- the hash to check- Throws:
PartialHashTreeVerificationException- if the hash is not present in the PartialHashtree
-
containsHash
public boolean containsHash(byte[] hash) Checks whether a PartialHashtree (RFC4998) contains a given hash.- Parameters:
hash- the hash to check- Returns:
- true if the hash is present within the PartialHashtree's set of values, false otherwise.
-