@Override public DeterministicKeyChain makeKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicSeed seed, KeyCrypter crypter, boolean isMarried) { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(seed, crypter); else chain = new DeterministicKeyChain(seed, crypter); return chain; }
@Override public DeterministicKeyChain makeKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicSeed seed, KeyCrypter crypter, boolean isMarried, ImmutableList<ChildNumber> accountPath) { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(seed, crypter); else chain = new DeterministicKeyChain(seed, crypter, accountPath); return chain; }
@Override public DeterministicKeyChain makeKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicSeed seed, KeyCrypter crypter, boolean isMarried) { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(seed, crypter); else chain = new DeterministicKeyChain(seed, crypter); return chain; }
@Override public DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried) throws UnreadableWalletException { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(accountKey); else chain = new DeterministicKeyChain(accountKey, isFollowingKey); return chain; } }
@Override public DeterministicKeyChain makeKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicSeed seed, KeyCrypter crypter, boolean isMarried, boolean useSegwit) { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(seed, crypter); else chain = new DeterministicKeyChain(seed, crypter, useSegwit); return chain; }
@Override public DeterministicKeyChain makeKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicSeed seed, KeyCrypter crypter, boolean isMarried) { DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(seed, crypter); else chain = new DeterministicKeyChain(seed, crypter); return chain; }
@Override public MarriedKeyChain build() { checkState(random != null || entropy != null || seed != null || watchingKey!= null, "Must provide either entropy or random or seed or watchingKey"); checkNotNull(followingKeys, "followingKeys must be provided"); MarriedKeyChain chain; if (threshold == 0) threshold = (followingKeys.size() + 1) / 2 + 1; if (random != null) { chain = new MarriedKeyChain(random, bits, getPassphrase(), seedCreationTimeSecs); } else if (entropy != null) { chain = new MarriedKeyChain(entropy, getPassphrase(), seedCreationTimeSecs); } else if (seed != null) { seed.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(seed); } else { watchingKey.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(watchingKey); } chain.addFollowingAccountKeys(followingKeys, threshold); return chain; } }
@Override public MarriedKeyChain build() { checkState(random != null || entropy != null || seed != null || watchingKey!= null, "Must provide either entropy or random or seed or watchingKey"); checkNotNull(followingKeys, "followingKeys must be provided"); MarriedKeyChain chain; if (threshold == 0) threshold = (followingKeys.size() + 1) / 2 + 1; if (random != null) { chain = new MarriedKeyChain(random, bits, getPassphrase(), seedCreationTimeSecs); } else if (entropy != null) { chain = new MarriedKeyChain(entropy, getPassphrase(), seedCreationTimeSecs); } else if (seed != null) { seed.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(seed); } else { watchingKey.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(watchingKey); } chain.addFollowingAccountKeys(followingKeys, threshold); return chain; } }
@Override public MarriedKeyChain build() { checkState(random != null || entropy != null || seed != null || watchingKey!= null, "Must provide either entropy or random or seed or watchingKey"); checkNotNull(followingKeys, "followingKeys must be provided"); MarriedKeyChain chain; if (threshold == 0) threshold = (followingKeys.size() + 1) / 2 + 1; if (random != null) { chain = new MarriedKeyChain(random, bits, getPassphrase(), seedCreationTimeSecs); } else if (entropy != null) { chain = new MarriedKeyChain(entropy, getPassphrase(), seedCreationTimeSecs); } else if (seed != null) { seed.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(seed); } else { watchingKey.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(watchingKey); } chain.addFollowingAccountKeys(followingKeys, threshold); return chain; } }
@Override public MarriedKeyChain build() { checkState(random != null || entropy != null || seed != null || watchingKey!= null, "Must provide either entropy or random or seed or watchingKey"); checkNotNull(followingKeys, "followingKeys must be provided"); MarriedKeyChain chain; if (threshold == 0) threshold = (followingKeys.size() + 1) / 2 + 1; if (random != null) { chain = new MarriedKeyChain(random, bits, getPassphrase(), seedCreationTimeSecs); } else if (entropy != null) { chain = new MarriedKeyChain(entropy, getPassphrase(), seedCreationTimeSecs); } else if (seed != null) { seed.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(seed); } else { watchingKey.setCreationTimeSeconds(seedCreationTimeSecs); chain = new MarriedKeyChain(watchingKey); } chain.addFollowingAccountKeys(followingKeys, threshold); return chain; } }
@Override public DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried) throws UnreadableWalletException { if (!accountKey.getPath().equals(DeterministicKeyChain.ACCOUNT_ZERO_PATH)) throw new UnreadableWalletException("Expecting account key but found key with path: " + HDUtils.formatPath(accountKey.getPath())); DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(accountKey); else chain = new DeterministicKeyChain(accountKey, isFollowingKey); return chain; } }
@Override public DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried) throws UnreadableWalletException { if (!accountKey.getPath().equals(DeterministicKeyChain.ACCOUNT_ZERO_PATH)) throw new UnreadableWalletException("Expecting account key but found key with path: " + HDUtils.formatPath(accountKey.getPath())); DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(accountKey); else chain = new DeterministicKeyChain(accountKey, isFollowingKey); return chain; } }
@Override public DeterministicKeyChain makeWatchingKeyChain(Protos.Key key, Protos.Key firstSubKey, DeterministicKey accountKey, boolean isFollowingKey, boolean isMarried, boolean useSegwit) throws UnreadableWalletException { if (!accountKey.getPath().equals(DeterministicKeyChain.accountZeroPath(useSegwit))) throw new UnreadableWalletException("Expecting account key but found key with path: " + HDUtils.formatPath(accountKey.getPath())); DeterministicKeyChain chain; if (isMarried) chain = new MarriedKeyChain(accountKey); else chain = new DeterministicKeyChain(accountKey, isFollowingKey, useSegwit); return chain; } }