if (key.hasSecretBytes()) { final BigInteger priv = new BigInteger(1, key.getSecretBytes().toByteArray()); detkey = new DeterministicKey(immutablePath, chainCode, pubkey, priv, parent); } else {
List<String> mnemonic = Splitter.on(" ").splitToList(key.getSecretBytes().toStringUtf8()); seed = new DeterministicSeed(new byte[16], mnemonic, 0); } else if (key.hasEncryptedData()) {
public Builder mergeFrom(com.openwallet.core.protos.Protos.Key other) { if (other == com.openwallet.core.protos.Protos.Key.getDefaultInstance()) return this; if (other.hasType()) { setType(other.getType()); } if (other.hasSecretBytes()) { setSecretBytes(other.getSecretBytes()); } if (other.hasEncryptedData()) { mergeEncryptedData(other.getEncryptedData()); } if (other.hasPublicKey()) { setPublicKey(other.getPublicKey()); } if (other.hasLabel()) { bitField0_ |= 0x00000010; label_ = other.label_; onChanged(); } if (other.hasDeterministicKey()) { mergeDeterministicKey(other.getDeterministicKey()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional bytes secret_bytes = 2;</code> * * <pre> * Either the private EC key bytes (without any ASN.1 wrapping), or the deterministic root seed. * If the secret is encrypted, or this is a "watching entry" then this is missing. * </pre> */ public Builder clearSecretBytes() { bitField0_ = (bitField0_ & ~0x00000002); secretBytes_ = getDefaultInstance().getSecretBytes(); onChanged(); return this; }