3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-14 19:25:51 +00:00

Expose the DeterministicKey ctors used by serialisation

These ctors are the only way to construct a key without a parent
but with a depth that matches the path passed in. The ctors taking
parents set the depth to 0 when parent is null. Whether this is
desirable is not clear; exposing the other ctors seems a lower risk
change given the comments in this file that detail support for depth
not matching the path length.

The use case for this change is interfacing with APIs that allow
derivation of children from a path without returning the intermediate
keys. In this case we have no parent to pass to the ctor but we want
to create a correct DeterministicKey for interop with the rest of bitcoinj.
This commit is contained in:
Jon Griffiths 2016-08-15 23:00:41 +12:00 committed by Andreas Schildbach
parent 5883cf9ddb
commit cbe57555b2

View File

@ -130,7 +130,7 @@ public class DeterministicKey extends ECKey {
* information about its parent key. Invoked when deserializing, but otherwise not something that
* you normally should use.
*/
private DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
public DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
byte[] chainCode,
LazyECPoint publicAsPoint,
@Nullable DeterministicKey parent,
@ -150,7 +150,7 @@ public class DeterministicKey extends ECKey {
* information about its parent key. Invoked when deserializing, but otherwise not something that
* you normally should use.
*/
private DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
public DeterministicKey(ImmutableList<ChildNumber> childNumberPath,
byte[] chainCode,
BigInteger priv,
@Nullable DeterministicKey parent,