Top Description Methods
org.bouncycastle.tsp.ers

public Interface ERSRootNodeCalculator

Known Direct Implementers
org.bouncycastle.tsp.ers.BinaryTreeRootCalculator
Imports
org.bouncycastle.asn1.tsp.PartialHashtree, org.bouncycastle.operator.DigestCalculator

Base interface for an implementation that calculates the root hash contained in the time-stamp from the Merkle tree based on the partial hash-tree nodes.

Method Summary

Modifier and TypeMethod and Description
public PartialHashtree[]
computePathToRoot(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree
the leaf node at the start of the path.
node
,
int
the index of the node in the original list of partial hash trees.
index
)

Calculate a path from the leaf node to the root of the last computed Merkle tree.

public byte[]

Returns:

the root hash of the Merkle tree.
computeRootHash
(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree[]
the partial hash-trees forming the basis of the Merkle tree.
nodes
)

Calculate the root hash of the Merkle tree from the partial hash-tree nodes.

public byte[]

Returns:

the root hash of the Merkle tree.
recoverRootHash
(DigestCalculator
the digest calculator to use.
digCalc
,
PartialHashtree[]
the partial hash-trees forming a path from a leaf to the root of the Merkle tree.
nodes
)

Recover the root hash from a path made up of PartialHashtrees.

Method Detail

computePathToRootback to summary
public PartialHashtree[] computePathToRoot(DigestCalculator digCalc, PartialHashtree node, int index)

Calculate a path from the leaf node to the root of the last computed Merkle tree.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

node:PartialHashtree

the leaf node at the start of the path.

index:int

the index of the node in the original list of partial hash trees.

computeRootHashback to summary
public byte[] computeRootHash(DigestCalculator digCalc, PartialHashtree[] nodes)

Calculate the root hash of the Merkle tree from the partial hash-tree nodes.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

nodes:PartialHashtree[]

the partial hash-trees forming the basis of the Merkle tree.

Returns:byte[]

the root hash of the Merkle tree.

recoverRootHashback to summary
public byte[] recoverRootHash(DigestCalculator digCalc, PartialHashtree[] nodes)

Recover the root hash from a path made up of PartialHashtrees.

Parameters
digCalc:DigestCalculator

the digest calculator to use.

nodes:PartialHashtree[]

the partial hash-trees forming a path from a leaf to the root of the Merkle tree.

Returns:byte[]

the root hash of the Merkle tree.