List<Protos.Key> toProtobuf() { LinkedList<Protos.Key> entries = newLinkedList(); List<Protos.Key.Builder> protos = toEditableProtobuf(); for (Protos.Key.Builder proto : protos) { entries.add(proto.build()); } return entries; }
List<Protos.Key> toProtobuf() { LinkedList<Protos.Key> entries = newLinkedList(); List<Protos.Key.Builder> protos = toEditableProtobuf(); for (Protos.Key.Builder proto : protos) { entries.add(proto.build()); } return entries; }
/** * <code>repeated .com.openwallet.core.protos.Key key = 3;</code> */ public Builder addKey( int index, com.openwallet.core.protos.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { ensureKeyIsMutable(); key_.add(index, builderForValue.build()); onChanged(); } else { keyBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
Protos.Key.Builder mnemonicEntry = KeyUtils.serializeEncryptableItem(wallet.getSeed()); mnemonicEntry.setType(Protos.Key.Type.DETERMINISTIC_MNEMONIC); walletBuilder.setSeed(mnemonicEntry.build());
/** * <code>required .com.openwallet.core.protos.Key master_key = 3;</code> */ public Builder setMasterKey( com.openwallet.core.protos.Protos.Key.Builder builderForValue) { if (masterKeyBuilder_ == null) { masterKey_ = builderForValue.build(); onChanged(); } else { masterKeyBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; return this; } /**
/** * <code>repeated .com.openwallet.core.protos.Key key = 3;</code> */ public Builder setKey( int index, com.openwallet.core.protos.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { ensureKeyIsMutable(); key_.set(index, builderForValue.build()); onChanged(); } else { keyBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .com.openwallet.core.protos.Key key = 3;</code> */ public Builder addKey( com.openwallet.core.protos.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { ensureKeyIsMutable(); key_.add(builderForValue.build()); onChanged(); } else { keyBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>optional .com.openwallet.core.protos.Key seed = 2;</code> */ public Builder setSeed( com.openwallet.core.protos.Protos.Key.Builder builderForValue) { if (seedBuilder_ == null) { seed_ = builderForValue.build(); onChanged(); } else { seedBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; return this; } /**
private static Protos.Key getMasterKeyProto(Wallet wallet) { DeterministicKey key = wallet.getMasterKey(); Protos.Key.Builder proto = KeyUtils.serializeKey(key); proto.setType(Protos.Key.Type.DETERMINISTIC_KEY); final Protos.DeterministicKey.Builder detKey = proto.getDeterministicKeyBuilder(); detKey.setChainCode(ByteString.copyFrom(key.getChainCode())); for (ChildNumber num : key.getPath()) { detKey.addPath(num.i()); } return proto.build(); }